Sin descripción
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mode-vbscript.js 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. ace.define("ace/mode/vbscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var VBScriptHighlightRules = function() {
  6. this.$rules = {
  7. "start": [
  8. {
  9. token: [
  10. "meta.ending-space"
  11. ],
  12. regex: "$"
  13. },
  14. {
  15. token: [
  16. null
  17. ],
  18. regex: "^(?=\\t)",
  19. next: "state_3"
  20. },
  21. {
  22. token: [null],
  23. regex: "^(?= )",
  24. next: "state_4"
  25. },
  26. {
  27. token: [
  28. "text",
  29. "storage.type.function.asp",
  30. "text",
  31. "entity.name.function.asp",
  32. "text",
  33. "punctuation.definition.parameters.asp",
  34. "variable.parameter.function.asp",
  35. "punctuation.definition.parameters.asp"
  36. ],
  37. regex: "^(\\s*)(Function|Sub)(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\))"
  38. },
  39. {
  40. token: "punctuation.definition.comment.asp",
  41. regex: "'|REM",
  42. next: "comment"
  43. },
  44. {
  45. token: [
  46. "keyword.control.asp"
  47. ],
  48. regex: "\\b(?:If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b"
  49. },
  50. {
  51. token: "keyword.operator.asp",
  52. regex: "\\b(?:Mod|And|Not|Or|Xor|as)\\b"
  53. },
  54. {
  55. token: "storage.type.asp",
  56. regex: "Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo"
  57. },
  58. {
  59. token: "storage.modifier.asp",
  60. regex: "\\b(?:Private|Public|Default)\\b"
  61. },
  62. {
  63. token: "constant.language.asp",
  64. regex: "\\b(?:Empty|False|Nothing|Null|True)\\b"
  65. },
  66. {
  67. token: "punctuation.definition.string.begin.asp",
  68. regex: '"',
  69. next: "string"
  70. },
  71. {
  72. token: [
  73. "punctuation.definition.variable.asp"
  74. ],
  75. regex: "(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"
  76. },
  77. {
  78. token: "support.class.asp",
  79. regex: "\\b(?:Application|ObjectContext|Request|Response|Server|Session)\\b"
  80. },
  81. {
  82. token: "support.class.collection.asp",
  83. regex: "\\b(?:Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b"
  84. },
  85. {
  86. token: "support.constant.asp",
  87. regex: "\\b(?:TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b"
  88. },
  89. {
  90. token: "support.function.asp",
  91. regex: "\\b(?:Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b"
  92. },
  93. {
  94. token: "support.function.event.asp",
  95. regex: "\\b(?:Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b"
  96. },
  97. {
  98. token: "support.function.vb.asp",
  99. regex: "\\b(?:Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b"
  100. },
  101. {
  102. token: [
  103. "constant.numeric.asp"
  104. ],
  105. regex: "-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b"
  106. },
  107. {
  108. token: "support.type.vb.asp",
  109. regex: "\\b(?:vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b"
  110. },
  111. {
  112. token: [
  113. "entity.name.function.asp"
  114. ],
  115. regex: "(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))"
  116. },
  117. {
  118. token: [
  119. "keyword.operator.asp"
  120. ],
  121. regex: "\\-|\\+|\\*\\\/|\\>|\\<|\\=|\\&"
  122. }
  123. ],
  124. "state_3": [
  125. {
  126. token: [
  127. "meta.odd-tab.tabs",
  128. "meta.even-tab.tabs"
  129. ],
  130. regex: "(\\t)(\\t)?"
  131. },
  132. {
  133. token: "meta.leading-space",
  134. regex: "(?=[^\\t])",
  135. next: "start"
  136. },
  137. {
  138. token: "meta.leading-space",
  139. regex: ".",
  140. next: "state_3"
  141. }
  142. ],
  143. "state_4": [
  144. {
  145. token: ["meta.odd-tab.spaces", "meta.even-tab.spaces"],
  146. regex: "( )( )?"
  147. },
  148. {
  149. token: "meta.leading-space",
  150. regex: "(?=[^ ])",
  151. next: "start"
  152. },
  153. {
  154. defaultToken: "meta.leading-space"
  155. }
  156. ],
  157. "comment": [
  158. {
  159. token: "comment.line.apostrophe.asp",
  160. regex: "$|(?=(?:%>))",
  161. next: "start"
  162. },
  163. {
  164. defaultToken: "comment.line.apostrophe.asp"
  165. }
  166. ],
  167. "string": [
  168. {
  169. token: "constant.character.escape.apostrophe.asp",
  170. regex: '""'
  171. },
  172. {
  173. token: "string.quoted.double.asp",
  174. regex: '"',
  175. next: "start"
  176. },
  177. {
  178. defaultToken: "string.quoted.double.asp"
  179. }
  180. ]
  181. }
  182. };
  183. oop.inherits(VBScriptHighlightRules, TextHighlightRules);
  184. exports.VBScriptHighlightRules = VBScriptHighlightRules;
  185. });
  186. ace.define("ace/mode/vbscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vbscript_highlight_rules"], function(require, exports, module) {
  187. "use strict";
  188. var oop = require("../lib/oop");
  189. var TextMode = require("./text").Mode;
  190. var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules;
  191. var Mode = function() {
  192. this.HighlightRules = VBScriptHighlightRules;
  193. };
  194. oop.inherits(Mode, TextMode);
  195. (function() {
  196. this.lineCommentStart = ["'", "REM"];
  197. this.$id = "ace/mode/vbscript";
  198. }).call(Mode.prototype);
  199. exports.Mode = Mode;
  200. });