home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / aspvbs.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  7.2 KB  |  148 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    Microsoft VBScript Web Content (ASP)
  3. " Maintainer:    Devin Weaver <ktohg@tritarget.com>
  4. " URL:        http://www.tritarget.com/vim/syntax
  5. " Last change:    1999 Sep 18
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9.  
  10. if !exists("main_syntax")
  11.   let main_syntax = 'aspvbs'
  12. endif
  13.  
  14. so <sfile>:p:h/html.vim
  15.  
  16. syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
  17.  
  18. " Functions and methods that are in VB but will cause errors in an ASP page
  19. " This is helpfull if your porting VB code to ASP
  20. " I removed (Count, Item) because these are common variable names in AspVBScript
  21. syn keyword AspVBSError contained Val Str CVar CVDate DoEvents GoSub Return GoTo
  22. syn keyword AspVBSError contained Date Time Timer Stop LinkExecute
  23. syn keyword AspVBSError contained Add With Type LinkPoke
  24. syn keyword AspVBSError contained LinkRequest LinkSend Declare New Optional Sleep
  25. syn keyword AspVBSError contained ParamArray Static Erl TypeOf Like LSet RSet Mid StrConv
  26. " It may seem that most of these can fit into a keyword clause but keyword takes
  27. " priority over all so I can't get the multi-word matches
  28. syn match AspVBSError contained "\<Def[a-zA-Z0-9_]\+\>"
  29. syn match AspVBSError contained "^\s*Open"
  30. syn match AspVBSError contained "Debug\.[a-zA-Z0-9_]*"
  31. syn match AspVBSError contained "^\s*[a-zA-Z0-9_]\+:"
  32. syn match AspVBSError contained "[a-zA-Z0-9_]\+![a-zA-Z0-9_]\+"
  33. syn match AspVBSError contained "^\s*#.*$"
  34. syn match AspVBSError contained "\<As\s\+[a-zA-Z0-9_]*"
  35. syn match AspVBSError contained "\<End\>\|\<Exit\>"
  36. syn match AspVBSError contained "\<On\s\+Error\>\|\<On\>\|\<Error\>\|\<Resume\s\+Next\>\|\<Resume\>"
  37. syn match AspVBSError contained "\<Option\s\+\(Base\|Compare\|Private\s\+Module\)\>"
  38. syn match AspVBSError contained "\<Property\s\+\(Get\|Let\|Set\)\>"
  39.  
  40. " AspVBScript Reserved Words.
  41. syn match AspVBSStatement contained "\<On\s\+Error\s\+Resume\s\+Next\>\|\<Next\>"
  42. syn match AspVBSStatement contained "\<End\s\+\(If\|For\|Select\|Function\|Sub\)\>"
  43. syn match AspVBSStatement contained "\<Exit\s\+\(Do\|For\|Sub\|Function\)\>"
  44. syn match AspVBSStatement contained "\<Option\s\+Explicit\>"
  45. syn match AspVBSStatement contained "\<For\s\+Each\>\|\<For\>"
  46. syn match AspVBSStatement contained "\<Set\>"
  47. syn keyword AspVBSStatement contained Call Const Dim Do Loop Erase And
  48. syn keyword AspVBSStatement contained Function If Then Else ElseIf Or
  49. syn keyword AspVBSStatement contained Private Public Randomize ReDim
  50. syn keyword AspVBSStatement contained Select Case Sub While Wend Not
  51.  
  52. " AspVBScript Functions
  53. syn keyword AspVBSFunction contained Abs Array Asc Atn CBool CByte CCur CDate CDbl
  54. syn keyword AspVBSFunction contained Chr CInt CLng Cos CreateObject CSng CStr Date
  55. syn keyword AspVBSFunction contained DateAdd DateDiff DatePart DateSerial DateValue
  56. syn keyword AspVBSFunction contained Day Exp Filter Fix FormatCurrency
  57. syn keyword AspVBSFunction contained FormatDateTime FormatNumber FormatPercent
  58. syn keyword AspVBSFunction contained GetObject Hex Hour InputBox InStr InStrRev Int
  59. syn keyword AspVBSFunction contained IsArray IsDate IsEmpty IsNull IsNumeric
  60. syn keyword AspVBSFunction contained IsObject Join LBound LCase Left Len LoadPicture
  61. syn keyword AspVBSFunction contained Log LTrim Mid Minute Month MonthName MsgBox Now
  62. syn keyword AspVBSFunction contained Oct Replace RGB Right Rnd Round RTrim
  63. syn keyword AspVBSFunction contained ScriptEngine ScriptEngineBuildVersion
  64. syn keyword AspVBSFunction contained ScriptEngineMajorVersion
  65. syn keyword AspVBSFunction contained ScriptEngineMinorVersion Second Sgn Sin Space
  66. syn keyword AspVBSFunction contained Split Sqr StrComp StrReverse String Tan Time
  67. syn keyword AspVBSFunction contained TimeSerial TimeValue Trim TypeName UBound UCase
  68. syn keyword AspVBSFunction contained VarType Weekday WeekdayName Year
  69.  
  70. " AspVBScript Methods
  71. syn keyword AspVBSMethods contained Add AddFolders BuildPath Clear Close Copy
  72. syn keyword AspVBSMethods contained CopyFile CopyFolder CreateFolder CreateTextFile
  73. syn keyword AspVBSMethods contained Delete DeleteFile DeleteFolder DriveExists
  74. syn keyword AspVBSMethods contained Exists FileExists FolderExists
  75. syn keyword AspVBSMethods contained GetAbsolutePathName GetBaseName GetDrive
  76. syn keyword AspVBSMethods contained GetDriveName GetExtensionName GetFile
  77. syn keyword AspVBSMethods contained GetFileName GetFolder GetParentFolderName
  78. syn keyword AspVBSMethods contained GetSpecialFolder GetTempName Items Keys Move
  79. syn keyword AspVBSMethods contained MoveFile MoveFolder OpenAsTextStream
  80. syn keyword AspVBSMethods contained OpenTextFile Raise Read ReadAll ReadLine Remove
  81. syn keyword AspVBSMethods contained RemoveAll Skip SkipLine Write WriteBlankLines
  82. syn keyword AspVBSMethods contained WriteLine
  83.  
  84. " AspVBScript Number Contstants
  85. " Integer number, or floating point number without a dot.
  86. syn match  AspVBSNumber    contained     "\<\d\+\>"
  87. " Floating point number, with dot
  88. syn match  AspVBSNumber    contained     "\<\d\+\.\d*\>"
  89. " Floating point number, starting with a dot
  90. syn match  AspVBSNumber    contained     "\.\d\+\>"
  91.  
  92. " String and Character Contstants
  93. " removed (skip=+\\\\\|\\"+) because VB doesn't have backslash escaping in
  94. " strings (or does it?)
  95. syn region  AspVBSString    contained       start=+"+  end=+"+ keepend
  96.  
  97. " AspVBScript Comments
  98. syn region  AspVBSComment    contained start="^REM\s\|\sREM\s" end="$" contains=AspVBSTodo keepend
  99. syn region  AspVBSComment   contained start="^'\|\s'"   end="$" contains=AspVBSTodo keepend
  100. " misc. Commenting Stuff
  101. syn keyword AspVBSTodo contained    TODO FIXME
  102.  
  103. " Cosmetic syntax errors commanly found in VB but not in AspVBScript
  104. " AspVBScript doesn't use line numbers
  105. syn region  AspVBSError    contained start="^\d" end="\s" keepend
  106. " AspVBScript also doesn't have type defining variables
  107. syn match   AspVBSError  contained "[a-zA-Z0-9_][\$&!#]"ms=s+1
  108. " Since 'a%' is a VB variable with a type and in AspVBScript you can have 'a%>'
  109. " I have to make a special case so 'a%>' won't show as an error.
  110. syn match   AspVBSError  contained "[a-zA-Z0-9_]%\($\|[^>]\)"ms=s+1
  111.  
  112. " Top Cluster
  113. syn cluster AspVBScriptTop contains=AspVBSStatement,AspVBSFunction,AspVBSMethods,AspVBSNumber,AspVBSString,AspVBSComment,AspVBSError
  114.  
  115. " Define AspVBScript delimeters
  116. syn region  AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%+ skip=+".*%>.*"+ end=+%>+ contains=@AspVBScriptTop
  117. syn region  AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<script\s\+language="\=vbscript"\=[^>]*\s\+runatserver[^>]*>+ end=+</script>+ contains=@AspVBScriptTop
  118.  
  119. " Synchronization
  120. syn sync match AspVBSSyncGroup grouphere AspVBScriptInsideHtmlTags "<%"
  121. " This is a kludge so the HTML will sync properly
  122. syn sync match htmlHighlight groupthere htmlTag "%>"
  123.  
  124. if !exists("did_asp_syntax_inits")
  125.   let did_asp_syntax_inits = 1
  126.   " The default methods for highlighting.  Can be overridden later
  127.   "hi link AspVBScript        Special
  128.   hi link AspVBSLineNumber    Comment
  129.   hi link AspVBSNumber        Number
  130.   hi link AspVBSError        Error
  131.   hi link AspVBSStatement    Statement
  132.   hi link AspVBSString        String
  133.   hi link AspVBSComment        Comment
  134.   hi link AspVBSTodo        Todo
  135.   hi link AspVBSFunction    Identifier
  136.   hi link AspVBSMethods        PreProc
  137.   hi link AspVBSEvents        Special
  138.   hi link AspVBSTypeSpecifier    Type
  139. endif
  140.  
  141. let b:current_syntax = "aspvbs"
  142.  
  143. if main_syntax == 'aspvbs'
  144.   unlet main_syntax
  145. endif
  146.  
  147. " vim: ts=8:sw=2:sts=0:noet
  148.