corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 define("ace/mode/live_script_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2 "use strict";
3  
4 var oop = require("../lib/oop");
5 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6  
7 var LiveScriptHighlightRules = function() {
8  
9 this.$rules = { start:
10 [ { token: 'punctuation.definition.comment.livescript',
11 regex: '\\/\\*',
12 push:
13 [ { token: 'punctuation.definition.comment.livescript',
14 regex: '\\*\\/',
15 next: 'pop' },
16 { token: 'storage.type.annotation.livescriptscript',
17 regex: '@\\w*' },
18 { defaultToken: 'comment.block.livescript' } ] },
19 { token:
20 [ 'punctuation.definition.comment.livescript',
21 'comment.line.number-sign.livescript' ],
22 regex: '(#)(?!\\{)(.*$)' },
23 { token:
24 [ 'variable.parameter.function.livescript',
25 'meta.inline.function.livescript',
26 'storage.type.function.livescript',
27 'meta.inline.function.livescript',
28 'variable.parameter.function.livescript',
29 'meta.inline.function.livescript',
30 'storage.type.function.livescript' ],
31 regex: '(\\s*\\!?\\(\\s*[^()]*?\\))(\\s*)(!?[~-]{1,2}>)|(\\s*\\!?)(\\(?[^()]*?\\)?)(\\s*)(<[~-]{1,2}!?)',
32 comment: 'match stuff like: a -> … ' },
33 { token:
34 [ 'keyword.operator.new.livescript',
35 'meta.class.instance.constructor',
36 'entity.name.type.instance.livescript' ],
37 regex: '(new)(\\s+)(\\w+(?:\\.\\w*)*)' },
38 { token: 'keyword.illegal.livescript',
39 regex: '\\bp(?:ackage|r(?:ivate|otected)|ublic)|interface|enum|static|yield\\b' },
40 { token: 'punctuation.definition.string.begin.livescript',
41 regex: '\'\'\'',
42 push:
43 [ { token: 'punctuation.definition.string.end.livescript',
44 regex: '\'\'\'',
45 next: 'pop' },
46 { defaultToken: 'string.quoted.heredoc.livescript' } ] },
47 { token: 'punctuation.definition.string.begin.livescript',
48 regex: '"""',
49 push:
50 [ { token: 'punctuation.definition.string.end.livescript',
51 regex: '"""',
52 next: 'pop' },
53 { token: 'constant.character.escape.livescript',
54 regex: '\\\\.' },
55 { include: '#interpolated_livescript' },
56 { defaultToken: 'string.quoted.double.heredoc.livescript' } ] },
57 { token: 'punctuation.definition.string.begin.livescript',
58 regex: '``',
59 push:
60 [ { token: 'punctuation.definition.string.end.livescript',
61 regex: '``',
62 next: 'pop' },
63 { token: 'constant.character.escape.livescript',
64 regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
65 { defaultToken: 'string.quoted.script.livescript' } ] },
66 { token: 'string.array-literal.livescript',
67 regex: '<\\[',
68 push:
69 [ { token: 'string.array-literal.livescript',
70 regex: '\\]>',
71 next: 'pop' },
72 { defaultToken: 'string.array-literal.livescript' } ] },
73 { token: 'string.regexp.livescript',
74 regex: '/{2}(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}' },
75 { token: 'string.regexp.livescript',
76 regex: '/{2}$',
77 push:
78 [ { token: 'string.regexp.livescript',
79 regex: '/{2}[imgy]{0,4}',
80 next: 'pop' },
81 { include: '#embedded_spaced_comment' },
82 { include: '#interpolated_livescript' },
83 { defaultToken: 'string.regexp.livescript' } ] },
84 { token: 'string.regexp.livescript',
85 regex: '/{2}',
86 push:
87 [ { token: 'string.regexp.livescript',
88 regex: '/{2}[imgy]{0,4}',
89 next: 'pop' },
90 { token: 'constant.character.escape.livescript',
91 regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
92 { include: '#interpolated_livescript' },
93 { defaultToken: 'string.regexp.livescript' } ] },
94 { token: 'string.regexp.livescript',
95 regex: '/(?![\\s=/*+{}?]).*?[^\\\\]/[igmy]{0,4}(?![a-zA-Z0-9])' },
96 { token: 'keyword.control.livescript',
97 regex: '\\b(?<![\\.\\$\\-])(?:t(?:h(?:is|row|en)|ry|ypeof!?|il|o)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction|rom|allthrough)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith|hen)|o(?:f|r|therwise)|return|break|let|var|loop|match|by)(?!\\-|\\s*:)\\b',
98 TODO: 'FIXME: regexp doesn\'t have js equivalent',
99 originalRegex: '(?x)\n\t\t\t\t\\b(?<![\\.\\$\\-])(?:\n\t\t t(?:h(?:is|row|en)|ry|ypeof!?|il|o)\n\t\t |c(?:on(?:tinue|st)|a(?:se|tch)|lass)\n\t\t |i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])\n\t\t |d(?:e(?:fault|lete|bugger)|o)\n\t\t |f(?:or(?:\\s+own)?|inally|unction|rom|allthrough)\n\t\t |s(?:uper|witch)\n\t\t |e(?:lse|x(?:tends|port)|val)\n\t\t |a(?:nd|rguments)\n\t\t |n(?:ew|ot)\n\t\t |un(?:less|til)\n\t\t |w(?:hile|ith|hen)\n\t\t |o(?:f|r|therwise)\n\t\t |return|break|let|var|loop\n\t\t |match\n\t\t |by\n\t\t\t\t)(?!\\-|\\s*:)\\b\n\t\t\t' },
100 { token: 'keyword.operator.livescript',
101 regex: '\\b(?<![\\.\\$\\-])(?:instanceof|new|delete|typeof|and|or|is|isnt|not)(?!\\-|\\s*:)\\b',
102 TODO: 'FIXME: regexp doesn\'t have js equivalent',
103 originalRegex: '(?x)\n\t\t\t\t\\b(?<![\\.\\$\\-])(\n\t\t\t\t\tinstanceof|new|delete|typeof|and|or|is|isnt|not\n\t\t\t\t)(?!\\-|\\s*:)\\b\n\t\t\t' },
104 { token: 'keyword.operator.livescript',
105 regex: 'and=|or=|%|&|\\^|\\*|\\/|(?<![a-zA-Z$_])(?:\\-)?\\-(?!\\-?>)|\\+\\+|\\+|~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<(?!\\[)|(?<!\\])>|(?<!\\w)!(?!(?:[~\\-]+)?>)|&&|\\.\\.(?:\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?<!\\()/=|%=|\\+=|\\-=|\\.=|&=|\\(\\.|\\.\\)|\\^=',
106 TODO: 'FIXME: regexp doesn\'t have js equivalent',
107 originalRegex: '(?x)\n\t\t\t\tand=|or=|%|&|\\^|\\*|\\/|(?<![a-zA-Z$_])(\\-)?\\-(?!\\-?>)|\\+\\+|\\+|\n\t\t\t\t~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|\n\t\t\t\t>>>=|<>|<(?!\\[)|(?<!\\])>|(?<!\\w)!(?!([~\\-]+)?>)|&&|\\.\\.(\\.)?|\\s\\.\\s|\\?|\\||\\|\\||\\:|\\*=|(?<!\\()/=|%=|\\+=|\\-=|\\.=|&=|\\(\\.|\\.\\)|\n\t\t\t\t\\^=\n\t\t\t' },
108 { token:
109 [ 'variable.assignment.livescript',
110 'variable.assignment.livescript',
111 'variable.assignment.livescript',
112 'punctuation.separator.key-value',
113 'keyword.operator.livescript',
114 'variable.assignment.livescript' ],
115 regex: '([a-zA-Z\\$_])((?:[\\w$.-])*)(\\s*)(?!\\::)(?:(:)|(=))(\\s*)(?!(?:\\s*!?\\s*\\(.*\\))?\\s*!?[~-]{1,2}>)' },
116 { token: 'keyword.operator.livescript',
117 regex: '(?<=\\s|^)[\\[\\{](?=.*?[\\]\\}]\\s+[:=])',
118 TODO: 'FIXME: regexp doesn\'t have js equivalent',
119 originalRegex: '(?<=\\s|^)([\\[\\{])(?=.*?[\\]\\}]\\s+[:=])',
120 push:
121 [ { token: 'keyword.operator.livescript',
122 regex: '[\\]\\}]\\s*[:=]',
123 next: 'pop' },
124 { include: '#variable_name' },
125 { include: '#instance_variable' },
126 { include: '#single_quoted_string' },
127 { include: '#double_quoted_string' },
128 { include: '#numeric' },
129 { defaultToken: 'meta.variable.assignment.destructured.livescript' } ] },
130 { token:
131 [ 'meta.function.livescript',
132 'entity.name.function.livescript',
133 'entity.name.function.livescript',
134 'entity.name.function.livescript',
135 'entity.name.function.livescript',
136 'variable.parameter.function.livescript',
137 'entity.name.function.livescript',
138 'storage.type.function.livescript' ],
139 regex: '(\\s*)(?=[a-zA-Z\\$_])([a-zA-Z\\$_])((?:[\\w$.:-])*)(\\s*)([:=])((?:\\s*!?\\s*\\(.*\\))?)(\\s*)(!?[~-]{1,2}>)' },
140 { token: 'storage.type.function.livescript',
141 regex: '!?[~-]{1,2}>' },
142 { token: 'constant.language.boolean.true.livescript',
143 regex: '\\b(?<!\\.)(?:true|on|yes)(?!\\s*[:=])\\b',
144 TODO: 'FIXME: regexp doesn\'t have js equivalent',
145 originalRegex: '\\b(?<!\\.)(true|on|yes)(?!\\s*[:=])\\b' },
146 { token: 'constant.language.boolean.false.livescript',
147 regex: '\\b(?<!\\.)(?:false|off|no)(?!\\s*[:=])\\b',
148 TODO: 'FIXME: regexp doesn\'t have js equivalent',
149 originalRegex: '\\b(?<!\\.)(false|off|no)(?!\\s*[:=])\\b' },
150 { token: 'constant.language.null.livescript',
151 regex: '\\b(?<!\\.)(?:null|void)(?!\\s*[:=])\\b',
152 TODO: 'FIXME: regexp doesn\'t have js equivalent',
153 originalRegex: '\\b(?<!\\.)(null|void)(?!\\s*[:=])\\b' },
154 { token: 'variable.language.livescript',
155 regex: '\\b(?<!\\.)(?:super|this|extends)(?!\\s*[:=])\\b',
156 TODO: 'FIXME: regexp doesn\'t have js equivalent',
157 originalRegex: '\\b(?<!\\.)(super|this|extends)(?!\\s*[:=])\\b' },
158 { token:
159 [ 'storage.type.class.livescript',
160 'meta.class.livescript',
161 'entity.name.type.class.livescript',
162 'meta.class.livescript',
163 'keyword.control.inheritance.livescript',
164 'meta.class.livescript',
165 'entity.other.inherited-class.livescript' ],
166 regex: '(class\\b)(\\s+)((?:@?[a-zA-Z$_][\\w$.-]*)?)(?:(\\s+)(extends)(\\s+)(@?[a-zA-Z$_][\\w$.-]*))?' },
167 { token: 'keyword.other.livescript',
168 regex: '\\b(?:debugger|\\\\)\\b' },
169 { token: 'support.class.livescript',
170 regex: '\\b(?:Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|Int(?:8|16|32|64)Array|Math|Map|Number|Object|Proxy|RegExp|Set|String|WeakMap|window|Uint(?:8|16|32|64)Array|XMLHttpRequest)\\b' },
171 { token: 'entity.name.type.object.livescript',
172 regex: '\\bconsole\\b' },
173 { token: 'support.function.console.livescript',
174 regex: '(?<=console\\.)(?:debug|warn|info|log|error|time(?:End|-end)|assert)\\b',
175 TODO: 'FIXME: regexp doesn\'t have js equivalent',
176 originalRegex: '((?<=console\\.)(debug|warn|info|log|error|time(End|-end)|assert))\\b' },
177 { token: 'support.function.livescript',
178 regex: '\\b(?:decodeURI(?:Component)?|encodeURI(?:Component)?|eval|parse(?:Float|Int)|require)\\b' },
179 { token: 'support.function.prelude.livescript',
180 regex: '(?<![.-])\\b(?:map|filter|reject|partition|find|each|head|tail|last|initial|empty|values|keys|length|cons|append|join|reverse|fold(?:l|r)?1?|unfoldr|and(?:List|-list)|or(?:List|-list)|any|all|unique|sum|product|mean|compact|concat(?:Map|-map)?|maximum|minimum|scan(?:l|r)?1?|replicate|slice|apply|split(?:At|-at)?|take(?:While|-while)?|drop(?:While|-while)?|span|first|break(?:It|-it)|list(?:ToObj|-to-obj)|obj(?:ToFunc|-to-func)|pairs(?:ToObj|-to-obj)|obj(?:ToPairs|-to-pairs|ToLists|-to-lists)|zip(?:All|-all)?(?:With|-with)?|compose|curry|partial|flip|fix|sort(?:With|-with|By|-by)?|group(?:By|-by)|break(?:List|-list|Str|-str)|difference|intersection|union|average|flatten|chars|unchars|repeat|lines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|recip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|round|ceiling|floor|is(?:It|-it)NaN|even|odd|gcd|lcm|disabled__id)\\b(?![.-])',
181 TODO: 'FIXME: regexp doesn\'t have js equivalent',
182 originalRegex: '(?x)(?<![.-])\\b(\n\t\t\t\tmap|filter|reject|partition|find|each|head|tail|last|initial|empty|\n\t\t\t\tvalues|keys|length|cons|append|join|reverse|fold(l|r)?1?|unfoldr|\n\t\t\t\tand(List|-list)|or(List|-list)|any|all|unique|sum|product|mean|compact|\n\t\t\t\tconcat(Map|-map)?|maximum|minimum|scan(l|r)?1?|replicate|slice|apply|\n\t\t\t\tsplit(At|-at)?|take(While|-while)?|drop(While|-while)?|span|first|\n\t\t\t\tbreak(It|-it)|list(ToObj|-to-obj)|obj(ToFunc|-to-func)|\n\t\t\t\tpairs(ToObj|-to-obj)|obj(ToPairs|-to-pairs|ToLists|-to-lists)|\n\t\t\t\tzip(All|-all)?(With|-with)?|compose|curry|partial|flip|fix|\n\t\t\t\tsort(With|-with|By|-by)?|group(By|-by)|break(List|-list|Str|-str)|\n\t\t\t\tdifference|intersection|union|average|flatten|chars|unchars|repeat|\n\t\t\t\tlines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|\n\t\t\t\trecip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|\n\t\t\t\tround|ceiling|floor|is(It|-it)NaN|even|odd|gcd|lcm|disabled__id\n\t\t\t)\\b(?![.-])',
183 comment: 'Generated by DOM query from http://gkz.github.com/prelude-ls/:\n\t [].slice\n\t .call(document.querySelectorAll(".nav-pills li a"))\n\t .map(function(_) {return _.innerText})\n\t .filter(function(_) {return _.trim() !== \'})\n\t .slice(2)\n\t .join("|")\n \t\t' },
184 { token: 'support.function.semireserved.livescript',
185 regex: '(?<![.-])\\b(?:that|it|e)\\b',
186 TODO: 'FIXME: regexp doesn\'t have js equivalent',
187 originalRegex: '(?x)(?<![.-])\\b(that|it|e)\\b' },
188 { token: 'support.function.method.array.livescript',
189 regex: '(?<=(?:\\.|\\]|\\)))(?:apply|call|concat|every|filter|for(?:Each|-each)|from|has(?:Own|-own)(?:Property|-property)|index(?:Of|-of)|is(?:Prototype|-prototype)(?:Of|-of)|join|last(?:Index|-index)(?:Of|-of)|map|of|pop|property(?:Is|-is)(?:Enumerable|-enumerable)|push|reduce(?:Right|-right)?|reverse|shift|slice|some|sort|splice|to(?:Locale|-locale)?(?:String|-string)|unshift|valueOf)\\b(?!-)',
190 TODO: 'FIXME: regexp doesn\'t have js equivalent',
191 originalRegex: '(?x)((?<=(\\.|\\]|\\)))(\n\t\t\t\tapply|call|concat|every|filter|for(Each|-each)|\n\t\t\t\tfrom|has(Own|-own)(Property|-property)|index(Of|-of)|\n\t\t\t\tis(Prototype|-prototype)(Of|-of)|join|last(Index|-index)(Of|-of)|\n\t\t\t\tmap|of|pop|property(Is|-is)(Enumerable|-enumerable)|push|\n\t\t\t\treduce(Right|-right)?|reverse|shift|slice|some|sort|\n\t\t\t\tsplice|to(Locale|-locale)?(String|-string)|unshift|valueOf\n\t\t\t))\\b(?!-) ' },
192 { token: 'support.function.static.array.livescript',
193 regex: '(?<=Array\\.)isArray\\b',
194 TODO: 'FIXME: regexp doesn\'t have js equivalent',
195 originalRegex: '(?x)((?<=Array\\.)(\n\t\t\t\tisArray\n\t\t\t))\\b' },
196 { token: 'support.function.static.object.livescript',
197 regex: '(?<=Object\\.)(?:create|define(?:Propert|-propert)(?:ies|y)|freeze|get(?:Own|-own)(?:Property|-property)(?:Descriptors?|Names)|get(?:Property|-property)(?:Descriptor|Names)|getPrototypeOf|is(?:(?:Extensible|-extensible)|(?:Frozen|-frozen)|(?:Sealed|-sealed))?|keys|prevent(?:Extensions|-extensions)|seal)\\b',
198 TODO: 'FIXME: regexp doesn\'t have js equivalent',
199 originalRegex: '(?x)((?<=Object\\.)(\n\t\t\t\tcreate|define(Propert|-propert)(ies|y)|freeze|\n\t\t\t\tget(Own|-own)(Property|-property)(Descriptors?|Names)|\n\t\t\t\tget(Property|-property)(Descriptor|Names)|getPrototypeOf|\n\t\t\t\tis((Extensible|-extensible)|(Frozen|-frozen)|(Sealed|-sealed))?|\n\t\t\t\tkeys|prevent(Extensions|-extensions)|seal\n\t\t\t))\\b' },
200 { token: 'support.function.static.math.livescript',
201 regex: '(?<=Math\\.)(?:abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|tan|tanh|trunc)\\b',
202 TODO: 'FIXME: regexp doesn\'t have js equivalent',
203 originalRegex: '(?x)((?<=Math\\.)(\n\t\t\t\tabs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|\n\t\t\t\thypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|\n\t\t\t\ttan|tanh|trunc\n\t\t\t))\\b' },
204 { token: 'support.function.static.number.livescript',
205 regex: '(?<=Number\\.)(?:is(?:Finite|Integer|NaN)|to(?:Integer|-integer))\\b',
206 TODO: 'FIXME: regexp doesn\'t have js equivalent',
207 originalRegex: '(?x)((?<=Number\\.)(\n\t\t\t\tis(Finite|Integer|NaN)|to(Integer|-integer)\n\t\t\t))\\b' },
208 { token: 'constant.language.livescript',
209 regex: '\\b(?:Infinity|NaN|undefined)\\b' },
210 { token: 'punctuation.terminator.statement.livescript',
211 regex: '\\;' },
212 { token: 'meta.delimiter.object.comma.livescript',
213 regex: ',[ |\\t]*' },
214 { token: 'meta.delimiter.method.period.livescript',
215 regex: '\\.' },
216 { token: 'meta.brace.curly.livescript', regex: '\\{|\\}' },
217 { token: 'meta.brace.round.livescript', regex: '\\(|\\)' },
218 { token: 'meta.brace.square.livescript', regex: '\\[|\\]\\s*' },
219 { include: '#instance_variable' },
220 { include: '#backslash_string' },
221 { include: '#single_quoted_string' },
222 { include: '#double_quoted_string' },
223 { include: '#numeric' } ],
224 '#backslash_string':
225 [ { token: 'string.quoted.single.livescript',
226 regex: '\\\\(?:[\\\\)\\s,\\};\\]])?',
227 push:
228 [ { token: 'punctuation.definition.string.end.livescript',
229 regex: '[\\\\)\\s,\\};\\]]',
230 next: 'pop' },
231 { defaultToken: 'string.quoted.single.livescript' } ] } ],
232 '#double_quoted_string':
233 [ { token: 'punctuation.definition.string.begin.livescript',
234 regex: '"',
235 push:
236 [ { token: 'punctuation.definition.string.end.livescript',
237 regex: '"',
238 next: 'pop' },
239 { token: 'constant.character.escape.livescript',
240 regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' },
241 { include: '#interpolated_livescript' },
242 { defaultToken: 'string.quoted.double.livescript' } ] } ],
243 '#embedded_comment':
244 [ { token:
245 [ 'punctuation.definition.comment.livescript',
246 'comment.line.number-sign.livescript' ],
247 regex: '(?<!\\\\)(#)(.*$)',
248 TODO: 'FIXME: regexp doesn\'t have js equivalent',
249 originalRegex: '(?<!\\\\)(#).*$\\n' } ],
250 '#embedded_spaced_comment':
251 [ { token:
252 [ 'punctuation.definition.comment.livescript',
253 'comment.line.number-sign.livescript' ],
254 regex: '(?<!\\\\)(#\\s)(.*$)',
255 TODO: 'FIXME: regexp doesn\'t have js equivalent',
256 originalRegex: '(?<!\\\\)(#\\s).*$\\n' } ],
257 '#constructor_variable':
258 [ { token: 'variable.other.readwrite.constructor.livescript',
259 regex: '[a-zA-Z$_][\\w$-]*@{2}(?:[a-zA-Z$_][\\w$-]*)?' } ],
260 '#instance_variable':
261 [ { token: 'variable.other.readwrite.instance.livescript',
262 regex: '(?<!\\S)@(?:[a-zA-Z$_][\\w$-]*)?',
263 TODO: 'FIXME: regexp doesn\'t have js equivalent',
264 originalRegex: '(?<!\\S)(@)([a-zA-Z$_][\\w$-]*)?' } ],
265 '#interpolated_livescript':
266 [ { todo:
267 { token: 'punctuation.section.embedded.livescript',
268 regex: '\\#\\{',
269 push:
270 [ { token: 'punctuation.section.embedded.livescript',
271 regex: '\\}',
272 next: 'pop' },
273 { include: '$self' },
274 { defaultToken: 'source.livescript.embedded.source' } ] } },
275 { todo:
276 { token: 'source.livescript.embedded.source.simple',
277 regex: '\\#',
278 push:
279 [ { token: 'source.livescript.embedded.source.simple',
280 regex: '',
281 next: 'pop' },
282 { include: '$self' },
283 { defaultToken: 'source.livescript.embedded.source.simple' } ] } } ],
284 '#numeric':
285 [ { token: 'constant.numeric.livescript',
286 regex: '(?<![\\$@a-zA-Z_])(?:[0-9]+r[0-9_]+|(?:16r|0[xX])[0-9a-fA-F_]+|[0-9]+(?:\\.[0-9_]+)?(?:e[+\\-]?[0-9_]+)?[_a-zA-Z]*)',
287 TODO: 'FIXME: regexp doesn\'t have js equivalent',
288 originalRegex: '(?<![\\$@a-zA-Z_])(([0-9]+r[0-9_]+)|((16r|0[xX])[0-9a-fA-F_]+)|([0-9]+(\\.[0-9_]+)?(e[+\\-]?[0-9_]+)?)[_a-zA-Z]*)' } ],
289 '#single_quoted_string':
290 [ { token: 'punctuation.definition.string.begin.livescript',
291 regex: '\'',
292 push:
293 [ { token: 'punctuation.definition.string.end.livescript',
294 regex: '\'',
295 next: 'pop' },
296 { token: 'constant.character.escape.livescript',
297 regex: '\\\\(?:x[\\da-fA-F]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)' },
298 { defaultToken: 'string.quoted.single.livescript' } ] } ],
299 '#variable_name':
300 [ { token: 'variable.assignment.livescript',
301 regex: '[a-zA-Z\\$_][\\w$-]*(?:\\.\\w+)*(?!\\-)' } ] }
302  
303 this.normalizeRules();
304 };
305  
306 LiveScriptHighlightRules.metaData = { comment: 'LiveScript Syntax: version 1',
307 fileTypes: [ 'ls', 'Slakefile', 'ls.erb' ],
308 firstLineMatch: '^#!.*\\bls',
309 foldingStartMarker: '^\\s*class\\s+\\S.*$|.*(->|=>)\\s*$|.*[\\[{]\\s*$',
310 foldingStopMarker: '^\\s*$|^\\s*[}\\]]\\s*$',
311 keyEquivalent: '^~C',
312 name: 'LiveScript',
313 scopeName: 'source.livescript' }
314  
315  
316 oop.inherits(LiveScriptHighlightRules, TextHighlightRules);
317  
318 exports.LiveScriptHighlightRules = LiveScriptHighlightRules;
319 });
320  
321 define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
322 "use strict";
323  
324 var oop = require("../../lib/oop");
325 var Range = require("../../range").Range;
326 var BaseFoldMode = require("./fold_mode").FoldMode;
327  
328 var FoldMode = exports.FoldMode = function(commentRegex) {
329 if (commentRegex) {
330 this.foldingStartMarker = new RegExp(
331 this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
332 );
333 this.foldingStopMarker = new RegExp(
334 this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
335 );
336 }
337 };
338 oop.inherits(FoldMode, BaseFoldMode);
339  
340 (function() {
341  
342 this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
343 this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
344 this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
345 this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
346 this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
347 this._getFoldWidgetBase = this.getFoldWidget;
348 this.getFoldWidget = function(session, foldStyle, row) {
349 var line = session.getLine(row);
350  
351 if (this.singleLineBlockCommentRe.test(line)) {
352 if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
353 return "";
354 }
355  
356 var fw = this._getFoldWidgetBase(session, foldStyle, row);
357  
358 if (!fw && this.startRegionRe.test(line))
359 return "start"; // lineCommentRegionStart
360  
361 return fw;
362 };
363  
364 this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
365 var line = session.getLine(row);
366  
367 if (this.startRegionRe.test(line))
368 return this.getCommentRegionBlock(session, line, row);
369  
370 var match = line.match(this.foldingStartMarker);
371 if (match) {
372 var i = match.index;
373  
374 if (match[1])
375 return this.openingBracketBlock(session, match[1], row, i);
376  
377 var range = session.getCommentFoldRange(row, i + match[0].length, 1);
378  
379 if (range && !range.isMultiLine()) {
380 if (forceMultiline) {
381 range = this.getSectionRange(session, row);
382 } else if (foldStyle != "all")
383 range = null;
384 }
385  
386 return range;
387 }
388  
389 if (foldStyle === "markbegin")
390 return;
391  
392 var match = line.match(this.foldingStopMarker);
393 if (match) {
394 var i = match.index + match[0].length;
395  
396 if (match[1])
397 return this.closingBracketBlock(session, match[1], row, i);
398  
399 return session.getCommentFoldRange(row, i, -1);
400 }
401 };
402  
403 this.getSectionRange = function(session, row) {
404 var line = session.getLine(row);
405 var startIndent = line.search(/\S/);
406 var startRow = row;
407 var startColumn = line.length;
408 row = row + 1;
409 var endRow = row;
410 var maxRow = session.getLength();
411 while (++row < maxRow) {
412 line = session.getLine(row);
413 var indent = line.search(/\S/);
414 if (indent === -1)
415 continue;
416 if (startIndent > indent)
417 break;
418 var subRange = this.getFoldWidgetRange(session, "all", row);
419  
420 if (subRange) {
421 if (subRange.start.row <= startRow) {
422 break;
423 } else if (subRange.isMultiLine()) {
424 row = subRange.end.row;
425 } else if (startIndent == indent) {
426 break;
427 }
428 }
429 endRow = row;
430 }
431  
432 return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
433 };
434  
435 this.getCommentRegionBlock = function(session, line, row) {
436 var startColumn = line.search(/\s*$/);
437 var maxRow = session.getLength();
438 var startRow = row;
439  
440 var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
441 var depth = 1;
442 while (++row < maxRow) {
443 line = session.getLine(row);
444 var m = re.exec(line);
445 if (!m) continue;
446 if (m[1]) depth--;
447 else depth++;
448  
449 if (!depth) break;
450 }
451  
452 var endRow = row;
453 if (endRow > startRow) {
454 return new Range(startRow, startColumn, endRow, line.length);
455 }
456 };
457  
458 }).call(FoldMode.prototype);
459  
460 });
461  
462 define("ace/mode/live_script",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/live_script_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
463 "use strict";
464  
465 var oop = require("../lib/oop");
466 var TextMode = require("./text").Mode;
467 var LiveScriptHighlightRules = require("./live_script_highlight_rules").LiveScriptHighlightRules;
468 var FoldMode = require("./folding/cstyle").FoldMode;
469  
470 var Mode = function() {
471 this.HighlightRules = LiveScriptHighlightRules;
472 this.foldingRules = new FoldMode();
473 };
474 oop.inherits(Mode, TextMode);
475  
476 (function() {
477 this.$id = "ace/mode/live_script"
478 }).call(Mode.prototype);
479  
480 exports.Mode = Mode;
481 });