ace-rails-ap 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -1
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace/ace.js +6911 -5290
- data/vendor/assets/javascripts/ace/ext-chromevox.js +537 -0
- data/vendor/assets/javascripts/ace/ext-elastic_tabstops_lite.js +301 -0
- data/vendor/assets/javascripts/ace/ext-emmet.js +1109 -0
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +207 -0
- data/vendor/assets/javascripts/ace/ext-language_tools.js +1665 -0
- data/vendor/assets/javascripts/ace/ext-modelist.js +168 -0
- data/vendor/assets/javascripts/ace/ext-old_ie.js +500 -0
- data/vendor/assets/javascripts/ace/ext-options.js +252 -0
- data/vendor/assets/javascripts/ace/ext-searchbox.js +421 -0
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +632 -0
- data/vendor/assets/javascripts/ace/ext-spellcheck.js +68 -0
- data/vendor/assets/javascripts/ace/ext-split.js +271 -0
- data/vendor/assets/javascripts/ace/ext-static_highlight.js +178 -0
- data/vendor/assets/javascripts/ace/ext-statusbar.js +47 -0
- data/vendor/assets/javascripts/ace/ext-textarea.js +478 -0
- data/vendor/assets/javascripts/ace/ext-themelist.js +86 -0
- data/vendor/assets/javascripts/ace/ext-whitespace.js +206 -0
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +822 -131
- data/vendor/assets/javascripts/ace/keybinding-vim.js +382 -258
- data/vendor/assets/javascripts/ace/mode-abap.js +261 -0
- data/vendor/assets/javascripts/ace/mode-actionscript.js +257 -0
- data/vendor/assets/javascripts/ace/mode-ada.js +118 -0
- data/vendor/assets/javascripts/ace/mode-asciidoc.js +373 -0
- data/vendor/assets/javascripts/ace/mode-assembly_x86.js +217 -0
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +225 -0
- data/vendor/assets/javascripts/ace/mode-batchfile.js +213 -0
- data/vendor/assets/javascripts/ace/mode-c9search.js +144 -124
- data/vendor/assets/javascripts/ace/mode-c_cpp.js +296 -254
- data/vendor/assets/javascripts/ace/mode-clojure.js +113 -177
- data/vendor/assets/javascripts/ace/mode-cobol.js +125 -0
- data/vendor/assets/javascripts/ace/mode-coffee.js +152 -235
- data/vendor/assets/javascripts/ace/mode-coldfusion.js +823 -835
- data/vendor/assets/javascripts/ace/mode-csharp.js +325 -187
- data/vendor/assets/javascripts/ace/mode-css.js +583 -297
- data/vendor/assets/javascripts/ace/mode-curly.js +2423 -0
- data/vendor/assets/javascripts/ace/mode-d.js +492 -0
- data/vendor/assets/javascripts/ace/mode-dart.js +993 -0
- data/vendor/assets/javascripts/ace/mode-diff.js +124 -204
- data/vendor/assets/javascripts/ace/mode-django.js +2448 -0
- data/vendor/assets/javascripts/ace/mode-dot.js +361 -0
- data/vendor/assets/javascripts/ace/mode-ejs.js +2817 -0
- data/vendor/assets/javascripts/ace/mode-erlang.js +987 -0
- data/vendor/assets/javascripts/ace/mode-forth.js +280 -0
- data/vendor/assets/javascripts/ace/mode-ftl.js +1061 -0
- data/vendor/assets/javascripts/ace/mode-glsl.js +313 -275
- data/vendor/assets/javascripts/ace/mode-golang.js +268 -275
- data/vendor/assets/javascripts/ace/mode-groovy.js +347 -492
- data/vendor/assets/javascripts/ace/mode-haml.js +498 -0
- data/vendor/assets/javascripts/ace/mode-handlebars.js +2433 -0
- data/vendor/assets/javascripts/ace/mode-haskell.js +362 -0
- data/vendor/assets/javascripts/ace/mode-haxe.js +226 -202
- data/vendor/assets/javascripts/ace/mode-html.js +1099 -802
- data/vendor/assets/javascripts/ace/mode-html_completions.js +309 -0
- data/vendor/assets/javascripts/ace/mode-html_ruby.js +2822 -0
- data/vendor/assets/javascripts/ace/mode-ini.js +185 -0
- data/vendor/assets/javascripts/ace/mode-jack.js +653 -0
- data/vendor/assets/javascripts/ace/mode-jade.js +2081 -0
- data/vendor/assets/javascripts/ace/mode-java.js +339 -488
- data/vendor/assets/javascripts/ace/mode-javascript.js +342 -478
- data/vendor/assets/javascripts/ace/mode-json.js +215 -178
- data/vendor/assets/javascripts/ace/mode-jsoniq.js +2761 -0
- data/vendor/assets/javascripts/ace/mode-jsp.js +1553 -0
- data/vendor/assets/javascripts/ace/mode-jsx.js +325 -289
- data/vendor/assets/javascripts/ace/mode-julia.js +286 -0
- data/vendor/assets/javascripts/ace/mode-latex.js +141 -46
- data/vendor/assets/javascripts/ace/mode-less.js +493 -151
- data/vendor/assets/javascripts/ace/mode-liquid.js +594 -656
- data/vendor/assets/javascripts/ace/mode-lisp.js +137 -0
- data/vendor/assets/javascripts/ace/mode-livescript.js +288 -0
- data/vendor/assets/javascripts/ace/mode-logiql.js +669 -0
- data/vendor/assets/javascripts/ace/mode-lsl.js +890 -0
- data/vendor/assets/javascripts/ace/mode-lua.js +274 -368
- data/vendor/assets/javascripts/ace/mode-luapage.js +1331 -1107
- data/vendor/assets/javascripts/ace/mode-lucene.js +64 -0
- data/vendor/assets/javascripts/ace/mode-makefile.js +332 -0
- data/vendor/assets/javascripts/ace/mode-markdown.js +1303 -948
- data/vendor/assets/javascripts/ace/mode-matlab.js +230 -0
- data/vendor/assets/javascripts/ace/mode-mushcode.js +705 -0
- data/vendor/assets/javascripts/ace/mode-mushcode_high_rules.js +569 -0
- data/vendor/assets/javascripts/ace/mode-mysql.js +185 -0
- data/vendor/assets/javascripts/ace/mode-nix.js +935 -0
- data/vendor/assets/javascripts/ace/mode-objectivec.js +699 -0
- data/vendor/assets/javascripts/ace/mode-ocaml.js +44 -63
- data/vendor/assets/javascripts/ace/mode-pascal.js +233 -0
- data/vendor/assets/javascripts/ace/mode-perl.js +116 -189
- data/vendor/assets/javascripts/ace/mode-pgsql.js +886 -500
- data/vendor/assets/javascripts/ace/mode-php.js +1158 -380
- data/vendor/assets/javascripts/ace/mode-plain_text.js +56 -0
- data/vendor/assets/javascripts/ace/mode-powershell.js +222 -167
- data/vendor/assets/javascripts/ace/mode-prolog.js +354 -0
- data/vendor/assets/javascripts/ace/mode-properties.js +100 -0
- data/vendor/assets/javascripts/ace/mode-protobuf.js +885 -0
- data/vendor/assets/javascripts/ace/mode-python.js +99 -201
- data/vendor/assets/javascripts/ace/mode-r.js +337 -0
- data/vendor/assets/javascripts/ace/mode-rdoc.js +210 -0
- data/vendor/assets/javascripts/ace/mode-rhtml.js +2663 -0
- data/vendor/assets/javascripts/ace/mode-ruby.js +262 -136
- data/vendor/assets/javascripts/ace/mode-rust.js +245 -0
- data/vendor/assets/javascripts/ace/mode-sass.js +443 -0
- data/vendor/assets/javascripts/ace/mode-scad.js +225 -240
- data/vendor/assets/javascripts/ace/mode-scala.js +340 -494
- data/vendor/assets/javascripts/ace/mode-scheme.js +143 -0
- data/vendor/assets/javascripts/ace/mode-scss.js +499 -157
- data/vendor/assets/javascripts/ace/mode-sh.js +180 -110
- data/vendor/assets/javascripts/ace/mode-sjs.js +1154 -0
- data/vendor/assets/javascripts/ace/mode-snippets.js +198 -0
- data/vendor/assets/javascripts/ace/mode-soy_template.js +2707 -0
- data/vendor/assets/javascripts/ace/mode-space.js +160 -0
- data/vendor/assets/javascripts/ace/mode-sql.js +48 -69
- data/vendor/assets/javascripts/ace/mode-stylus.js +447 -0
- data/vendor/assets/javascripts/ace/mode-svg.js +552 -605
- data/vendor/assets/javascripts/ace/mode-tcl.js +139 -98
- data/vendor/assets/javascripts/ace/mode-tex.js +187 -0
- data/vendor/assets/javascripts/ace/mode-textile.js +29 -40
- data/vendor/assets/javascripts/ace/mode-tmsnippet.js +200 -0
- data/vendor/assets/javascripts/ace/mode-toml.js +177 -0
- data/vendor/assets/javascripts/ace/mode-twig.js +2228 -0
- data/vendor/assets/javascripts/ace/mode-typescript.js +1018 -0
- data/vendor/assets/javascripts/ace/mode-vbscript.js +250 -0
- data/vendor/assets/javascripts/ace/mode-velocity.js +1621 -0
- data/vendor/assets/javascripts/ace/mode-verilog.js +127 -0
- data/vendor/assets/javascripts/ace/mode-vhdl.js +139 -0
- data/vendor/assets/javascripts/ace/mode-xml.js +350 -242
- data/vendor/assets/javascripts/ace/mode-xquery.js +2490 -300
- data/vendor/assets/javascripts/ace/mode-yaml.js +146 -45
- data/vendor/assets/javascripts/ace/theme-ambiance.js +202 -0
- data/vendor/assets/javascripts/ace/theme-chaos.js +179 -0
- data/vendor/assets/javascripts/ace/theme-chrome.js +97 -153
- data/vendor/assets/javascripts/ace/theme-clouds.js +78 -119
- data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +79 -120
- data/vendor/assets/javascripts/ace/theme-cobalt.js +89 -140
- data/vendor/assets/javascripts/ace/theme-crimson_editor.js +93 -145
- data/vendor/assets/javascripts/ace/theme-dawn.js +84 -143
- data/vendor/assets/javascripts/ace/theme-dreamweaver.js +99 -162
- data/vendor/assets/javascripts/ace/theme-eclipse.js +78 -111
- data/vendor/assets/javascripts/ace/theme-github.js +70 -121
- data/vendor/assets/javascripts/ace/theme-idle_fingers.js +75 -134
- data/vendor/assets/javascripts/ace/theme-kr.js +135 -0
- data/vendor/assets/javascripts/ace/theme-merbivore.js +80 -143
- data/vendor/assets/javascripts/ace/theme-merbivore_soft.js +81 -149
- data/vendor/assets/javascripts/ace/theme-mono_industrial.js +87 -146
- data/vendor/assets/javascripts/ace/theme-monokai.js +88 -146
- data/vendor/assets/javascripts/ace/theme-pastel_on_dark.js +82 -142
- data/vendor/assets/javascripts/ace/theme-solarized_dark.js +83 -144
- data/vendor/assets/javascripts/ace/theme-solarized_light.js +76 -133
- data/vendor/assets/javascripts/ace/theme-terminal.js +145 -0
- data/vendor/assets/javascripts/ace/theme-textmate.js +101 -158
- data/vendor/assets/javascripts/ace/theme-tomorrow.js +89 -163
- data/vendor/assets/javascripts/ace/theme-tomorrow_night.js +89 -163
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_blue.js +89 -165
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_bright.js +101 -162
- data/vendor/assets/javascripts/ace/theme-tomorrow_night_eighties.js +90 -160
- data/vendor/assets/javascripts/ace/theme-twilight.js +87 -158
- data/vendor/assets/javascripts/ace/theme-vibrant_ink.js +75 -140
- data/vendor/assets/javascripts/ace/theme-xcode.js +120 -0
- data/vendor/assets/javascripts/ace/worker-coffee.js +3049 -2665
- data/vendor/assets/javascripts/ace/worker-css.js +1779 -4376
- data/vendor/assets/javascripts/ace/worker-javascript.js +8701 -9008
- data/vendor/assets/javascripts/ace/worker-json.js +709 -1340
- data/vendor/assets/javascripts/ace/worker-lua.js +3525 -0
- data/vendor/assets/javascripts/ace/worker-php.js +6893 -0
- data/vendor/assets/javascripts/ace/worker-xquery.js +19924 -64507
- metadata +100 -17
@@ -1,37 +1,30 @@
|
|
1
1
|
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
-
*
|
2
|
+
* Distributed under the BSD license:
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
* of those above. If you wish to allow use of your version of this file only
|
29
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
30
|
-
* use your version of this file under the terms of the MPL, indicate your
|
31
|
-
* decision by deleting the provisions above and replace them with the notice
|
32
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
33
|
-
* the provisions above, a recipient may use your version of this file under
|
34
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
4
|
+
* Copyright (c) 2010, Ajax.org B.V.
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* Redistribution and use in source and binary forms, with or without
|
8
|
+
* modification, are permitted provided that the following conditions are met:
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
* * Neither the name of Ajax.org B.V. nor the
|
15
|
+
* names of its contributors may be used to endorse or promote products
|
16
|
+
* derived from this software without specific prior written permission.
|
17
|
+
*
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
19
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
24
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
28
|
*
|
36
29
|
* ***** END LICENSE BLOCK ***** */
|
37
30
|
|
@@ -45,46 +38,19 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
|
|
45
38
|
var Range = require("../range").Range;
|
46
39
|
|
47
40
|
var Mode = function() {
|
48
|
-
this
|
41
|
+
this.HighlightRules = LiquidHighlightRules;
|
49
42
|
this.$outdent = new MatchingBraceOutdent();
|
50
43
|
};
|
51
44
|
oop.inherits(Mode, TextMode);
|
52
45
|
|
53
46
|
(function() {
|
54
47
|
|
55
|
-
this.
|
56
|
-
var outdent = true;
|
57
|
-
var outentedRows = [];
|
58
|
-
var re = /^(\s*)#/;
|
59
|
-
|
60
|
-
for (var i=startRow; i<= endRow; i++) {
|
61
|
-
if (!re.test(doc.getLine(i))) {
|
62
|
-
outdent = false;
|
63
|
-
break;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
if (outdent) {
|
68
|
-
var deleteRange = new Range(0, 0, 0, 0);
|
69
|
-
for (var i=startRow; i<= endRow; i++)
|
70
|
-
{
|
71
|
-
var line = doc.getLine(i);
|
72
|
-
var m = line.match(re);
|
73
|
-
deleteRange.start.row = i;
|
74
|
-
deleteRange.end.row = i;
|
75
|
-
deleteRange.end.column = m[0].length;
|
76
|
-
doc.replace(deleteRange, m[1]);
|
77
|
-
}
|
78
|
-
}
|
79
|
-
else {
|
80
|
-
doc.indentRows(startRow, endRow, "#");
|
81
|
-
}
|
82
|
-
};
|
48
|
+
this.blockComment = {start: "<!--", end: "-->"};
|
83
49
|
|
84
50
|
this.getNextLineIndent = function(state, line, tab) {
|
85
51
|
var indent = this.$getIndent(line);
|
86
52
|
|
87
|
-
var tokenizedLine = this
|
53
|
+
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
|
88
54
|
var tokens = tokenizedLine.tokens;
|
89
55
|
var endState = tokenizedLine.state;
|
90
56
|
|
@@ -110,393 +76,334 @@ oop.inherits(Mode, TextMode);
|
|
110
76
|
this.$outdent.autoOutdent(doc, row);
|
111
77
|
};
|
112
78
|
|
79
|
+
this.$id = "ace/mode/liquid";
|
113
80
|
}).call(Mode.prototype);
|
114
81
|
|
115
82
|
exports.Mode = Mode;
|
116
83
|
});
|
117
84
|
|
118
|
-
define('ace/mode/liquid_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/
|
85
|
+
define('ace/mode/liquid_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules', 'ace/mode/html_highlight_rules'], function(require, exports, module) {
|
119
86
|
|
120
87
|
|
121
88
|
var oop = require("../lib/oop");
|
122
|
-
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
123
|
-
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
124
|
-
var lang = require("../lib/lang");
|
125
|
-
var xmlUtil = require("./xml_util");
|
126
89
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
90
|
+
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
127
91
|
|
128
92
|
var LiquidHighlightRules = function() {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
// Standard Filters
|
133
|
-
("date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" +
|
93
|
+
HtmlHighlightRules.call(this);
|
94
|
+
var functions = (
|
95
|
+
"date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" +
|
134
96
|
"escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" +
|
135
97
|
"truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split"
|
136
|
-
).split("|")
|
137
98
|
);
|
138
99
|
|
139
|
-
var keywords =
|
140
|
-
|
141
|
-
("capture|endcapture|case|endcase|when|comment|endcomment|" +
|
100
|
+
var keywords = (
|
101
|
+
"capture|endcapture|case|endcase|when|comment|endcomment|" +
|
142
102
|
"cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" +
|
143
|
-
|
144
|
-
"style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow").split("|")
|
103
|
+
"style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow"
|
145
104
|
);
|
146
105
|
|
147
|
-
var builtinVariables =
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
},
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
token : "text",
|
211
|
-
merge : true,
|
212
|
-
regex : ".+"
|
213
|
-
} ],
|
214
|
-
|
215
|
-
comment : [ {
|
216
|
-
token : "comment",
|
217
|
-
regex : ".*?-->",
|
218
|
-
next : "start"
|
219
|
-
}, {
|
220
|
-
token : "comment",
|
221
|
-
merge : true,
|
222
|
-
regex : ".+"
|
223
|
-
} ] ,
|
224
|
-
|
225
|
-
liquid_start : [{
|
226
|
-
token: "variable",
|
227
|
-
regex: "}}",
|
228
|
-
next: "start"
|
229
|
-
}, {
|
230
|
-
token: "variable",
|
231
|
-
regex: "%}",
|
232
|
-
next: "start"
|
233
|
-
}, {
|
234
|
-
token : "string", // single line
|
235
|
-
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
236
|
-
}, {
|
237
|
-
token : "string", // single line
|
238
|
-
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
239
|
-
}, {
|
240
|
-
token : "constant.numeric", // hex
|
241
|
-
regex : "0[xX][0-9a-fA-F]+\\b"
|
242
|
-
}, {
|
243
|
-
token : "constant.numeric", // float
|
244
|
-
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
245
|
-
}, {
|
246
|
-
token : "constant.language.boolean",
|
247
|
-
regex : "(?:true|false)\\b"
|
248
|
-
}, {
|
249
|
-
token : function(value) {
|
250
|
-
if (functions.hasOwnProperty(value))
|
251
|
-
return "support.function";
|
252
|
-
else if (keywords.hasOwnProperty(value))
|
253
|
-
return "keyword";
|
254
|
-
else if (builtinVariables.hasOwnProperty(value))
|
255
|
-
return "variable.language";
|
256
|
-
else if (definitions.hasOwnProperty(value))
|
257
|
-
return "keyword.definition";
|
258
|
-
else
|
259
|
-
return "identifier";
|
260
|
-
},
|
261
|
-
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
262
|
-
}, {
|
263
|
-
token : "keyword.operator",
|
264
|
-
regex : "\/|\\*|\\-|\\+|=|!=|\\?\\:"
|
265
|
-
}, {
|
266
|
-
token : "paren.lparen",
|
267
|
-
regex : /[\[\({]/
|
268
|
-
}, {
|
269
|
-
token : "paren.rparen",
|
270
|
-
regex : /[\])}]/
|
271
|
-
}, {
|
272
|
-
token : "text",
|
273
|
-
regex : "\\s+"
|
274
|
-
}]
|
275
|
-
};
|
276
|
-
|
277
|
-
xmlUtil.tag(this.$rules, "tag", "start");
|
278
|
-
xmlUtil.tag(this.$rules, "style", "css-start");
|
279
|
-
xmlUtil.tag(this.$rules, "script", "js-start");
|
106
|
+
var builtinVariables = 'forloop|tablerowloop';
|
107
|
+
|
108
|
+
var definitions = ("assign");
|
109
|
+
|
110
|
+
var keywordMapper = this.createKeywordMapper({
|
111
|
+
"variable.language": builtinVariables,
|
112
|
+
"keyword": keywords,
|
113
|
+
"support.function": functions,
|
114
|
+
"keyword.definition": definitions
|
115
|
+
}, "identifier");
|
116
|
+
for (var rule in this.$rules) {
|
117
|
+
this.$rules[rule].unshift({
|
118
|
+
token : "variable",
|
119
|
+
regex : "{%",
|
120
|
+
push : "liquid-start"
|
121
|
+
}, {
|
122
|
+
token : "variable",
|
123
|
+
regex : "{{",
|
124
|
+
push : "liquid-start"
|
125
|
+
});
|
126
|
+
}
|
127
|
+
|
128
|
+
this.addRules({
|
129
|
+
"liquid-start" : [{
|
130
|
+
token: "variable",
|
131
|
+
regex: "}}",
|
132
|
+
next: "pop"
|
133
|
+
}, {
|
134
|
+
token: "variable",
|
135
|
+
regex: "%}",
|
136
|
+
next: "pop"
|
137
|
+
}, {
|
138
|
+
token : "string", // single line
|
139
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
140
|
+
}, {
|
141
|
+
token : "string", // single line
|
142
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
143
|
+
}, {
|
144
|
+
token : "constant.numeric", // hex
|
145
|
+
regex : "0[xX][0-9a-fA-F]+\\b"
|
146
|
+
}, {
|
147
|
+
token : "constant.numeric", // float
|
148
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
149
|
+
}, {
|
150
|
+
token : "constant.language.boolean",
|
151
|
+
regex : "(?:true|false)\\b"
|
152
|
+
}, {
|
153
|
+
token : keywordMapper,
|
154
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
155
|
+
}, {
|
156
|
+
token : "keyword.operator",
|
157
|
+
regex : "\/|\\*|\\-|\\+|=|!=|\\?\\:"
|
158
|
+
}, {
|
159
|
+
token : "paren.lparen",
|
160
|
+
regex : /[\[\({]/
|
161
|
+
}, {
|
162
|
+
token : "paren.rparen",
|
163
|
+
regex : /[\])}]/
|
164
|
+
}, {
|
165
|
+
token : "text",
|
166
|
+
regex : "\\s+"
|
167
|
+
}]
|
168
|
+
});
|
280
169
|
|
281
|
-
this.
|
282
|
-
token: "comment",
|
283
|
-
regex: "\\/\\/.*(?=<\\/script>)",
|
284
|
-
next: "tag"
|
285
|
-
}, {
|
286
|
-
token: "meta.tag",
|
287
|
-
regex: "<\\/(?=script)",
|
288
|
-
next: "tag"
|
289
|
-
}]);
|
290
|
-
|
291
|
-
this.embedRules(CssHighlightRules, "css-", [{
|
292
|
-
token: "meta.tag",
|
293
|
-
regex: "<\\/(?=style)",
|
294
|
-
next: "tag"
|
295
|
-
}]);
|
170
|
+
this.normalizeRules();
|
296
171
|
};
|
297
172
|
oop.inherits(LiquidHighlightRules, TextHighlightRules);
|
298
173
|
|
299
174
|
exports.LiquidHighlightRules = LiquidHighlightRules;
|
300
175
|
});
|
301
176
|
|
302
|
-
define('ace/mode/
|
177
|
+
define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_highlight_rules'], function(require, exports, module) {
|
303
178
|
|
304
179
|
|
305
180
|
var oop = require("../lib/oop");
|
306
181
|
var lang = require("../lib/lang");
|
307
|
-
var
|
308
|
-
|
309
|
-
var
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
182
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
183
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
184
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
185
|
+
|
186
|
+
var tagMap = lang.createMap({
|
187
|
+
a : 'anchor',
|
188
|
+
button : 'form',
|
189
|
+
form : 'form',
|
190
|
+
img : 'image',
|
191
|
+
input : 'form',
|
192
|
+
label : 'form',
|
193
|
+
option : 'form',
|
194
|
+
script : 'script',
|
195
|
+
select : 'form',
|
196
|
+
textarea : 'form',
|
197
|
+
style : 'style',
|
198
|
+
table : 'table',
|
199
|
+
tbody : 'table',
|
200
|
+
td : 'table',
|
201
|
+
tfoot : 'table',
|
202
|
+
th : 'table',
|
203
|
+
tr : 'table'
|
204
|
+
});
|
327
205
|
|
328
|
-
|
329
|
-
|
330
|
-
"symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
|
331
|
-
"serif|monospace").split("|")
|
332
|
-
);
|
333
|
-
|
334
|
-
// regexp must not have capturing parentheses. Use (?:) instead.
|
335
|
-
// regexps are ordered -> the first match is used
|
206
|
+
var HtmlHighlightRules = function() {
|
207
|
+
XmlHighlightRules.call(this);
|
336
208
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
var base_ruleset = [
|
342
|
-
{
|
343
|
-
token : "comment", // multi line comment
|
344
|
-
merge : true,
|
345
|
-
regex : "\\/\\*",
|
346
|
-
next : "ruleset_comment"
|
347
|
-
}, {
|
348
|
-
token : "string", // single line
|
349
|
-
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
350
|
-
}, {
|
351
|
-
token : "string", // single line
|
352
|
-
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
353
|
-
}, {
|
354
|
-
token : ["constant.numeric", "keyword"],
|
355
|
-
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
|
209
|
+
this.addRules({
|
210
|
+
attributes: [{
|
211
|
+
include : "space"
|
356
212
|
}, {
|
357
|
-
token :
|
358
|
-
regex : "
|
213
|
+
token : "entity.other.attribute-name",
|
214
|
+
regex : "[-_a-zA-Z0-9:]+"
|
359
215
|
}, {
|
360
|
-
token : "
|
361
|
-
regex : "
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
216
|
+
token : "keyword.operator.separator",
|
217
|
+
regex : "=",
|
218
|
+
push : [{
|
219
|
+
include: "space"
|
220
|
+
}, {
|
221
|
+
token : "string",
|
222
|
+
regex : "[^<>='\"`\\s]+",
|
223
|
+
next : "pop"
|
224
|
+
}, {
|
225
|
+
token : "empty",
|
226
|
+
regex : "",
|
227
|
+
next : "pop"
|
228
|
+
}]
|
368
229
|
}, {
|
369
|
-
|
370
|
-
|
230
|
+
include : "string"
|
231
|
+
}],
|
232
|
+
tag: [{
|
233
|
+
token : function(start, tag) {
|
234
|
+
var group = tagMap[tag];
|
235
|
+
return ["meta.tag.punctuation.begin",
|
236
|
+
"meta.tag.name" + (group ? "." + group : "")];
|
237
|
+
},
|
238
|
+
regex : "(<)([-_a-zA-Z0-9:]+)",
|
239
|
+
next: "start_tag_stuff"
|
371
240
|
}, {
|
372
|
-
token : function(
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
else if (functions.hasOwnProperty(value.toLowerCase())) {
|
377
|
-
return "support.function";
|
378
|
-
}
|
379
|
-
else if (constants.hasOwnProperty(value.toLowerCase())) {
|
380
|
-
return "support.constant";
|
381
|
-
}
|
382
|
-
else if (colors.hasOwnProperty(value.toLowerCase())) {
|
383
|
-
return "support.constant.color";
|
384
|
-
}
|
385
|
-
else if (fonts.hasOwnProperty(value.toLowerCase())) {
|
386
|
-
return "support.constant.fonts";
|
387
|
-
}
|
388
|
-
else {
|
389
|
-
return "text";
|
390
|
-
}
|
241
|
+
token : function(start, tag) {
|
242
|
+
var group = tagMap[tag];
|
243
|
+
return ["meta.tag.punctuation.begin",
|
244
|
+
"meta.tag.name" + (group ? "." + group : "")];
|
391
245
|
},
|
392
|
-
regex : "
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
246
|
+
regex : "(</)([-_a-zA-Z0-9:]+)",
|
247
|
+
next: "end_tag_stuff"
|
248
|
+
}],
|
249
|
+
start_tag_stuff: [
|
250
|
+
{include : "attributes"},
|
251
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
|
252
|
+
],
|
253
|
+
end_tag_stuff: [
|
254
|
+
{include : "space"},
|
255
|
+
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
256
|
+
]
|
401
257
|
});
|
402
258
|
|
403
|
-
|
404
|
-
|
405
|
-
token : "paren.rparen",
|
406
|
-
regex : "\\}",
|
407
|
-
next: "media"
|
408
|
-
});
|
259
|
+
this.embedTagRules(CssHighlightRules, "css-", "style");
|
260
|
+
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
|
409
261
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
regex : ".+"
|
414
|
-
}];
|
262
|
+
if (this.constructor === HtmlHighlightRules)
|
263
|
+
this.normalizeRules();
|
264
|
+
};
|
415
265
|
|
416
|
-
|
417
|
-
comment.unshift({
|
418
|
-
token : "comment", // closing comment
|
419
|
-
regex : ".*?\\*\\/",
|
420
|
-
next : "start"
|
421
|
-
});
|
266
|
+
oop.inherits(HtmlHighlightRules, XmlHighlightRules);
|
422
267
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
next : "media"
|
428
|
-
});
|
268
|
+
exports.HtmlHighlightRules = HtmlHighlightRules;
|
269
|
+
});
|
270
|
+
|
271
|
+
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
429
272
|
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
273
|
+
|
274
|
+
var oop = require("../lib/oop");
|
275
|
+
var lang = require("../lib/lang");
|
276
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
277
|
+
var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
|
278
|
+
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
|
279
|
+
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
|
280
|
+
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
|
281
|
+
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
|
282
|
+
|
283
|
+
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
284
|
+
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
285
|
+
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
|
286
|
+
|
287
|
+
var CssHighlightRules = function() {
|
288
|
+
|
289
|
+
var keywordMapper = this.createKeywordMapper({
|
290
|
+
"support.function": supportFunction,
|
291
|
+
"support.constant": supportConstant,
|
292
|
+
"support.type": supportType,
|
293
|
+
"support.constant.color": supportConstantColor,
|
294
|
+
"support.constant.fonts": supportConstantFonts
|
295
|
+
}, "text", true);
|
436
296
|
|
437
297
|
this.$rules = {
|
438
298
|
"start" : [{
|
439
299
|
token : "comment", // multi line comment
|
440
|
-
merge : true,
|
441
300
|
regex : "\\/\\*",
|
442
|
-
|
301
|
+
push : "comment"
|
443
302
|
}, {
|
444
303
|
token: "paren.lparen",
|
445
304
|
regex: "\\{",
|
446
|
-
|
305
|
+
push: "ruleset"
|
447
306
|
}, {
|
448
307
|
token: "string",
|
449
308
|
regex: "@.*?{",
|
450
|
-
|
451
|
-
},{
|
309
|
+
push: "media"
|
310
|
+
}, {
|
452
311
|
token: "keyword",
|
453
312
|
regex: "#[a-z0-9-_]+"
|
454
|
-
},{
|
313
|
+
}, {
|
455
314
|
token: "variable",
|
456
315
|
regex: "\\.[a-z0-9-_]+"
|
457
|
-
},{
|
316
|
+
}, {
|
458
317
|
token: "string",
|
459
318
|
regex: ":[a-z0-9-_]+"
|
460
|
-
},{
|
319
|
+
}, {
|
461
320
|
token: "constant",
|
462
321
|
regex: "[a-z0-9-_]+"
|
322
|
+
}, {
|
323
|
+
caseInsensitive: true
|
463
324
|
}],
|
464
325
|
|
465
|
-
"media" : [
|
326
|
+
"media" : [{
|
466
327
|
token : "comment", // multi line comment
|
467
|
-
merge : true,
|
468
328
|
regex : "\\/\\*",
|
469
|
-
|
329
|
+
push : "comment"
|
470
330
|
}, {
|
471
331
|
token: "paren.lparen",
|
472
332
|
regex: "\\{",
|
473
|
-
|
474
|
-
},{
|
333
|
+
push: "ruleset"
|
334
|
+
}, {
|
475
335
|
token: "string",
|
476
336
|
regex: "\\}",
|
477
|
-
next: "
|
478
|
-
},{
|
337
|
+
next: "pop"
|
338
|
+
}, {
|
479
339
|
token: "keyword",
|
480
340
|
regex: "#[a-z0-9-_]+"
|
481
|
-
},{
|
341
|
+
}, {
|
482
342
|
token: "variable",
|
483
343
|
regex: "\\.[a-z0-9-_]+"
|
484
|
-
},{
|
344
|
+
}, {
|
485
345
|
token: "string",
|
486
346
|
regex: ":[a-z0-9-_]+"
|
487
|
-
},{
|
347
|
+
}, {
|
488
348
|
token: "constant",
|
489
349
|
regex: "[a-z0-9-_]+"
|
350
|
+
}, {
|
351
|
+
caseInsensitive: true
|
490
352
|
}],
|
491
353
|
|
492
|
-
"comment" :
|
493
|
-
|
494
|
-
|
495
|
-
|
354
|
+
"comment" : [{
|
355
|
+
token : "comment",
|
356
|
+
regex : "\\*\\/",
|
357
|
+
next : "pop"
|
358
|
+
}, {
|
359
|
+
defaultToken : "comment"
|
360
|
+
}],
|
496
361
|
|
497
|
-
"
|
498
|
-
|
362
|
+
"ruleset" : [
|
363
|
+
{
|
364
|
+
token : "paren.rparen",
|
365
|
+
regex : "\\}",
|
366
|
+
next: "pop"
|
367
|
+
}, {
|
368
|
+
token : "comment", // multi line comment
|
369
|
+
regex : "\\/\\*",
|
370
|
+
push : "comment"
|
371
|
+
}, {
|
372
|
+
token : "string", // single line
|
373
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
374
|
+
}, {
|
375
|
+
token : "string", // single line
|
376
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
377
|
+
}, {
|
378
|
+
token : ["constant.numeric", "keyword"],
|
379
|
+
regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
|
380
|
+
}, {
|
381
|
+
token : "constant.numeric",
|
382
|
+
regex : numRe
|
383
|
+
}, {
|
384
|
+
token : "constant.numeric", // hex6 color
|
385
|
+
regex : "#[a-f0-9]{6}"
|
386
|
+
}, {
|
387
|
+
token : "constant.numeric", // hex3 color
|
388
|
+
regex : "#[a-f0-9]{3}"
|
389
|
+
}, {
|
390
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
391
|
+
regex : pseudoElements
|
392
|
+
}, {
|
393
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
394
|
+
regex : pseudoClasses
|
395
|
+
}, {
|
396
|
+
token : ["support.function", "string", "support.function"],
|
397
|
+
regex : "(url\\()(.*)(\\))"
|
398
|
+
}, {
|
399
|
+
token : keywordMapper,
|
400
|
+
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
401
|
+
}, {
|
402
|
+
caseInsensitive: true
|
403
|
+
}]
|
499
404
|
};
|
405
|
+
|
406
|
+
this.normalizeRules();
|
500
407
|
};
|
501
408
|
|
502
409
|
oop.inherits(CssHighlightRules, TextHighlightRules);
|
@@ -505,68 +412,42 @@ exports.CssHighlightRules = CssHighlightRules;
|
|
505
412
|
|
506
413
|
});
|
507
414
|
|
508
|
-
define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/
|
415
|
+
define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
509
416
|
|
510
417
|
|
511
418
|
var oop = require("../lib/oop");
|
512
|
-
var lang = require("../lib/lang");
|
513
|
-
var unicode = require("../unicode");
|
514
419
|
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
515
420
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
516
421
|
|
517
422
|
var JavaScriptHighlightRules = function() {
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
"
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
"
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
// keywords which can be followed by regular expressions
|
547
|
-
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
|
548
|
-
|
549
|
-
var deprecated = lang.arrayToMap(
|
550
|
-
("__parent__|__count__|escape|unescape|with|__proto__").split("|")
|
551
|
-
);
|
552
|
-
|
553
|
-
var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
|
554
|
-
|
555
|
-
var buildinConstants = lang.arrayToMap(
|
556
|
-
("null|Infinity|NaN|undefined").split("|")
|
557
|
-
);
|
558
|
-
|
559
|
-
var futureReserved = lang.arrayToMap(
|
560
|
-
("class|enum|extends|super|export|implements|private|" +
|
561
|
-
"public|interface|package|protected|static").split("|")
|
562
|
-
);
|
563
|
-
|
564
|
-
// TODO: Unicode escape sequences
|
565
|
-
var identifierRe = "[" + unicode.packages.L + "\\$_]["
|
566
|
-
+ unicode.packages.L
|
567
|
-
+ unicode.packages.Mn + unicode.packages.Mc
|
568
|
-
+ unicode.packages.Nd
|
569
|
-
+ unicode.packages.Pc + "\\$_]*\\b";
|
423
|
+
var keywordMapper = this.createKeywordMapper({
|
424
|
+
"variable.language":
|
425
|
+
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
|
426
|
+
"Namespace|QName|XML|XMLList|" + // E4X
|
427
|
+
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
428
|
+
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
|
429
|
+
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
|
430
|
+
"SyntaxError|TypeError|URIError|" +
|
431
|
+
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
|
432
|
+
"isNaN|parseFloat|parseInt|" +
|
433
|
+
"JSON|Math|" + // Other
|
434
|
+
"this|arguments|prototype|window|document" , // Pseudo
|
435
|
+
"keyword":
|
436
|
+
"const|yield|import|get|set|" +
|
437
|
+
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
|
438
|
+
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
|
439
|
+
"__parent__|__count__|escape|unescape|with|__proto__|" +
|
440
|
+
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
|
441
|
+
"storage.type":
|
442
|
+
"const|let|var|function",
|
443
|
+
"constant.language":
|
444
|
+
"null|Infinity|NaN|undefined",
|
445
|
+
"support.function":
|
446
|
+
"alert",
|
447
|
+
"constant.language.boolean": "true|false"
|
448
|
+
}, "identifier");
|
449
|
+
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
|
450
|
+
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
570
451
|
|
571
452
|
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
572
453
|
"u[0-9a-fA-F]{4}|" + // unicode
|
@@ -576,19 +457,16 @@ var JavaScriptHighlightRules = function() {
|
|
576
457
|
"[4-7][0-7]?|" + //oct
|
577
458
|
".)";
|
578
459
|
|
579
|
-
// regexp must not have capturing parentheses. Use (?:) instead.
|
580
|
-
// regexps are ordered -> the first match is used
|
581
|
-
|
582
460
|
this.$rules = {
|
583
|
-
"
|
461
|
+
"no_regex" : [
|
584
462
|
{
|
585
463
|
token : "comment",
|
586
|
-
regex :
|
464
|
+
regex : "\\/\\/",
|
465
|
+
next : "line_comment"
|
587
466
|
},
|
588
467
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
589
468
|
{
|
590
469
|
token : "comment", // multi line comment
|
591
|
-
merge : true,
|
592
470
|
regex : /\/\*/,
|
593
471
|
next : "comment"
|
594
472
|
}, {
|
@@ -605,119 +483,61 @@ var JavaScriptHighlightRules = function() {
|
|
605
483
|
}, {
|
606
484
|
token : "constant.numeric", // float
|
607
485
|
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
|
608
|
-
}, {
|
609
|
-
token : [
|
610
|
-
"storage.type",
|
611
|
-
"punctuation.operator",
|
612
|
-
"support.function",
|
613
|
-
"punctuation.operator",
|
614
|
-
"entity.name.function",
|
615
|
-
"text",
|
616
|
-
"keyword.operator",
|
617
|
-
"text",
|
618
|
-
"storage.type",
|
619
|
-
"text",
|
620
|
-
"paren.lparen"
|
621
|
-
],
|
622
|
-
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
623
|
-
next: "function_arguments"
|
624
|
-
}, { // match stuff like: Sound.prototype.play = myfunc
|
486
|
+
}, {
|
625
487
|
token : [
|
626
|
-
"storage.type",
|
627
|
-
"punctuation.operator",
|
628
|
-
"support.function",
|
629
|
-
"punctuation.operator",
|
630
|
-
"entity.name.function",
|
631
|
-
"text",
|
632
|
-
"keyword.operator",
|
633
|
-
"text"
|
488
|
+
"storage.type", "punctuation.operator", "support.function",
|
489
|
+
"punctuation.operator", "entity.name.function", "text","keyword.operator"
|
634
490
|
],
|
635
|
-
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)
|
491
|
+
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
|
636
492
|
next: "function_arguments"
|
637
|
-
}, {
|
493
|
+
}, {
|
638
494
|
token : [
|
639
|
-
"storage.type",
|
640
|
-
"
|
641
|
-
"entity.name.function",
|
642
|
-
"text",
|
643
|
-
"keyword.operator",
|
644
|
-
"text",
|
645
|
-
"storage.type",
|
646
|
-
"text",
|
647
|
-
"paren.lparen"
|
495
|
+
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
496
|
+
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
|
648
497
|
],
|
649
498
|
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
650
499
|
next: "function_arguments"
|
651
|
-
}, {
|
500
|
+
}, {
|
652
501
|
token : [
|
653
|
-
"entity.name.function",
|
654
|
-
"text",
|
655
|
-
"keyword.operator",
|
656
|
-
"text",
|
657
|
-
"storage.type",
|
658
|
-
"text",
|
659
|
-
"paren.lparen"
|
502
|
+
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
|
503
|
+
"text", "paren.lparen"
|
660
504
|
],
|
661
505
|
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
662
506
|
next: "function_arguments"
|
663
|
-
}, {
|
507
|
+
}, {
|
664
508
|
token : [
|
665
|
-
"storage.type",
|
666
|
-
"
|
667
|
-
"entity.name.function",
|
668
|
-
"text",
|
669
|
-
"keyword.operator",
|
670
|
-
"text",
|
671
|
-
"storage.type",
|
672
|
-
"text",
|
673
|
-
"entity.name.function",
|
674
|
-
"text",
|
675
|
-
"paren.lparen"
|
509
|
+
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
510
|
+
"keyword.operator", "text",
|
511
|
+
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
676
512
|
],
|
677
513
|
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
|
678
514
|
next: "function_arguments"
|
679
|
-
}, {
|
515
|
+
}, {
|
680
516
|
token : [
|
681
|
-
"storage.type",
|
682
|
-
"text",
|
683
|
-
"entity.name.function",
|
684
|
-
"text",
|
685
|
-
"paren.lparen"
|
517
|
+
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
686
518
|
],
|
687
519
|
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
|
688
520
|
next: "function_arguments"
|
689
|
-
}, {
|
521
|
+
}, {
|
690
522
|
token : [
|
691
|
-
"entity.name.function",
|
692
|
-
"text",
|
693
|
-
"punctuation.operator",
|
694
|
-
"text",
|
695
|
-
"storage.type",
|
696
|
-
"text",
|
697
|
-
"paren.lparen"
|
523
|
+
"entity.name.function", "text", "punctuation.operator",
|
524
|
+
"text", "storage.type", "text", "paren.lparen"
|
698
525
|
],
|
699
526
|
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
|
700
527
|
next: "function_arguments"
|
701
|
-
}, {
|
528
|
+
}, {
|
702
529
|
token : [
|
703
|
-
"text",
|
704
|
-
"text",
|
705
|
-
"storage.type",
|
706
|
-
"text",
|
707
|
-
"paren.lparen"
|
530
|
+
"text", "text", "storage.type", "text", "paren.lparen"
|
708
531
|
],
|
709
532
|
regex : "(:)(\\s*)(function)(\\s*)(\\()",
|
710
533
|
next: "function_arguments"
|
711
|
-
}, {
|
712
|
-
token : "constant.language.boolean",
|
713
|
-
regex : /(?:true|false)\b/
|
714
534
|
}, {
|
715
535
|
token : "keyword",
|
716
536
|
regex : "(?:" + kwBeforeRe + ")\\b",
|
717
|
-
next : "
|
537
|
+
next : "start"
|
718
538
|
}, {
|
719
539
|
token : ["punctuation.operator", "support.function"],
|
720
|
-
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:
|
540
|
+
regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
|
721
541
|
}, {
|
722
542
|
token : ["punctuation.operator", "support.function.dom"],
|
723
543
|
regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
|
@@ -728,78 +548,54 @@ var JavaScriptHighlightRules = function() {
|
|
728
548
|
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
729
549
|
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
|
730
550
|
}, {
|
731
|
-
token :
|
732
|
-
if (globals.hasOwnProperty(value))
|
733
|
-
return "variable.language";
|
734
|
-
else if (deprecated.hasOwnProperty(value))
|
735
|
-
return "invalid.deprecated";
|
736
|
-
else if (definitions.hasOwnProperty(value))
|
737
|
-
return "storage.type";
|
738
|
-
else if (keywords.hasOwnProperty(value))
|
739
|
-
return "keyword";
|
740
|
-
else if (buildinConstants.hasOwnProperty(value))
|
741
|
-
return "constant.language";
|
742
|
-
else if (futureReserved.hasOwnProperty(value))
|
743
|
-
return "invalid.illegal";
|
744
|
-
else if (value == "debugger")
|
745
|
-
return "invalid.deprecated";
|
746
|
-
else
|
747
|
-
return "identifier";
|
748
|
-
},
|
551
|
+
token : keywordMapper,
|
749
552
|
regex : identifierRe
|
750
553
|
}, {
|
751
554
|
token : "keyword.operator",
|
752
|
-
regex :
|
753
|
-
next : "
|
555
|
+
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
|
556
|
+
next : "start"
|
754
557
|
}, {
|
755
558
|
token : "punctuation.operator",
|
756
559
|
regex : /\?|\:|\,|\;|\./,
|
757
|
-
next : "
|
560
|
+
next : "start"
|
758
561
|
}, {
|
759
562
|
token : "paren.lparen",
|
760
563
|
regex : /[\[({]/,
|
761
|
-
next : "
|
564
|
+
next : "start"
|
762
565
|
}, {
|
763
566
|
token : "paren.rparen",
|
764
567
|
regex : /[\])}]/
|
765
568
|
}, {
|
766
569
|
token : "keyword.operator",
|
767
570
|
regex : /\/=?/,
|
768
|
-
next : "
|
571
|
+
next : "start"
|
769
572
|
}, {
|
770
573
|
token: "comment",
|
771
574
|
regex: /^#!.*$/
|
772
|
-
}, {
|
773
|
-
token : "text",
|
774
|
-
regex : /\s+/
|
775
575
|
}
|
776
576
|
],
|
777
|
-
|
778
|
-
// makes sure we don't mix up regexps with the divison operator
|
779
|
-
"regex_allowed": [
|
577
|
+
"start": [
|
780
578
|
DocCommentHighlightRules.getStartRule("doc-start"),
|
781
579
|
{
|
782
580
|
token : "comment", // multi line comment
|
783
|
-
merge : true,
|
784
581
|
regex : "\\/\\*",
|
785
582
|
next : "comment_regex_allowed"
|
786
583
|
}, {
|
787
584
|
token : "comment",
|
788
|
-
regex : "
|
585
|
+
regex : "\\/\\/",
|
586
|
+
next : "line_comment_regex_allowed"
|
789
587
|
}, {
|
790
588
|
token: "string.regexp",
|
791
589
|
regex: "\\/",
|
792
|
-
next: "regex"
|
793
|
-
merge: true
|
590
|
+
next: "regex"
|
794
591
|
}, {
|
795
592
|
token : "text",
|
796
|
-
regex : "\\s
|
593
|
+
regex : "\\s+|^$",
|
594
|
+
next : "start"
|
797
595
|
}, {
|
798
|
-
// immediately return to the start mode without matching
|
799
|
-
// anything
|
800
596
|
token: "empty",
|
801
597
|
regex: "",
|
802
|
-
next: "
|
598
|
+
next: "no_regex"
|
803
599
|
}
|
804
600
|
],
|
805
601
|
"regex": [
|
@@ -807,24 +603,28 @@ var JavaScriptHighlightRules = function() {
|
|
807
603
|
token: "regexp.keyword.operator",
|
808
604
|
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
809
605
|
}, {
|
810
|
-
// flag
|
811
606
|
token: "string.regexp",
|
812
|
-
regex: "
|
813
|
-
next: "
|
814
|
-
merge: true
|
607
|
+
regex: "/[sxngimy]*",
|
608
|
+
next: "no_regex"
|
815
609
|
}, {
|
816
|
-
token: "
|
817
|
-
regex:
|
818
|
-
merge: true
|
610
|
+
token : "invalid",
|
611
|
+
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
|
819
612
|
}, {
|
820
|
-
token: "
|
821
|
-
regex:
|
822
|
-
|
823
|
-
|
613
|
+
token : "constant.language.escape",
|
614
|
+
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
|
615
|
+
}, {
|
616
|
+
token : "constant.language.delimiter",
|
617
|
+
regex: /\|/
|
618
|
+
}, {
|
619
|
+
token: "constant.language.escape",
|
620
|
+
regex: /\[\^?/,
|
621
|
+
next: "regex_character_class"
|
824
622
|
}, {
|
825
623
|
token: "empty",
|
826
|
-
regex: "",
|
827
|
-
next: "
|
624
|
+
regex: "$",
|
625
|
+
next: "no_regex"
|
626
|
+
}, {
|
627
|
+
defaultToken: "string.regexp"
|
828
628
|
}
|
829
629
|
],
|
830
630
|
"regex_character_class": [
|
@@ -832,18 +632,18 @@ var JavaScriptHighlightRules = function() {
|
|
832
632
|
token: "regexp.keyword.operator",
|
833
633
|
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
834
634
|
}, {
|
835
|
-
token: "
|
635
|
+
token: "constant.language.escape",
|
836
636
|
regex: "]",
|
837
|
-
next: "regex"
|
838
|
-
merge: true
|
637
|
+
next: "regex"
|
839
638
|
}, {
|
840
|
-
token: "
|
841
|
-
regex: "
|
842
|
-
merge: true
|
639
|
+
token: "constant.language.escape",
|
640
|
+
regex: "-"
|
843
641
|
}, {
|
844
642
|
token: "empty",
|
845
|
-
regex: "",
|
846
|
-
next: "
|
643
|
+
regex: "$",
|
644
|
+
next: "no_regex"
|
645
|
+
}, {
|
646
|
+
defaultToken: "string.regexp.charachterclass"
|
847
647
|
}
|
848
648
|
],
|
849
649
|
"function_arguments": [
|
@@ -852,86 +652,68 @@ var JavaScriptHighlightRules = function() {
|
|
852
652
|
regex: identifierRe
|
853
653
|
}, {
|
854
654
|
token: "punctuation.operator",
|
855
|
-
regex: "[, ]+"
|
856
|
-
merge: true
|
655
|
+
regex: "[, ]+"
|
857
656
|
}, {
|
858
657
|
token: "punctuation.operator",
|
859
|
-
regex: "$"
|
860
|
-
merge: true
|
658
|
+
regex: "$"
|
861
659
|
}, {
|
862
660
|
token: "empty",
|
863
661
|
regex: "",
|
864
|
-
next: "
|
662
|
+
next: "no_regex"
|
865
663
|
}
|
866
664
|
],
|
867
665
|
"comment_regex_allowed" : [
|
868
|
-
{
|
869
|
-
|
870
|
-
regex : ".*?\\*\\/",
|
871
|
-
merge : true,
|
872
|
-
next : "regex_allowed"
|
873
|
-
}, {
|
874
|
-
token : "comment", // comment spanning whole line
|
875
|
-
merge : true,
|
876
|
-
regex : ".+"
|
877
|
-
}
|
666
|
+
{token : "comment", regex : "\\*\\/", next : "start"},
|
667
|
+
{defaultToken : "comment"}
|
878
668
|
],
|
879
669
|
"comment" : [
|
880
|
-
{
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
}
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
}
|
670
|
+
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
671
|
+
{defaultToken : "comment"}
|
672
|
+
],
|
673
|
+
"line_comment_regex_allowed" : [
|
674
|
+
{token : "comment", regex : "$|^", next : "start"},
|
675
|
+
{defaultToken : "comment"}
|
676
|
+
],
|
677
|
+
"line_comment" : [
|
678
|
+
{token : "comment", regex : "$|^", next : "no_regex"},
|
679
|
+
{defaultToken : "comment"}
|
890
680
|
],
|
891
681
|
"qqstring" : [
|
892
682
|
{
|
893
683
|
token : "constant.language.escape",
|
894
684
|
regex : escapedRe
|
895
|
-
}, {
|
896
|
-
token : "string",
|
897
|
-
regex : '[^"\\\\]+',
|
898
|
-
merge : true
|
899
685
|
}, {
|
900
686
|
token : "string",
|
901
687
|
regex : "\\\\$",
|
902
|
-
next : "qqstring"
|
903
|
-
merge : true
|
688
|
+
next : "qqstring"
|
904
689
|
}, {
|
905
690
|
token : "string",
|
906
691
|
regex : '"|$',
|
907
|
-
next : "
|
908
|
-
|
692
|
+
next : "no_regex"
|
693
|
+
}, {
|
694
|
+
defaultToken: "string"
|
909
695
|
}
|
910
696
|
],
|
911
697
|
"qstring" : [
|
912
698
|
{
|
913
699
|
token : "constant.language.escape",
|
914
700
|
regex : escapedRe
|
915
|
-
}, {
|
916
|
-
token : "string",
|
917
|
-
regex : "[^'\\\\]+",
|
918
|
-
merge : true
|
919
701
|
}, {
|
920
702
|
token : "string",
|
921
703
|
regex : "\\\\$",
|
922
|
-
next : "qstring"
|
923
|
-
merge : true
|
704
|
+
next : "qstring"
|
924
705
|
}, {
|
925
706
|
token : "string",
|
926
707
|
regex : "'|$",
|
927
|
-
next : "
|
928
|
-
|
708
|
+
next : "no_regex"
|
709
|
+
}, {
|
710
|
+
defaultToken: "string"
|
929
711
|
}
|
930
712
|
]
|
931
713
|
};
|
932
714
|
|
933
715
|
this.embedRules(DocCommentHighlightRules, "doc-",
|
934
|
-
[ DocCommentHighlightRules.getEndRule("
|
716
|
+
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
|
935
717
|
};
|
936
718
|
|
937
719
|
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
@@ -952,21 +734,10 @@ var DocCommentHighlightRules = function() {
|
|
952
734
|
token : "comment.doc.tag",
|
953
735
|
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
954
736
|
}, {
|
955
|
-
token : "comment.doc",
|
956
|
-
|
957
|
-
regex : "\\s+"
|
958
|
-
}, {
|
959
|
-
token : "comment.doc",
|
960
|
-
merge : true,
|
961
|
-
regex : "TODO"
|
962
|
-
}, {
|
963
|
-
token : "comment.doc",
|
964
|
-
merge : true,
|
965
|
-
regex : "[^@\\*]+"
|
737
|
+
token : "comment.doc.tag",
|
738
|
+
regex : "\\bTODO\\b"
|
966
739
|
}, {
|
967
|
-
|
968
|
-
merge : true,
|
969
|
-
regex : "."
|
740
|
+
defaultToken : "comment.doc"
|
970
741
|
}]
|
971
742
|
};
|
972
743
|
};
|
@@ -976,7 +747,6 @@ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
|
976
747
|
DocCommentHighlightRules.getStartRule = function(start) {
|
977
748
|
return {
|
978
749
|
token : "comment.doc", // doc comment
|
979
|
-
merge : true,
|
980
750
|
regex : "\\/\\*(?=\\*)",
|
981
751
|
next : start
|
982
752
|
};
|
@@ -985,7 +755,6 @@ DocCommentHighlightRules.getStartRule = function(start) {
|
|
985
755
|
DocCommentHighlightRules.getEndRule = function (start) {
|
986
756
|
return {
|
987
757
|
token : "comment.doc", // closing comment
|
988
|
-
merge : true,
|
989
758
|
regex : "\\*\\/",
|
990
759
|
next : start
|
991
760
|
};
|
@@ -996,40 +765,217 @@ exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
|
996
765
|
|
997
766
|
});
|
998
767
|
|
768
|
+
define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
769
|
+
|
770
|
+
|
771
|
+
var oop = require("../lib/oop");
|
772
|
+
var xmlUtil = require("./xml_util");
|
773
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
774
|
+
|
775
|
+
var XmlHighlightRules = function(normalize) {
|
776
|
+
this.$rules = {
|
777
|
+
start : [
|
778
|
+
{token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
|
779
|
+
{
|
780
|
+
token : ["punctuation.instruction.begin", "keyword.instruction"],
|
781
|
+
regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
|
782
|
+
},
|
783
|
+
{
|
784
|
+
token : ["punctuation.instruction.begin", "keyword.instruction"],
|
785
|
+
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
|
786
|
+
},
|
787
|
+
{token : "comment", regex : "<\\!--", next : "comment"},
|
788
|
+
{
|
789
|
+
token : ["punctuation.doctype.begin", "meta.tag.doctype"],
|
790
|
+
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
|
791
|
+
},
|
792
|
+
{include : "tag"},
|
793
|
+
{include : "reference"}
|
794
|
+
],
|
795
|
+
|
796
|
+
xml_declaration : [
|
797
|
+
{include : "attributes"},
|
798
|
+
{include : "instruction"}
|
799
|
+
],
|
800
|
+
|
801
|
+
instruction : [
|
802
|
+
{token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
|
803
|
+
],
|
804
|
+
|
805
|
+
doctype : [
|
806
|
+
{include : "space"},
|
807
|
+
{include : "string"},
|
808
|
+
{token : "punctuation.doctype.end", regex : ">", next : "start"},
|
809
|
+
{token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
|
810
|
+
{token : "punctuation.begin", regex : "\\[", push : "declarations"}
|
811
|
+
],
|
812
|
+
|
813
|
+
declarations : [{
|
814
|
+
token : "text",
|
815
|
+
regex : "\\s+"
|
816
|
+
}, {
|
817
|
+
token: "punctuation.end",
|
818
|
+
regex: "]",
|
819
|
+
next: "pop"
|
820
|
+
}, {
|
821
|
+
token : ["punctuation.begin", "keyword"],
|
822
|
+
regex : "(<\\!)([-_a-zA-Z0-9]+)",
|
823
|
+
push : [{
|
824
|
+
token : "text",
|
825
|
+
regex : "\\s+"
|
826
|
+
},
|
827
|
+
{
|
828
|
+
token : "punctuation.end",
|
829
|
+
regex : ">",
|
830
|
+
next : "pop"
|
831
|
+
},
|
832
|
+
{include : "string"}]
|
833
|
+
}],
|
834
|
+
|
835
|
+
cdata : [
|
836
|
+
{token : "string.end", regex : "\\]\\]>", next : "start"},
|
837
|
+
{token : "text", regex : "\\s+"},
|
838
|
+
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
|
839
|
+
],
|
840
|
+
|
841
|
+
comment : [
|
842
|
+
{token : "comment", regex : "-->", next : "start"},
|
843
|
+
{defaultToken : "comment"}
|
844
|
+
],
|
845
|
+
|
846
|
+
tag : [{
|
847
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
|
848
|
+
regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
849
|
+
next: [
|
850
|
+
{include : "attributes"},
|
851
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
|
852
|
+
]
|
853
|
+
}, {
|
854
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
|
855
|
+
regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
856
|
+
next: [
|
857
|
+
{include : "space"},
|
858
|
+
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
859
|
+
]
|
860
|
+
}],
|
861
|
+
|
862
|
+
space : [
|
863
|
+
{token : "text", regex : "\\s+"}
|
864
|
+
],
|
865
|
+
|
866
|
+
reference : [{
|
867
|
+
token : "constant.language.escape",
|
868
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
869
|
+
}, {
|
870
|
+
token : "text", regex : "&"
|
871
|
+
}],
|
872
|
+
|
873
|
+
string: [{
|
874
|
+
token : "string",
|
875
|
+
regex : "'",
|
876
|
+
push : "qstring_inner"
|
877
|
+
}, {
|
878
|
+
token : "string",
|
879
|
+
regex : '"',
|
880
|
+
push : "qqstring_inner"
|
881
|
+
}],
|
882
|
+
|
883
|
+
qstring_inner: [
|
884
|
+
{token : "string", regex: "'", next: "pop"},
|
885
|
+
{include : "reference"},
|
886
|
+
{defaultToken : "string"}
|
887
|
+
],
|
888
|
+
|
889
|
+
qqstring_inner: [
|
890
|
+
{token : "string", regex: '"', next: "pop"},
|
891
|
+
{include : "reference"},
|
892
|
+
{defaultToken : "string"}
|
893
|
+
],
|
894
|
+
|
895
|
+
attributes: [{
|
896
|
+
token : "entity.other.attribute-name",
|
897
|
+
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
898
|
+
}, {
|
899
|
+
token : "keyword.operator.separator",
|
900
|
+
regex : "="
|
901
|
+
}, {
|
902
|
+
include : "space"
|
903
|
+
}, {
|
904
|
+
include : "string"
|
905
|
+
}]
|
906
|
+
};
|
907
|
+
|
908
|
+
if (this.constructor === XmlHighlightRules)
|
909
|
+
this.normalizeRules();
|
910
|
+
};
|
911
|
+
|
912
|
+
|
913
|
+
(function() {
|
914
|
+
|
915
|
+
this.embedTagRules = function(HighlightRules, prefix, tag){
|
916
|
+
this.$rules.tag.unshift({
|
917
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
|
918
|
+
regex : "(<)(" + tag + ")",
|
919
|
+
next: [
|
920
|
+
{include : "space"},
|
921
|
+
{include : "attributes"},
|
922
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
|
923
|
+
]
|
924
|
+
});
|
925
|
+
|
926
|
+
this.$rules[tag + "-end"] = [
|
927
|
+
{include : "space"},
|
928
|
+
{token : "meta.tag.punctuation.end", regex : ">", next: "start",
|
929
|
+
onMatch : function(value, currentState, stack) {
|
930
|
+
stack.splice(0);
|
931
|
+
return this.token;
|
932
|
+
}}
|
933
|
+
]
|
934
|
+
|
935
|
+
this.embedRules(HighlightRules, prefix, [{
|
936
|
+
token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
|
937
|
+
regex : "(</)(" + tag + ")",
|
938
|
+
next: tag + "-end"
|
939
|
+
}, {
|
940
|
+
token: "string.begin",
|
941
|
+
regex : "<\\!\\[CDATA\\["
|
942
|
+
}, {
|
943
|
+
token: "string.end",
|
944
|
+
regex : "\\]\\]>"
|
945
|
+
}]);
|
946
|
+
};
|
947
|
+
|
948
|
+
}).call(TextHighlightRules.prototype);
|
949
|
+
|
950
|
+
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
951
|
+
|
952
|
+
exports.XmlHighlightRules = XmlHighlightRules;
|
953
|
+
});
|
954
|
+
|
999
955
|
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
|
1000
956
|
|
1001
957
|
|
1002
958
|
function string(state) {
|
1003
959
|
return [{
|
1004
960
|
token : "string",
|
1005
|
-
regex : '"
|
1006
|
-
}, {
|
1007
|
-
token : "string", // multi line string start
|
1008
|
-
merge : true,
|
1009
|
-
regex : '["].*',
|
961
|
+
regex : '"',
|
1010
962
|
next : state + "_qqstring"
|
1011
963
|
}, {
|
1012
964
|
token : "string",
|
1013
|
-
regex : "'
|
1014
|
-
}, {
|
1015
|
-
token : "string", // multi line string start
|
1016
|
-
merge : true,
|
1017
|
-
regex : "['].*",
|
965
|
+
regex : "'",
|
1018
966
|
next : state + "_qstring"
|
1019
967
|
}];
|
1020
968
|
}
|
1021
969
|
|
1022
970
|
function multiLineString(quote, state) {
|
1023
|
-
return [
|
1024
|
-
token : "string",
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
regex : '.+'
|
1032
|
-
}];
|
971
|
+
return [
|
972
|
+
{token : "string", regex : quote, next : state},
|
973
|
+
{
|
974
|
+
token : "constant.language.escape",
|
975
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
976
|
+
},
|
977
|
+
{defaultToken : "string"}
|
978
|
+
];
|
1033
979
|
}
|
1034
980
|
|
1035
981
|
exports.tag = function(states, name, nextState, tagMap) {
|
@@ -1037,7 +983,6 @@ exports.tag = function(states, name, nextState, tagMap) {
|
|
1037
983
|
token : "text",
|
1038
984
|
regex : "\\s+"
|
1039
985
|
}, {
|
1040
|
-
//token : "meta.tag",
|
1041
986
|
|
1042
987
|
token : !tagMap ? "meta.tag.tag-name" : function(value) {
|
1043
988
|
if (tagMap[value])
|
@@ -1045,7 +990,6 @@ exports.tag = function(states, name, nextState, tagMap) {
|
|
1045
990
|
else
|
1046
991
|
return "meta.tag.tag-name";
|
1047
992
|
},
|
1048
|
-
merge : true,
|
1049
993
|
regex : "[-_a-zA-Z0-9:]+",
|
1050
994
|
next : name + "_embed_attribute_list"
|
1051
995
|
}, {
|
@@ -1058,9 +1002,8 @@ exports.tag = function(states, name, nextState, tagMap) {
|
|
1058
1002
|
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
|
1059
1003
|
|
1060
1004
|
states[name + "_embed_attribute_list"] = [{
|
1061
|
-
token : "meta.tag",
|
1062
|
-
|
1063
|
-
regex : "\/?>",
|
1005
|
+
token : "meta.tag.r",
|
1006
|
+
regex : "/?>",
|
1064
1007
|
next : nextState
|
1065
1008
|
}, {
|
1066
1009
|
token : "keyword.operator",
|
@@ -1111,12 +1054,7 @@ var MatchingBraceOutdent = function() {};
|
|
1111
1054
|
};
|
1112
1055
|
|
1113
1056
|
this.$getIndent = function(line) {
|
1114
|
-
|
1115
|
-
if (match) {
|
1116
|
-
return match[1];
|
1117
|
-
}
|
1118
|
-
|
1119
|
-
return "";
|
1057
|
+
return line.match(/^\s*/)[0];
|
1120
1058
|
};
|
1121
1059
|
|
1122
1060
|
}).call(MatchingBraceOutdent.prototype);
|