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.

267 lines
24 KiB

12 months ago
  1. ace.define("ace/mode/actionscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2. "use strict";
  3. var oop = acequire("../lib/oop");
  4. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  5. var ActionScriptHighlightRules = function() {
  6. this.$rules = { start:
  7. [ { token: 'support.class.actionscript.2',
  8. regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' },
  9. { token: 'support.function.actionscript.2',
  10. regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|F
  11. { token: 'support.constant.actionscript.2',
  12. regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' },
  13. { token: 'keyword.control.actionscript.2',
  14. regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' },
  15. { token: 'storage.type.actionscript.2',
  16. regex: '\\b(?:Boolean|Number|String|Void)\\b' },
  17. { token: 'constant.language.actionscript.2',
  18. regex: '\\b(?:null|undefined|true|false)\\b' },
  19. { token: 'constant.numeric.actionscript.2',
  20. 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' },
  21. { token: 'punctuation.definition.string.begin.actionscript.2',
  22. regex: '"',
  23. push:
  24. [ { token: 'punctuation.definition.string.end.actionscript.2',
  25. regex: '"',
  26. next: 'pop' },
  27. { token: 'constant.character.escape.actionscript.2',
  28. regex: '\\\\.' },
  29. { defaultToken: 'string.quoted.double.actionscript.2' } ] },
  30. { token: 'punctuation.definition.string.begin.actionscript.2',
  31. regex: '\'',
  32. push:
  33. [ { token: 'punctuation.definition.string.end.actionscript.2',
  34. regex: '\'',
  35. next: 'pop' },
  36. { token: 'constant.character.escape.actionscript.2',
  37. regex: '\\\\.' },
  38. { defaultToken: 'string.quoted.single.actionscript.2' } ] },
  39. { token: 'support.constant.actionscript.2',
  40. regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' },
  41. { token: 'punctuation.definition.comment.actionscript.2',
  42. regex: '/\\*',
  43. push:
  44. [ { token: 'punctuation.definition.comment.actionscript.2',
  45. regex: '\\*/',
  46. next: 'pop' },
  47. { defaultToken: 'comment.block.actionscript.2' } ] },
  48. { token: 'punctuation.definition.comment.actionscript.2',
  49. regex: '//.*$',
  50. push_:
  51. [ { token: 'comment.line.double-slash.actionscript.2',
  52. regex: '$',
  53. next: 'pop' },
  54. { defaultToken: 'comment.line.double-slash.actionscript.2' } ] },
  55. { token: 'keyword.operator.actionscript.2',
  56. regex: '\\binstanceof\\b' },
  57. { token: 'keyword.operator.symbolic.actionscript.2',
  58. regex: '[-!%&*+=/?:]' },
  59. { token:
  60. [ 'meta.preprocessor.actionscript.2',
  61. 'punctuation.definition.preprocessor.actionscript.2',
  62. 'meta.preprocessor.actionscript.2' ],
  63. regex: '^([ \\t]*)(#)([a-zA-Z]+)' },
  64. { token:
  65. [ 'storage.type.function.actionscript.2',
  66. 'meta.function.actionscript.2',
  67. 'entity.name.function.actionscript.2',
  68. 'meta.function.actionscript.2',
  69. 'punctuation.definition.parameters.begin.actionscript.2' ],
  70. regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()',
  71. push:
  72. [ { token: 'punctuation.definition.parameters.end.actionscript.2',
  73. regex: '\\)',
  74. next: 'pop' },
  75. { token: 'variable.parameter.function.actionscript.2',
  76. regex: '[^,)$]+' },
  77. { defaultToken: 'meta.function.actionscript.2' } ] },
  78. { token:
  79. [ 'storage.type.class.actionscript.2',
  80. 'meta.class.actionscript.2',
  81. 'entity.name.type.class.actionscript.2',
  82. 'meta.class.actionscript.2',
  83. 'storage.modifier.extends.actionscript.2',
  84. 'meta.class.actionscript.2',
  85. 'entity.other.inherited-class.actionscript.2' ],
  86. regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] };
  87. this.normalizeRules();
  88. };
  89. ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ],
  90. keyEquivalent: '^~A',
  91. name: 'ActionScript',
  92. scopeName: 'source.actionscript.2' };
  93. oop.inherits(ActionScriptHighlightRules, TextHighlightRules);
  94. exports.ActionScriptHighlightRules = ActionScriptHighlightRules;
  95. });
  96. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(acequire, exports, module) {
  97. "use strict";
  98. var oop = acequire("../../lib/oop");
  99. var Range = acequire("../../range").Range;
  100. var BaseFoldMode = acequire("./fold_mode").FoldMode;
  101. var FoldMode = exports.FoldMode = function(commentRegex) {
  102. if (commentRegex) {
  103. this.foldingStartMarker = new RegExp(
  104. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  105. );
  106. this.foldingStopMarker = new RegExp(
  107. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  108. );
  109. }
  110. };
  111. oop.inherits(FoldMode, BaseFoldMode);
  112. (function() {
  113. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  114. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  115. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  116. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  117. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  118. this._getFoldWidgetBase = this.getFoldWidget;
  119. this.getFoldWidget = function(session, foldStyle, row) {
  120. var line = session.getLine(row);
  121. if (this.singleLineBlockCommentRe.test(line)) {
  122. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  123. return "";
  124. }
  125. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  126. if (!fw && this.startRegionRe.test(line))
  127. return "start"; // lineCommentRegionStart
  128. return fw;
  129. };
  130. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  131. var line = session.getLine(row);
  132. if (this.startRegionRe.test(line))
  133. return this.getCommentRegionBlock(session, line, row);
  134. var match = line.match(this.foldingStartMarker);
  135. if (match) {
  136. var i = match.index;
  137. if (match[1])
  138. return this.openingBracketBlock(session, match[1], row, i);
  139. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  140. if (range && !range.isMultiLine()) {
  141. if (forceMultiline) {
  142. range = this.getSectionRange(session, row);
  143. } else if (foldStyle != "all")
  144. range = null;
  145. }
  146. return range;
  147. }
  148. if (foldStyle === "markbegin")
  149. return;
  150. var match = line.match(this.foldingStopMarker);
  151. if (match) {
  152. var i = match.index + match[0].length;
  153. if (match[1])
  154. return this.closingBracketBlock(session, match[1], row, i);
  155. return session.getCommentFoldRange(row, i, -1);
  156. }
  157. };
  158. this.getSectionRange = function(session, row) {
  159. var line = session.getLine(row);
  160. var startIndent = line.search(/\S/);
  161. var startRow = row;
  162. var startColumn = line.length;
  163. row = row + 1;
  164. var endRow = row;
  165. var maxRow = session.getLength();
  166. while (++row < maxRow) {
  167. line = session.getLine(row);
  168. var indent = line.search(/\S/);
  169. if (indent === -1)
  170. continue;
  171. if (startIndent > indent)
  172. break;
  173. var subRange = this.getFoldWidgetRange(session, "all", row);
  174. if (subRange) {
  175. if (subRange.start.row <= startRow) {
  176. break;
  177. } else if (subRange.isMultiLine()) {
  178. row = subRange.end.row;
  179. } else if (startIndent == indent) {
  180. break;
  181. }
  182. }
  183. endRow = row;
  184. }
  185. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  186. };
  187. this.getCommentRegionBlock = function(session, line, row) {
  188. var startColumn = line.search(/\s*$/);
  189. var maxRow = session.getLength();
  190. var startRow = row;
  191. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  192. var depth = 1;
  193. while (++row < maxRow) {
  194. line = session.getLine(row);
  195. var m = re.exec(line);
  196. if (!m) continue;
  197. if (m[1]) depth--;
  198. else depth++;
  199. if (!depth) break;
  200. }
  201. var endRow = row;
  202. if (endRow > startRow) {
  203. return new Range(startRow, startColumn, endRow, line.length);
  204. }
  205. };
  206. }).call(FoldMode.prototype);
  207. });
  208. ace.define("ace/mode/actionscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/actionscript_highlight_rules","ace/mode/folding/cstyle"], function(acequire, exports, module) {
  209. "use strict";
  210. var oop = acequire("../lib/oop");
  211. var TextMode = acequire("./text").Mode;
  212. var ActionScriptHighlightRules = acequire("./actionscript_highlight_rules").ActionScriptHighlightRules;
  213. var FoldMode = acequire("./folding/cstyle").FoldMode;
  214. var Mode = function() {
  215. this.HighlightRules = ActionScriptHighlightRules;
  216. this.foldingRules = new FoldMode();
  217. this.$behaviour = this.$defaultBehaviour;
  218. };
  219. oop.inherits(Mode, TextMode);
  220. (function() {
  221. this.lineCommentStart = "//";
  222. this.blockComment = {start: "/*", end: "*/"};
  223. this.$id = "ace/mode/actionscript";
  224. }).call(Mode.prototype);
  225. exports.Mode = Mode;
  226. });