'*******************************************************************************
' EverEdit Syntax File
' Language:    ASP
' Maintainer:  www.everedit.net  
' History:
'   2012/02/15 First Version
'   2012/06/05 Improve for EE 2.0
'   2014/05/16 Added ASP syntax in rHtmlTag/rTagString1/rTagString2
'   2014/07/14 Added more key words and outline support
'*******************************************************************************
Include( ".\html_base.mac" )

Set rAsp=html.CreateRegion( COLOR_DEFAULT, "+<%+", "+%>+", False )
rAsp.Name="source.asp"

'comment
Set rAspLineComment=html.CreateRegion( COLOR_COMMENT1, "+'+", "$", False )
rAsp.AddRegion( html.CreateRegion(COLOR_COMMENT1, "\brem\b", "$", False ) )

'string
Set rAspString2=html.CreateStringRegion( COLOR_STRING2, """", "", True )

rAsp.AddRegion( rAspLineComment )
rAsp.AddRegion( rAspString2 )

'Reserved words
Set wWord1=html.CreateWord( COLOR_WORD1, "Anchor And As ByRef ByVal Call Case Class Clear Const Debug Description Dictionary Dim Do Document Each Element Else ElseIf Empty End Eqv Erase Err Error Execute ExecuteGlobal Exit Explicit False FileSystemObject  FirstIndex For Form Function Get Global Goto HelpContext HelpFile History If IgnoreCase Imp In InstrRev Is Length Let Link Location Loop Match Matches Mod Navigator New Next Not Nothing Null Number On Option Or Pattern Preserve Private Property Public Raise Randomize ReDim RegExp Resume Select Set Source Step Stop Sub SubMatches Test TextStream Then To True Until Value vbCrLf WeekDayName Wend While Window With Write WriteLine Xor", False )
wWord1.AutoCase=True

'Functions and objects
Set wWord2=html.CreateWord( COLOR_WORD2, "Abs Array Asc Atn CBool CByte CCur CDate CDbl Chr CInt CLng Conversions Cos CreateObject CSng CStr Date DateAdd DateDiff DatePart DateSerial DateValue Day Derived Escape Eval Exp Filter Fix FormatCurrency FormatDateTime FormatNumber FormatPercent GetLocale GetObject GetRef Hex Hour InputBox InStr InStrRev Int IsArray IsDate IsEmpty IsNull IsNumeric IsObject Join LBound LCase Left Len LoadPicture Log LTrim Math Maths Mid Minute Month MonthName MsgBox Now Oct Replace RGB Right Rnd Round RTrim ScriptEngine ScriptEngineBuildVersion ScriptEngineMajorVersion ScriptEngineMinorVersion Second SetLocale Sgn Sin Space Split Sqr StrComp String StrReverse Tan Time Timer TimeSerial TimeValue Trim TypeName UBound UCase Unescape VarType Weekday WeekdayName Year", False )
wWord2.AutoCase=True

Set wWord3=html.CreateWord( COLOR_WORD3, "Response Cookies Request", False )
wWord3.AutoCase=True

'Const
Set wWord4=html.CreateWord( COLOR_WORD2, "vbAbort vbAbortRetryIgnore vbApplicationModal vbArray vbBinaryCompare vbBlack vbBlue vbBoolean vbByte vbCancel vbCr vbCritical vbCrLf vbCurrency vbCyan vbDataObject vbDate vbDecimal vbDefaultButton1 vbDefaultButton2 vbDefaultButton3 vbDefaultButton4 vbDouble vbEmpty vbError vbExclamation vbFalse vbFirstFourDays vbFirstFullWeek vbFirstJan1 vbFormFeed vbFriday vbGeneralDate vbGreen vbIgnore vbInformation vbInteger vbLf vbLong vbLongDate vbLongTime vbMagenta vbMonday vbNewLine vbNo vbNull vbNullChar vbNullString vbObject vbObjectError vbOK vbOKCancel vbOKOnly vbQuestion vbRed vbRetry vbRetryCancel vbSaturday vbShortDate vbShortTime vbSingle vbString vbSunday vbSystemModal vbTab vbTextCompare vbThursday vbTrue vbTuesday vbUseDefault vbUseSystemDayOfWeek vbVariant vbVerticalTab vbWednesday vbWhite vbYellow vbYes vbYesNo vbYesNoCancel", False )
wWord4.AutoCase=True

rAsp.AddItem(wWord1)
rAsp.AddItem(wWord2)
rAsp.AddItem(wWord3)
rAsp.AddItem(wWord4)

'<% %>
rAsp.AddItem( html.CreateItem(COLOR_SUBLAN, "<%|%>", False) )

rAsp.CommentLine("'")
rAsp.SetPairs( "[](){}""""" )
rAsp.AddCallTip "asp.ecp", False, "."
rAsp.FoldText "\bThen\s*$|\b(Do|For)\s+(?=\w+)|(?<!\b(End|Exit)\s+)(Function|Sub|Select)\b", False, "\b(Wend|End If|Elseif|End Select|End Sub|End Function|Loop)\b|^\s*Next\s*$", False
rAsp.IndentText "\b(Then|Do|For|Function|Sub|Select|Case|Else|ElseIf)\b", False, "\b(Next|Wend)\s*$|\bEnd\b", False

Set rAspInTag=html.CopyRegion( rAsp )
rHtmlTag.AddRegion( rAspInTag )

Set rAspInString1=html.CopyRegion( rAsp )
rTagString1.AddRegion rAspInString1

Set rAspInString2=html.CopyRegion( rAsp )
rTagString2.AddRegion rAspInString2

'-----------------------add rAsp to html parser
html.AddRegion( rAsp )

'default html tags
html.AddRegion( rScript )
html.AddRegion( rCss )
html.AddRegion( rHtmlBlockComment )
html.AddRegion( rHtmlTag )

