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
@@ -0,0 +1,1553 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
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.
|
28
|
+
*
|
29
|
+
* ***** END LICENSE BLOCK ***** */
|
30
|
+
|
31
|
+
define('ace/mode/jsp', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsp_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
32
|
+
|
33
|
+
|
34
|
+
var oop = require("../lib/oop");
|
35
|
+
var TextMode = require("./text").Mode;
|
36
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
37
|
+
var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
|
38
|
+
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
39
|
+
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
40
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
41
|
+
|
42
|
+
var Mode = function() {
|
43
|
+
this.HighlightRules = JspHighlightRules;
|
44
|
+
this.$outdent = new MatchingBraceOutdent();
|
45
|
+
this.$behaviour = new CstyleBehaviour();
|
46
|
+
this.foldingRules = new CStyleFoldMode();
|
47
|
+
};
|
48
|
+
oop.inherits(Mode, TextMode);
|
49
|
+
|
50
|
+
(function() {
|
51
|
+
|
52
|
+
this.$id = "ace/mode/jsp";
|
53
|
+
}).call(Mode.prototype);
|
54
|
+
|
55
|
+
exports.Mode = Mode;
|
56
|
+
});
|
57
|
+
|
58
|
+
define('ace/mode/jsp_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/html_highlight_rules', 'ace/mode/java_highlight_rules'], function(require, exports, module) {
|
59
|
+
|
60
|
+
|
61
|
+
var oop = require("../lib/oop");
|
62
|
+
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
63
|
+
var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
|
64
|
+
|
65
|
+
var JspHighlightRules = function() {
|
66
|
+
HtmlHighlightRules.call(this);
|
67
|
+
|
68
|
+
var builtinVariables = 'request|response|out|session|' +
|
69
|
+
'application|config|pageContext|page|Exception';
|
70
|
+
|
71
|
+
var keywords = 'page|include|taglib';
|
72
|
+
|
73
|
+
var startRules = [
|
74
|
+
{
|
75
|
+
token : "comment",
|
76
|
+
regex : "<%--",
|
77
|
+
push : "jsp-dcomment"
|
78
|
+
}, {
|
79
|
+
token : "meta.tag", // jsp open tag
|
80
|
+
regex : "<%@?|<%=?|<jsp:[^>]+>",
|
81
|
+
push : "jsp-start"
|
82
|
+
}
|
83
|
+
];
|
84
|
+
|
85
|
+
var endRules = [
|
86
|
+
{
|
87
|
+
token : "meta.tag", // jsp close tag
|
88
|
+
regex : "%>|<\\/jsp:[^>]+>",
|
89
|
+
next : "pop"
|
90
|
+
}, {
|
91
|
+
token: "variable.language",
|
92
|
+
regex : builtinVariables
|
93
|
+
}, {
|
94
|
+
token: "keyword",
|
95
|
+
regex : keywords
|
96
|
+
}
|
97
|
+
];
|
98
|
+
|
99
|
+
for (var key in this.$rules)
|
100
|
+
this.$rules[key].unshift.apply(this.$rules[key], startRules);
|
101
|
+
|
102
|
+
this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
|
103
|
+
|
104
|
+
this.addRules({
|
105
|
+
"jsp-dcomment" : [{
|
106
|
+
token : "comment",
|
107
|
+
regex : ".*?--%>",
|
108
|
+
next : "pop"
|
109
|
+
}]
|
110
|
+
});
|
111
|
+
|
112
|
+
this.normalizeRules();
|
113
|
+
};
|
114
|
+
|
115
|
+
oop.inherits(JspHighlightRules, HtmlHighlightRules);
|
116
|
+
|
117
|
+
exports.JspHighlightRules = JspHighlightRules;
|
118
|
+
});
|
119
|
+
|
120
|
+
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) {
|
121
|
+
|
122
|
+
|
123
|
+
var oop = require("../lib/oop");
|
124
|
+
var lang = require("../lib/lang");
|
125
|
+
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
126
|
+
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
127
|
+
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
128
|
+
|
129
|
+
var tagMap = lang.createMap({
|
130
|
+
a : 'anchor',
|
131
|
+
button : 'form',
|
132
|
+
form : 'form',
|
133
|
+
img : 'image',
|
134
|
+
input : 'form',
|
135
|
+
label : 'form',
|
136
|
+
option : 'form',
|
137
|
+
script : 'script',
|
138
|
+
select : 'form',
|
139
|
+
textarea : 'form',
|
140
|
+
style : 'style',
|
141
|
+
table : 'table',
|
142
|
+
tbody : 'table',
|
143
|
+
td : 'table',
|
144
|
+
tfoot : 'table',
|
145
|
+
th : 'table',
|
146
|
+
tr : 'table'
|
147
|
+
});
|
148
|
+
|
149
|
+
var HtmlHighlightRules = function() {
|
150
|
+
XmlHighlightRules.call(this);
|
151
|
+
|
152
|
+
this.addRules({
|
153
|
+
attributes: [{
|
154
|
+
include : "space"
|
155
|
+
}, {
|
156
|
+
token : "entity.other.attribute-name",
|
157
|
+
regex : "[-_a-zA-Z0-9:]+"
|
158
|
+
}, {
|
159
|
+
token : "keyword.operator.separator",
|
160
|
+
regex : "=",
|
161
|
+
push : [{
|
162
|
+
include: "space"
|
163
|
+
}, {
|
164
|
+
token : "string",
|
165
|
+
regex : "[^<>='\"`\\s]+",
|
166
|
+
next : "pop"
|
167
|
+
}, {
|
168
|
+
token : "empty",
|
169
|
+
regex : "",
|
170
|
+
next : "pop"
|
171
|
+
}]
|
172
|
+
}, {
|
173
|
+
include : "string"
|
174
|
+
}],
|
175
|
+
tag: [{
|
176
|
+
token : function(start, tag) {
|
177
|
+
var group = tagMap[tag];
|
178
|
+
return ["meta.tag.punctuation.begin",
|
179
|
+
"meta.tag.name" + (group ? "." + group : "")];
|
180
|
+
},
|
181
|
+
regex : "(<)([-_a-zA-Z0-9:]+)",
|
182
|
+
next: "start_tag_stuff"
|
183
|
+
}, {
|
184
|
+
token : function(start, tag) {
|
185
|
+
var group = tagMap[tag];
|
186
|
+
return ["meta.tag.punctuation.begin",
|
187
|
+
"meta.tag.name" + (group ? "." + group : "")];
|
188
|
+
},
|
189
|
+
regex : "(</)([-_a-zA-Z0-9:]+)",
|
190
|
+
next: "end_tag_stuff"
|
191
|
+
}],
|
192
|
+
start_tag_stuff: [
|
193
|
+
{include : "attributes"},
|
194
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
|
195
|
+
],
|
196
|
+
end_tag_stuff: [
|
197
|
+
{include : "space"},
|
198
|
+
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
199
|
+
]
|
200
|
+
});
|
201
|
+
|
202
|
+
this.embedTagRules(CssHighlightRules, "css-", "style");
|
203
|
+
this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
|
204
|
+
|
205
|
+
if (this.constructor === HtmlHighlightRules)
|
206
|
+
this.normalizeRules();
|
207
|
+
};
|
208
|
+
|
209
|
+
oop.inherits(HtmlHighlightRules, XmlHighlightRules);
|
210
|
+
|
211
|
+
exports.HtmlHighlightRules = HtmlHighlightRules;
|
212
|
+
});
|
213
|
+
|
214
|
+
define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
215
|
+
|
216
|
+
|
217
|
+
var oop = require("../lib/oop");
|
218
|
+
var lang = require("../lib/lang");
|
219
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
220
|
+
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";
|
221
|
+
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
|
222
|
+
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";
|
223
|
+
var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
|
224
|
+
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";
|
225
|
+
|
226
|
+
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
|
227
|
+
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
|
228
|
+
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";
|
229
|
+
|
230
|
+
var CssHighlightRules = function() {
|
231
|
+
|
232
|
+
var keywordMapper = this.createKeywordMapper({
|
233
|
+
"support.function": supportFunction,
|
234
|
+
"support.constant": supportConstant,
|
235
|
+
"support.type": supportType,
|
236
|
+
"support.constant.color": supportConstantColor,
|
237
|
+
"support.constant.fonts": supportConstantFonts
|
238
|
+
}, "text", true);
|
239
|
+
|
240
|
+
this.$rules = {
|
241
|
+
"start" : [{
|
242
|
+
token : "comment", // multi line comment
|
243
|
+
regex : "\\/\\*",
|
244
|
+
push : "comment"
|
245
|
+
}, {
|
246
|
+
token: "paren.lparen",
|
247
|
+
regex: "\\{",
|
248
|
+
push: "ruleset"
|
249
|
+
}, {
|
250
|
+
token: "string",
|
251
|
+
regex: "@.*?{",
|
252
|
+
push: "media"
|
253
|
+
}, {
|
254
|
+
token: "keyword",
|
255
|
+
regex: "#[a-z0-9-_]+"
|
256
|
+
}, {
|
257
|
+
token: "variable",
|
258
|
+
regex: "\\.[a-z0-9-_]+"
|
259
|
+
}, {
|
260
|
+
token: "string",
|
261
|
+
regex: ":[a-z0-9-_]+"
|
262
|
+
}, {
|
263
|
+
token: "constant",
|
264
|
+
regex: "[a-z0-9-_]+"
|
265
|
+
}, {
|
266
|
+
caseInsensitive: true
|
267
|
+
}],
|
268
|
+
|
269
|
+
"media" : [{
|
270
|
+
token : "comment", // multi line comment
|
271
|
+
regex : "\\/\\*",
|
272
|
+
push : "comment"
|
273
|
+
}, {
|
274
|
+
token: "paren.lparen",
|
275
|
+
regex: "\\{",
|
276
|
+
push: "ruleset"
|
277
|
+
}, {
|
278
|
+
token: "string",
|
279
|
+
regex: "\\}",
|
280
|
+
next: "pop"
|
281
|
+
}, {
|
282
|
+
token: "keyword",
|
283
|
+
regex: "#[a-z0-9-_]+"
|
284
|
+
}, {
|
285
|
+
token: "variable",
|
286
|
+
regex: "\\.[a-z0-9-_]+"
|
287
|
+
}, {
|
288
|
+
token: "string",
|
289
|
+
regex: ":[a-z0-9-_]+"
|
290
|
+
}, {
|
291
|
+
token: "constant",
|
292
|
+
regex: "[a-z0-9-_]+"
|
293
|
+
}, {
|
294
|
+
caseInsensitive: true
|
295
|
+
}],
|
296
|
+
|
297
|
+
"comment" : [{
|
298
|
+
token : "comment",
|
299
|
+
regex : "\\*\\/",
|
300
|
+
next : "pop"
|
301
|
+
}, {
|
302
|
+
defaultToken : "comment"
|
303
|
+
}],
|
304
|
+
|
305
|
+
"ruleset" : [
|
306
|
+
{
|
307
|
+
token : "paren.rparen",
|
308
|
+
regex : "\\}",
|
309
|
+
next: "pop"
|
310
|
+
}, {
|
311
|
+
token : "comment", // multi line comment
|
312
|
+
regex : "\\/\\*",
|
313
|
+
push : "comment"
|
314
|
+
}, {
|
315
|
+
token : "string", // single line
|
316
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
317
|
+
}, {
|
318
|
+
token : "string", // single line
|
319
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
320
|
+
}, {
|
321
|
+
token : ["constant.numeric", "keyword"],
|
322
|
+
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|%)"
|
323
|
+
}, {
|
324
|
+
token : "constant.numeric",
|
325
|
+
regex : numRe
|
326
|
+
}, {
|
327
|
+
token : "constant.numeric", // hex6 color
|
328
|
+
regex : "#[a-f0-9]{6}"
|
329
|
+
}, {
|
330
|
+
token : "constant.numeric", // hex3 color
|
331
|
+
regex : "#[a-f0-9]{3}"
|
332
|
+
}, {
|
333
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
|
334
|
+
regex : pseudoElements
|
335
|
+
}, {
|
336
|
+
token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
|
337
|
+
regex : pseudoClasses
|
338
|
+
}, {
|
339
|
+
token : ["support.function", "string", "support.function"],
|
340
|
+
regex : "(url\\()(.*)(\\))"
|
341
|
+
}, {
|
342
|
+
token : keywordMapper,
|
343
|
+
regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
|
344
|
+
}, {
|
345
|
+
caseInsensitive: true
|
346
|
+
}]
|
347
|
+
};
|
348
|
+
|
349
|
+
this.normalizeRules();
|
350
|
+
};
|
351
|
+
|
352
|
+
oop.inherits(CssHighlightRules, TextHighlightRules);
|
353
|
+
|
354
|
+
exports.CssHighlightRules = CssHighlightRules;
|
355
|
+
|
356
|
+
});
|
357
|
+
|
358
|
+
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) {
|
359
|
+
|
360
|
+
|
361
|
+
var oop = require("../lib/oop");
|
362
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
363
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
364
|
+
|
365
|
+
var JavaScriptHighlightRules = function() {
|
366
|
+
var keywordMapper = this.createKeywordMapper({
|
367
|
+
"variable.language":
|
368
|
+
"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
|
369
|
+
"Namespace|QName|XML|XMLList|" + // E4X
|
370
|
+
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
|
371
|
+
"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
|
372
|
+
"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
|
373
|
+
"SyntaxError|TypeError|URIError|" +
|
374
|
+
"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
|
375
|
+
"isNaN|parseFloat|parseInt|" +
|
376
|
+
"JSON|Math|" + // Other
|
377
|
+
"this|arguments|prototype|window|document" , // Pseudo
|
378
|
+
"keyword":
|
379
|
+
"const|yield|import|get|set|" +
|
380
|
+
"break|case|catch|continue|default|delete|do|else|finally|for|function|" +
|
381
|
+
"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
|
382
|
+
"__parent__|__count__|escape|unescape|with|__proto__|" +
|
383
|
+
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
|
384
|
+
"storage.type":
|
385
|
+
"const|let|var|function",
|
386
|
+
"constant.language":
|
387
|
+
"null|Infinity|NaN|undefined",
|
388
|
+
"support.function":
|
389
|
+
"alert",
|
390
|
+
"constant.language.boolean": "true|false"
|
391
|
+
}, "identifier");
|
392
|
+
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
|
393
|
+
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
394
|
+
|
395
|
+
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
|
396
|
+
"u[0-9a-fA-F]{4}|" + // unicode
|
397
|
+
"[0-2][0-7]{0,2}|" + // oct
|
398
|
+
"3[0-6][0-7]?|" + // oct
|
399
|
+
"37[0-7]?|" + // oct
|
400
|
+
"[4-7][0-7]?|" + //oct
|
401
|
+
".)";
|
402
|
+
|
403
|
+
this.$rules = {
|
404
|
+
"no_regex" : [
|
405
|
+
{
|
406
|
+
token : "comment",
|
407
|
+
regex : "\\/\\/",
|
408
|
+
next : "line_comment"
|
409
|
+
},
|
410
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
411
|
+
{
|
412
|
+
token : "comment", // multi line comment
|
413
|
+
regex : /\/\*/,
|
414
|
+
next : "comment"
|
415
|
+
}, {
|
416
|
+
token : "string",
|
417
|
+
regex : "'(?=.)",
|
418
|
+
next : "qstring"
|
419
|
+
}, {
|
420
|
+
token : "string",
|
421
|
+
regex : '"(?=.)',
|
422
|
+
next : "qqstring"
|
423
|
+
}, {
|
424
|
+
token : "constant.numeric", // hex
|
425
|
+
regex : /0[xX][0-9a-fA-F]+\b/
|
426
|
+
}, {
|
427
|
+
token : "constant.numeric", // float
|
428
|
+
regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
|
429
|
+
}, {
|
430
|
+
token : [
|
431
|
+
"storage.type", "punctuation.operator", "support.function",
|
432
|
+
"punctuation.operator", "entity.name.function", "text","keyword.operator"
|
433
|
+
],
|
434
|
+
regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
|
435
|
+
next: "function_arguments"
|
436
|
+
}, {
|
437
|
+
token : [
|
438
|
+
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
439
|
+
"keyword.operator", "text", "storage.type", "text", "paren.lparen"
|
440
|
+
],
|
441
|
+
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
442
|
+
next: "function_arguments"
|
443
|
+
}, {
|
444
|
+
token : [
|
445
|
+
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
|
446
|
+
"text", "paren.lparen"
|
447
|
+
],
|
448
|
+
regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
|
449
|
+
next: "function_arguments"
|
450
|
+
}, {
|
451
|
+
token : [
|
452
|
+
"storage.type", "punctuation.operator", "entity.name.function", "text",
|
453
|
+
"keyword.operator", "text",
|
454
|
+
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
455
|
+
],
|
456
|
+
regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
|
457
|
+
next: "function_arguments"
|
458
|
+
}, {
|
459
|
+
token : [
|
460
|
+
"storage.type", "text", "entity.name.function", "text", "paren.lparen"
|
461
|
+
],
|
462
|
+
regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
|
463
|
+
next: "function_arguments"
|
464
|
+
}, {
|
465
|
+
token : [
|
466
|
+
"entity.name.function", "text", "punctuation.operator",
|
467
|
+
"text", "storage.type", "text", "paren.lparen"
|
468
|
+
],
|
469
|
+
regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
|
470
|
+
next: "function_arguments"
|
471
|
+
}, {
|
472
|
+
token : [
|
473
|
+
"text", "text", "storage.type", "text", "paren.lparen"
|
474
|
+
],
|
475
|
+
regex : "(:)(\\s*)(function)(\\s*)(\\()",
|
476
|
+
next: "function_arguments"
|
477
|
+
}, {
|
478
|
+
token : "keyword",
|
479
|
+
regex : "(?:" + kwBeforeRe + ")\\b",
|
480
|
+
next : "start"
|
481
|
+
}, {
|
482
|
+
token : ["punctuation.operator", "support.function"],
|
483
|
+
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(?=\()/
|
484
|
+
}, {
|
485
|
+
token : ["punctuation.operator", "support.function.dom"],
|
486
|
+
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(?=\()/
|
487
|
+
}, {
|
488
|
+
token : ["punctuation.operator", "support.constant"],
|
489
|
+
regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
|
490
|
+
}, {
|
491
|
+
token : ["storage.type", "punctuation.operator", "support.function.firebug"],
|
492
|
+
regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
|
493
|
+
}, {
|
494
|
+
token : keywordMapper,
|
495
|
+
regex : identifierRe
|
496
|
+
}, {
|
497
|
+
token : "keyword.operator",
|
498
|
+
regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
|
499
|
+
next : "start"
|
500
|
+
}, {
|
501
|
+
token : "punctuation.operator",
|
502
|
+
regex : /\?|\:|\,|\;|\./,
|
503
|
+
next : "start"
|
504
|
+
}, {
|
505
|
+
token : "paren.lparen",
|
506
|
+
regex : /[\[({]/,
|
507
|
+
next : "start"
|
508
|
+
}, {
|
509
|
+
token : "paren.rparen",
|
510
|
+
regex : /[\])}]/
|
511
|
+
}, {
|
512
|
+
token : "keyword.operator",
|
513
|
+
regex : /\/=?/,
|
514
|
+
next : "start"
|
515
|
+
}, {
|
516
|
+
token: "comment",
|
517
|
+
regex: /^#!.*$/
|
518
|
+
}
|
519
|
+
],
|
520
|
+
"start": [
|
521
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
522
|
+
{
|
523
|
+
token : "comment", // multi line comment
|
524
|
+
regex : "\\/\\*",
|
525
|
+
next : "comment_regex_allowed"
|
526
|
+
}, {
|
527
|
+
token : "comment",
|
528
|
+
regex : "\\/\\/",
|
529
|
+
next : "line_comment_regex_allowed"
|
530
|
+
}, {
|
531
|
+
token: "string.regexp",
|
532
|
+
regex: "\\/",
|
533
|
+
next: "regex"
|
534
|
+
}, {
|
535
|
+
token : "text",
|
536
|
+
regex : "\\s+|^$",
|
537
|
+
next : "start"
|
538
|
+
}, {
|
539
|
+
token: "empty",
|
540
|
+
regex: "",
|
541
|
+
next: "no_regex"
|
542
|
+
}
|
543
|
+
],
|
544
|
+
"regex": [
|
545
|
+
{
|
546
|
+
token: "regexp.keyword.operator",
|
547
|
+
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
548
|
+
}, {
|
549
|
+
token: "string.regexp",
|
550
|
+
regex: "/[sxngimy]*",
|
551
|
+
next: "no_regex"
|
552
|
+
}, {
|
553
|
+
token : "invalid",
|
554
|
+
regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
|
555
|
+
}, {
|
556
|
+
token : "constant.language.escape",
|
557
|
+
regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
|
558
|
+
}, {
|
559
|
+
token : "constant.language.delimiter",
|
560
|
+
regex: /\|/
|
561
|
+
}, {
|
562
|
+
token: "constant.language.escape",
|
563
|
+
regex: /\[\^?/,
|
564
|
+
next: "regex_character_class"
|
565
|
+
}, {
|
566
|
+
token: "empty",
|
567
|
+
regex: "$",
|
568
|
+
next: "no_regex"
|
569
|
+
}, {
|
570
|
+
defaultToken: "string.regexp"
|
571
|
+
}
|
572
|
+
],
|
573
|
+
"regex_character_class": [
|
574
|
+
{
|
575
|
+
token: "regexp.keyword.operator",
|
576
|
+
regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
|
577
|
+
}, {
|
578
|
+
token: "constant.language.escape",
|
579
|
+
regex: "]",
|
580
|
+
next: "regex"
|
581
|
+
}, {
|
582
|
+
token: "constant.language.escape",
|
583
|
+
regex: "-"
|
584
|
+
}, {
|
585
|
+
token: "empty",
|
586
|
+
regex: "$",
|
587
|
+
next: "no_regex"
|
588
|
+
}, {
|
589
|
+
defaultToken: "string.regexp.charachterclass"
|
590
|
+
}
|
591
|
+
],
|
592
|
+
"function_arguments": [
|
593
|
+
{
|
594
|
+
token: "variable.parameter",
|
595
|
+
regex: identifierRe
|
596
|
+
}, {
|
597
|
+
token: "punctuation.operator",
|
598
|
+
regex: "[, ]+"
|
599
|
+
}, {
|
600
|
+
token: "punctuation.operator",
|
601
|
+
regex: "$"
|
602
|
+
}, {
|
603
|
+
token: "empty",
|
604
|
+
regex: "",
|
605
|
+
next: "no_regex"
|
606
|
+
}
|
607
|
+
],
|
608
|
+
"comment_regex_allowed" : [
|
609
|
+
{token : "comment", regex : "\\*\\/", next : "start"},
|
610
|
+
{defaultToken : "comment"}
|
611
|
+
],
|
612
|
+
"comment" : [
|
613
|
+
{token : "comment", regex : "\\*\\/", next : "no_regex"},
|
614
|
+
{defaultToken : "comment"}
|
615
|
+
],
|
616
|
+
"line_comment_regex_allowed" : [
|
617
|
+
{token : "comment", regex : "$|^", next : "start"},
|
618
|
+
{defaultToken : "comment"}
|
619
|
+
],
|
620
|
+
"line_comment" : [
|
621
|
+
{token : "comment", regex : "$|^", next : "no_regex"},
|
622
|
+
{defaultToken : "comment"}
|
623
|
+
],
|
624
|
+
"qqstring" : [
|
625
|
+
{
|
626
|
+
token : "constant.language.escape",
|
627
|
+
regex : escapedRe
|
628
|
+
}, {
|
629
|
+
token : "string",
|
630
|
+
regex : "\\\\$",
|
631
|
+
next : "qqstring"
|
632
|
+
}, {
|
633
|
+
token : "string",
|
634
|
+
regex : '"|$',
|
635
|
+
next : "no_regex"
|
636
|
+
}, {
|
637
|
+
defaultToken: "string"
|
638
|
+
}
|
639
|
+
],
|
640
|
+
"qstring" : [
|
641
|
+
{
|
642
|
+
token : "constant.language.escape",
|
643
|
+
regex : escapedRe
|
644
|
+
}, {
|
645
|
+
token : "string",
|
646
|
+
regex : "\\\\$",
|
647
|
+
next : "qstring"
|
648
|
+
}, {
|
649
|
+
token : "string",
|
650
|
+
regex : "'|$",
|
651
|
+
next : "no_regex"
|
652
|
+
}, {
|
653
|
+
defaultToken: "string"
|
654
|
+
}
|
655
|
+
]
|
656
|
+
};
|
657
|
+
|
658
|
+
this.embedRules(DocCommentHighlightRules, "doc-",
|
659
|
+
[ DocCommentHighlightRules.getEndRule("no_regex") ]);
|
660
|
+
};
|
661
|
+
|
662
|
+
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
|
663
|
+
|
664
|
+
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
|
665
|
+
});
|
666
|
+
|
667
|
+
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
668
|
+
|
669
|
+
|
670
|
+
var oop = require("../lib/oop");
|
671
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
672
|
+
|
673
|
+
var DocCommentHighlightRules = function() {
|
674
|
+
|
675
|
+
this.$rules = {
|
676
|
+
"start" : [ {
|
677
|
+
token : "comment.doc.tag",
|
678
|
+
regex : "@[\\w\\d_]+" // TODO: fix email addresses
|
679
|
+
}, {
|
680
|
+
token : "comment.doc.tag",
|
681
|
+
regex : "\\bTODO\\b"
|
682
|
+
}, {
|
683
|
+
defaultToken : "comment.doc"
|
684
|
+
}]
|
685
|
+
};
|
686
|
+
};
|
687
|
+
|
688
|
+
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
|
689
|
+
|
690
|
+
DocCommentHighlightRules.getStartRule = function(start) {
|
691
|
+
return {
|
692
|
+
token : "comment.doc", // doc comment
|
693
|
+
regex : "\\/\\*(?=\\*)",
|
694
|
+
next : start
|
695
|
+
};
|
696
|
+
};
|
697
|
+
|
698
|
+
DocCommentHighlightRules.getEndRule = function (start) {
|
699
|
+
return {
|
700
|
+
token : "comment.doc", // closing comment
|
701
|
+
regex : "\\*\\/",
|
702
|
+
next : start
|
703
|
+
};
|
704
|
+
};
|
705
|
+
|
706
|
+
|
707
|
+
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
708
|
+
|
709
|
+
});
|
710
|
+
|
711
|
+
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) {
|
712
|
+
|
713
|
+
|
714
|
+
var oop = require("../lib/oop");
|
715
|
+
var xmlUtil = require("./xml_util");
|
716
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
717
|
+
|
718
|
+
var XmlHighlightRules = function(normalize) {
|
719
|
+
this.$rules = {
|
720
|
+
start : [
|
721
|
+
{token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"},
|
722
|
+
{
|
723
|
+
token : ["punctuation.instruction.begin", "keyword.instruction"],
|
724
|
+
regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration"
|
725
|
+
},
|
726
|
+
{
|
727
|
+
token : ["punctuation.instruction.begin", "keyword.instruction"],
|
728
|
+
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction"
|
729
|
+
},
|
730
|
+
{token : "comment", regex : "<\\!--", next : "comment"},
|
731
|
+
{
|
732
|
+
token : ["punctuation.doctype.begin", "meta.tag.doctype"],
|
733
|
+
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype"
|
734
|
+
},
|
735
|
+
{include : "tag"},
|
736
|
+
{include : "reference"}
|
737
|
+
],
|
738
|
+
|
739
|
+
xml_declaration : [
|
740
|
+
{include : "attributes"},
|
741
|
+
{include : "instruction"}
|
742
|
+
],
|
743
|
+
|
744
|
+
instruction : [
|
745
|
+
{token : "punctuation.instruction.end", regex : "\\?>", next : "start"}
|
746
|
+
],
|
747
|
+
|
748
|
+
doctype : [
|
749
|
+
{include : "space"},
|
750
|
+
{include : "string"},
|
751
|
+
{token : "punctuation.doctype.end", regex : ">", next : "start"},
|
752
|
+
{token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"},
|
753
|
+
{token : "punctuation.begin", regex : "\\[", push : "declarations"}
|
754
|
+
],
|
755
|
+
|
756
|
+
declarations : [{
|
757
|
+
token : "text",
|
758
|
+
regex : "\\s+"
|
759
|
+
}, {
|
760
|
+
token: "punctuation.end",
|
761
|
+
regex: "]",
|
762
|
+
next: "pop"
|
763
|
+
}, {
|
764
|
+
token : ["punctuation.begin", "keyword"],
|
765
|
+
regex : "(<\\!)([-_a-zA-Z0-9]+)",
|
766
|
+
push : [{
|
767
|
+
token : "text",
|
768
|
+
regex : "\\s+"
|
769
|
+
},
|
770
|
+
{
|
771
|
+
token : "punctuation.end",
|
772
|
+
regex : ">",
|
773
|
+
next : "pop"
|
774
|
+
},
|
775
|
+
{include : "string"}]
|
776
|
+
}],
|
777
|
+
|
778
|
+
cdata : [
|
779
|
+
{token : "string.end", regex : "\\]\\]>", next : "start"},
|
780
|
+
{token : "text", regex : "\\s+"},
|
781
|
+
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"}
|
782
|
+
],
|
783
|
+
|
784
|
+
comment : [
|
785
|
+
{token : "comment", regex : "-->", next : "start"},
|
786
|
+
{defaultToken : "comment"}
|
787
|
+
],
|
788
|
+
|
789
|
+
tag : [{
|
790
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
|
791
|
+
regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
792
|
+
next: [
|
793
|
+
{include : "attributes"},
|
794
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
|
795
|
+
]
|
796
|
+
}, {
|
797
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
|
798
|
+
regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
|
799
|
+
next: [
|
800
|
+
{include : "space"},
|
801
|
+
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
|
802
|
+
]
|
803
|
+
}],
|
804
|
+
|
805
|
+
space : [
|
806
|
+
{token : "text", regex : "\\s+"}
|
807
|
+
],
|
808
|
+
|
809
|
+
reference : [{
|
810
|
+
token : "constant.language.escape",
|
811
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
812
|
+
}, {
|
813
|
+
token : "text", regex : "&"
|
814
|
+
}],
|
815
|
+
|
816
|
+
string: [{
|
817
|
+
token : "string",
|
818
|
+
regex : "'",
|
819
|
+
push : "qstring_inner"
|
820
|
+
}, {
|
821
|
+
token : "string",
|
822
|
+
regex : '"',
|
823
|
+
push : "qqstring_inner"
|
824
|
+
}],
|
825
|
+
|
826
|
+
qstring_inner: [
|
827
|
+
{token : "string", regex: "'", next: "pop"},
|
828
|
+
{include : "reference"},
|
829
|
+
{defaultToken : "string"}
|
830
|
+
],
|
831
|
+
|
832
|
+
qqstring_inner: [
|
833
|
+
{token : "string", regex: '"', next: "pop"},
|
834
|
+
{include : "reference"},
|
835
|
+
{defaultToken : "string"}
|
836
|
+
],
|
837
|
+
|
838
|
+
attributes: [{
|
839
|
+
token : "entity.other.attribute-name",
|
840
|
+
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
|
841
|
+
}, {
|
842
|
+
token : "keyword.operator.separator",
|
843
|
+
regex : "="
|
844
|
+
}, {
|
845
|
+
include : "space"
|
846
|
+
}, {
|
847
|
+
include : "string"
|
848
|
+
}]
|
849
|
+
};
|
850
|
+
|
851
|
+
if (this.constructor === XmlHighlightRules)
|
852
|
+
this.normalizeRules();
|
853
|
+
};
|
854
|
+
|
855
|
+
|
856
|
+
(function() {
|
857
|
+
|
858
|
+
this.embedTagRules = function(HighlightRules, prefix, tag){
|
859
|
+
this.$rules.tag.unshift({
|
860
|
+
token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
|
861
|
+
regex : "(<)(" + tag + ")",
|
862
|
+
next: [
|
863
|
+
{include : "space"},
|
864
|
+
{include : "attributes"},
|
865
|
+
{token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"}
|
866
|
+
]
|
867
|
+
});
|
868
|
+
|
869
|
+
this.$rules[tag + "-end"] = [
|
870
|
+
{include : "space"},
|
871
|
+
{token : "meta.tag.punctuation.end", regex : ">", next: "start",
|
872
|
+
onMatch : function(value, currentState, stack) {
|
873
|
+
stack.splice(0);
|
874
|
+
return this.token;
|
875
|
+
}}
|
876
|
+
]
|
877
|
+
|
878
|
+
this.embedRules(HighlightRules, prefix, [{
|
879
|
+
token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag],
|
880
|
+
regex : "(</)(" + tag + ")",
|
881
|
+
next: tag + "-end"
|
882
|
+
}, {
|
883
|
+
token: "string.begin",
|
884
|
+
regex : "<\\!\\[CDATA\\["
|
885
|
+
}, {
|
886
|
+
token: "string.end",
|
887
|
+
regex : "\\]\\]>"
|
888
|
+
}]);
|
889
|
+
};
|
890
|
+
|
891
|
+
}).call(TextHighlightRules.prototype);
|
892
|
+
|
893
|
+
oop.inherits(XmlHighlightRules, TextHighlightRules);
|
894
|
+
|
895
|
+
exports.XmlHighlightRules = XmlHighlightRules;
|
896
|
+
});
|
897
|
+
|
898
|
+
define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
|
899
|
+
|
900
|
+
|
901
|
+
function string(state) {
|
902
|
+
return [{
|
903
|
+
token : "string",
|
904
|
+
regex : '"',
|
905
|
+
next : state + "_qqstring"
|
906
|
+
}, {
|
907
|
+
token : "string",
|
908
|
+
regex : "'",
|
909
|
+
next : state + "_qstring"
|
910
|
+
}];
|
911
|
+
}
|
912
|
+
|
913
|
+
function multiLineString(quote, state) {
|
914
|
+
return [
|
915
|
+
{token : "string", regex : quote, next : state},
|
916
|
+
{
|
917
|
+
token : "constant.language.escape",
|
918
|
+
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
|
919
|
+
},
|
920
|
+
{defaultToken : "string"}
|
921
|
+
];
|
922
|
+
}
|
923
|
+
|
924
|
+
exports.tag = function(states, name, nextState, tagMap) {
|
925
|
+
states[name] = [{
|
926
|
+
token : "text",
|
927
|
+
regex : "\\s+"
|
928
|
+
}, {
|
929
|
+
|
930
|
+
token : !tagMap ? "meta.tag.tag-name" : function(value) {
|
931
|
+
if (tagMap[value])
|
932
|
+
return "meta.tag.tag-name." + tagMap[value];
|
933
|
+
else
|
934
|
+
return "meta.tag.tag-name";
|
935
|
+
},
|
936
|
+
regex : "[-_a-zA-Z0-9:]+",
|
937
|
+
next : name + "_embed_attribute_list"
|
938
|
+
}, {
|
939
|
+
token: "empty",
|
940
|
+
regex: "",
|
941
|
+
next : name + "_embed_attribute_list"
|
942
|
+
}];
|
943
|
+
|
944
|
+
states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
|
945
|
+
states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
|
946
|
+
|
947
|
+
states[name + "_embed_attribute_list"] = [{
|
948
|
+
token : "meta.tag.r",
|
949
|
+
regex : "/?>",
|
950
|
+
next : nextState
|
951
|
+
}, {
|
952
|
+
token : "keyword.operator",
|
953
|
+
regex : "="
|
954
|
+
}, {
|
955
|
+
token : "entity.other.attribute-name",
|
956
|
+
regex : "[-_a-zA-Z0-9:]+"
|
957
|
+
}, {
|
958
|
+
token : "constant.numeric", // float
|
959
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
960
|
+
}, {
|
961
|
+
token : "text",
|
962
|
+
regex : "\\s+"
|
963
|
+
}].concat(string(name));
|
964
|
+
};
|
965
|
+
|
966
|
+
});
|
967
|
+
define('ace/mode/java_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
968
|
+
|
969
|
+
|
970
|
+
var oop = require("../lib/oop");
|
971
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
972
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
973
|
+
|
974
|
+
var JavaHighlightRules = function() {
|
975
|
+
var keywords = (
|
976
|
+
"abstract|continue|for|new|switch|" +
|
977
|
+
"assert|default|goto|package|synchronized|" +
|
978
|
+
"boolean|do|if|private|this|" +
|
979
|
+
"break|double|implements|protected|throw|" +
|
980
|
+
"byte|else|import|public|throws|" +
|
981
|
+
"case|enum|instanceof|return|transient|" +
|
982
|
+
"catch|extends|int|short|try|" +
|
983
|
+
"char|final|interface|static|void|" +
|
984
|
+
"class|finally|long|strictfp|volatile|" +
|
985
|
+
"const|float|native|super|while"
|
986
|
+
);
|
987
|
+
|
988
|
+
var buildinConstants = ("null|Infinity|NaN|undefined");
|
989
|
+
|
990
|
+
|
991
|
+
var langClasses = (
|
992
|
+
"AbstractMethodError|AssertionError|ClassCircularityError|"+
|
993
|
+
"ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
|
994
|
+
"ExceptionInInitializerError|IllegalAccessError|"+
|
995
|
+
"IllegalThreadStateException|InstantiationError|InternalError|"+
|
996
|
+
"NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
|
997
|
+
"ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
|
998
|
+
"SuppressWarnings|TypeNotPresentException|UnknownError|"+
|
999
|
+
"UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
|
1000
|
+
"InstantiationException|IndexOutOfBoundsException|"+
|
1001
|
+
"ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
|
1002
|
+
"NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
|
1003
|
+
"SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
|
1004
|
+
"InterruptedException|NoSuchMethodException|IllegalAccessException|"+
|
1005
|
+
"UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
|
1006
|
+
"Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
|
1007
|
+
"NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
|
1008
|
+
"NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
|
1009
|
+
"Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
|
1010
|
+
"Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
|
1011
|
+
"StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
|
1012
|
+
"ArrayStoreException|ClassCastException|LinkageError|"+
|
1013
|
+
"NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
|
1014
|
+
"Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
|
1015
|
+
"Cloneable|Class|CharSequence|Comparable|String|Object"
|
1016
|
+
);
|
1017
|
+
|
1018
|
+
var keywordMapper = this.createKeywordMapper({
|
1019
|
+
"variable.language": "this",
|
1020
|
+
"keyword": keywords,
|
1021
|
+
"constant.language": buildinConstants,
|
1022
|
+
"support.function": langClasses
|
1023
|
+
}, "identifier");
|
1024
|
+
|
1025
|
+
this.$rules = {
|
1026
|
+
"start" : [
|
1027
|
+
{
|
1028
|
+
token : "comment",
|
1029
|
+
regex : "\\/\\/.*$"
|
1030
|
+
},
|
1031
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
1032
|
+
{
|
1033
|
+
token : "comment", // multi line comment
|
1034
|
+
regex : "\\/\\*",
|
1035
|
+
next : "comment"
|
1036
|
+
}, {
|
1037
|
+
token : "string.regexp",
|
1038
|
+
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
1039
|
+
}, {
|
1040
|
+
token : "string", // single line
|
1041
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
1042
|
+
}, {
|
1043
|
+
token : "string", // single line
|
1044
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
1045
|
+
}, {
|
1046
|
+
token : "constant.numeric", // hex
|
1047
|
+
regex : "0[xX][0-9a-fA-F]+\\b"
|
1048
|
+
}, {
|
1049
|
+
token : "constant.numeric", // float
|
1050
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
1051
|
+
}, {
|
1052
|
+
token : "constant.language.boolean",
|
1053
|
+
regex : "(?:true|false)\\b"
|
1054
|
+
}, {
|
1055
|
+
token : keywordMapper,
|
1056
|
+
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
1057
|
+
}, {
|
1058
|
+
token : "keyword.operator",
|
1059
|
+
regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
1060
|
+
}, {
|
1061
|
+
token : "lparen",
|
1062
|
+
regex : "[[({]"
|
1063
|
+
}, {
|
1064
|
+
token : "rparen",
|
1065
|
+
regex : "[\\])}]"
|
1066
|
+
}, {
|
1067
|
+
token : "text",
|
1068
|
+
regex : "\\s+"
|
1069
|
+
}
|
1070
|
+
],
|
1071
|
+
"comment" : [
|
1072
|
+
{
|
1073
|
+
token : "comment", // closing comment
|
1074
|
+
regex : ".*?\\*\\/",
|
1075
|
+
next : "start"
|
1076
|
+
}, {
|
1077
|
+
token : "comment", // comment spanning whole line
|
1078
|
+
regex : ".+"
|
1079
|
+
}
|
1080
|
+
]
|
1081
|
+
};
|
1082
|
+
|
1083
|
+
this.embedRules(DocCommentHighlightRules, "doc-",
|
1084
|
+
[ DocCommentHighlightRules.getEndRule("start") ]);
|
1085
|
+
};
|
1086
|
+
|
1087
|
+
oop.inherits(JavaHighlightRules, TextHighlightRules);
|
1088
|
+
|
1089
|
+
exports.JavaHighlightRules = JavaHighlightRules;
|
1090
|
+
});
|
1091
|
+
|
1092
|
+
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
1093
|
+
|
1094
|
+
|
1095
|
+
var Range = require("../range").Range;
|
1096
|
+
|
1097
|
+
var MatchingBraceOutdent = function() {};
|
1098
|
+
|
1099
|
+
(function() {
|
1100
|
+
|
1101
|
+
this.checkOutdent = function(line, input) {
|
1102
|
+
if (! /^\s+$/.test(line))
|
1103
|
+
return false;
|
1104
|
+
|
1105
|
+
return /^\s*\}/.test(input);
|
1106
|
+
};
|
1107
|
+
|
1108
|
+
this.autoOutdent = function(doc, row) {
|
1109
|
+
var line = doc.getLine(row);
|
1110
|
+
var match = line.match(/^(\s*\})/);
|
1111
|
+
|
1112
|
+
if (!match) return 0;
|
1113
|
+
|
1114
|
+
var column = match[1].length;
|
1115
|
+
var openBracePos = doc.findMatchingBracket({row: row, column: column});
|
1116
|
+
|
1117
|
+
if (!openBracePos || openBracePos.row == row) return 0;
|
1118
|
+
|
1119
|
+
var indent = this.$getIndent(doc.getLine(openBracePos.row));
|
1120
|
+
doc.replace(new Range(row, 0, row, column-1), indent);
|
1121
|
+
};
|
1122
|
+
|
1123
|
+
this.$getIndent = function(line) {
|
1124
|
+
return line.match(/^\s*/)[0];
|
1125
|
+
};
|
1126
|
+
|
1127
|
+
}).call(MatchingBraceOutdent.prototype);
|
1128
|
+
|
1129
|
+
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
1130
|
+
});
|
1131
|
+
|
1132
|
+
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/token_iterator', 'ace/lib/lang'], function(require, exports, module) {
|
1133
|
+
|
1134
|
+
|
1135
|
+
var oop = require("../../lib/oop");
|
1136
|
+
var Behaviour = require("../behaviour").Behaviour;
|
1137
|
+
var TokenIterator = require("../../token_iterator").TokenIterator;
|
1138
|
+
var lang = require("../../lib/lang");
|
1139
|
+
|
1140
|
+
var SAFE_INSERT_IN_TOKENS =
|
1141
|
+
["text", "paren.rparen", "punctuation.operator"];
|
1142
|
+
var SAFE_INSERT_BEFORE_TOKENS =
|
1143
|
+
["text", "paren.rparen", "punctuation.operator", "comment"];
|
1144
|
+
|
1145
|
+
|
1146
|
+
var autoInsertedBrackets = 0;
|
1147
|
+
var autoInsertedRow = -1;
|
1148
|
+
var autoInsertedLineEnd = "";
|
1149
|
+
var maybeInsertedBrackets = 0;
|
1150
|
+
var maybeInsertedRow = -1;
|
1151
|
+
var maybeInsertedLineStart = "";
|
1152
|
+
var maybeInsertedLineEnd = "";
|
1153
|
+
|
1154
|
+
var CstyleBehaviour = function () {
|
1155
|
+
|
1156
|
+
CstyleBehaviour.isSaneInsertion = function(editor, session) {
|
1157
|
+
var cursor = editor.getCursorPosition();
|
1158
|
+
var iterator = new TokenIterator(session, cursor.row, cursor.column);
|
1159
|
+
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
|
1160
|
+
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
|
1161
|
+
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
|
1162
|
+
return false;
|
1163
|
+
}
|
1164
|
+
iterator.stepForward();
|
1165
|
+
return iterator.getCurrentTokenRow() !== cursor.row ||
|
1166
|
+
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
|
1167
|
+
};
|
1168
|
+
|
1169
|
+
CstyleBehaviour.$matchTokenType = function(token, types) {
|
1170
|
+
return types.indexOf(token.type || token) > -1;
|
1171
|
+
};
|
1172
|
+
|
1173
|
+
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
|
1174
|
+
var cursor = editor.getCursorPosition();
|
1175
|
+
var line = session.doc.getLine(cursor.row);
|
1176
|
+
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
|
1177
|
+
autoInsertedBrackets = 0;
|
1178
|
+
autoInsertedRow = cursor.row;
|
1179
|
+
autoInsertedLineEnd = bracket + line.substr(cursor.column);
|
1180
|
+
autoInsertedBrackets++;
|
1181
|
+
};
|
1182
|
+
|
1183
|
+
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
|
1184
|
+
var cursor = editor.getCursorPosition();
|
1185
|
+
var line = session.doc.getLine(cursor.row);
|
1186
|
+
if (!this.isMaybeInsertedClosing(cursor, line))
|
1187
|
+
maybeInsertedBrackets = 0;
|
1188
|
+
maybeInsertedRow = cursor.row;
|
1189
|
+
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
|
1190
|
+
maybeInsertedLineEnd = line.substr(cursor.column);
|
1191
|
+
maybeInsertedBrackets++;
|
1192
|
+
};
|
1193
|
+
|
1194
|
+
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
|
1195
|
+
return autoInsertedBrackets > 0 &&
|
1196
|
+
cursor.row === autoInsertedRow &&
|
1197
|
+
bracket === autoInsertedLineEnd[0] &&
|
1198
|
+
line.substr(cursor.column) === autoInsertedLineEnd;
|
1199
|
+
};
|
1200
|
+
|
1201
|
+
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
|
1202
|
+
return maybeInsertedBrackets > 0 &&
|
1203
|
+
cursor.row === maybeInsertedRow &&
|
1204
|
+
line.substr(cursor.column) === maybeInsertedLineEnd &&
|
1205
|
+
line.substr(0, cursor.column) == maybeInsertedLineStart;
|
1206
|
+
};
|
1207
|
+
|
1208
|
+
CstyleBehaviour.popAutoInsertedClosing = function() {
|
1209
|
+
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
|
1210
|
+
autoInsertedBrackets--;
|
1211
|
+
};
|
1212
|
+
|
1213
|
+
CstyleBehaviour.clearMaybeInsertedClosing = function() {
|
1214
|
+
maybeInsertedBrackets = 0;
|
1215
|
+
maybeInsertedRow = -1;
|
1216
|
+
};
|
1217
|
+
|
1218
|
+
this.add("braces", "insertion", function (state, action, editor, session, text) {
|
1219
|
+
var cursor = editor.getCursorPosition();
|
1220
|
+
var line = session.doc.getLine(cursor.row);
|
1221
|
+
if (text == '{') {
|
1222
|
+
var selection = editor.getSelectionRange();
|
1223
|
+
var selected = session.doc.getTextRange(selection);
|
1224
|
+
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
|
1225
|
+
return {
|
1226
|
+
text: '{' + selected + '}',
|
1227
|
+
selection: false
|
1228
|
+
};
|
1229
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
1230
|
+
if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
|
1231
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "}");
|
1232
|
+
return {
|
1233
|
+
text: '{}',
|
1234
|
+
selection: [1, 1]
|
1235
|
+
};
|
1236
|
+
} else {
|
1237
|
+
CstyleBehaviour.recordMaybeInsert(editor, session, "{");
|
1238
|
+
return {
|
1239
|
+
text: '{',
|
1240
|
+
selection: [1, 1]
|
1241
|
+
};
|
1242
|
+
}
|
1243
|
+
}
|
1244
|
+
} else if (text == '}') {
|
1245
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1246
|
+
if (rightChar == '}') {
|
1247
|
+
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
|
1248
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
1249
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
1250
|
+
return {
|
1251
|
+
text: '',
|
1252
|
+
selection: [1, 1]
|
1253
|
+
};
|
1254
|
+
}
|
1255
|
+
}
|
1256
|
+
} else if (text == "\n" || text == "\r\n") {
|
1257
|
+
var closing = "";
|
1258
|
+
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
|
1259
|
+
closing = lang.stringRepeat("}", maybeInsertedBrackets);
|
1260
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
1261
|
+
}
|
1262
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1263
|
+
if (rightChar === '}') {
|
1264
|
+
var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
|
1265
|
+
if (!openBracePos)
|
1266
|
+
return null;
|
1267
|
+
var next_indent = this.$getIndent(session.getLine(openBracePos.row));
|
1268
|
+
} else if (closing) {
|
1269
|
+
var next_indent = this.$getIndent(line);
|
1270
|
+
} else {
|
1271
|
+
return;
|
1272
|
+
}
|
1273
|
+
var indent = next_indent + session.getTabString();
|
1274
|
+
|
1275
|
+
return {
|
1276
|
+
text: '\n' + indent + '\n' + next_indent + closing,
|
1277
|
+
selection: [1, indent.length, 1, indent.length]
|
1278
|
+
};
|
1279
|
+
} else {
|
1280
|
+
CstyleBehaviour.clearMaybeInsertedClosing();
|
1281
|
+
}
|
1282
|
+
});
|
1283
|
+
|
1284
|
+
this.add("braces", "deletion", function (state, action, editor, session, range) {
|
1285
|
+
var selected = session.doc.getTextRange(range);
|
1286
|
+
if (!range.isMultiLine() && selected == '{') {
|
1287
|
+
var line = session.doc.getLine(range.start.row);
|
1288
|
+
var rightChar = line.substring(range.end.column, range.end.column + 1);
|
1289
|
+
if (rightChar == '}') {
|
1290
|
+
range.end.column++;
|
1291
|
+
return range;
|
1292
|
+
} else {
|
1293
|
+
maybeInsertedBrackets--;
|
1294
|
+
}
|
1295
|
+
}
|
1296
|
+
});
|
1297
|
+
|
1298
|
+
this.add("parens", "insertion", function (state, action, editor, session, text) {
|
1299
|
+
if (text == '(') {
|
1300
|
+
var selection = editor.getSelectionRange();
|
1301
|
+
var selected = session.doc.getTextRange(selection);
|
1302
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
1303
|
+
return {
|
1304
|
+
text: '(' + selected + ')',
|
1305
|
+
selection: false
|
1306
|
+
};
|
1307
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
1308
|
+
CstyleBehaviour.recordAutoInsert(editor, session, ")");
|
1309
|
+
return {
|
1310
|
+
text: '()',
|
1311
|
+
selection: [1, 1]
|
1312
|
+
};
|
1313
|
+
}
|
1314
|
+
} else if (text == ')') {
|
1315
|
+
var cursor = editor.getCursorPosition();
|
1316
|
+
var line = session.doc.getLine(cursor.row);
|
1317
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1318
|
+
if (rightChar == ')') {
|
1319
|
+
var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
|
1320
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
1321
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
1322
|
+
return {
|
1323
|
+
text: '',
|
1324
|
+
selection: [1, 1]
|
1325
|
+
};
|
1326
|
+
}
|
1327
|
+
}
|
1328
|
+
}
|
1329
|
+
});
|
1330
|
+
|
1331
|
+
this.add("parens", "deletion", function (state, action, editor, session, range) {
|
1332
|
+
var selected = session.doc.getTextRange(range);
|
1333
|
+
if (!range.isMultiLine() && selected == '(') {
|
1334
|
+
var line = session.doc.getLine(range.start.row);
|
1335
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
1336
|
+
if (rightChar == ')') {
|
1337
|
+
range.end.column++;
|
1338
|
+
return range;
|
1339
|
+
}
|
1340
|
+
}
|
1341
|
+
});
|
1342
|
+
|
1343
|
+
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
1344
|
+
if (text == '[') {
|
1345
|
+
var selection = editor.getSelectionRange();
|
1346
|
+
var selected = session.doc.getTextRange(selection);
|
1347
|
+
if (selected !== "" && editor.getWrapBehavioursEnabled()) {
|
1348
|
+
return {
|
1349
|
+
text: '[' + selected + ']',
|
1350
|
+
selection: false
|
1351
|
+
};
|
1352
|
+
} else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
|
1353
|
+
CstyleBehaviour.recordAutoInsert(editor, session, "]");
|
1354
|
+
return {
|
1355
|
+
text: '[]',
|
1356
|
+
selection: [1, 1]
|
1357
|
+
};
|
1358
|
+
}
|
1359
|
+
} else if (text == ']') {
|
1360
|
+
var cursor = editor.getCursorPosition();
|
1361
|
+
var line = session.doc.getLine(cursor.row);
|
1362
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1363
|
+
if (rightChar == ']') {
|
1364
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
1365
|
+
if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
|
1366
|
+
CstyleBehaviour.popAutoInsertedClosing();
|
1367
|
+
return {
|
1368
|
+
text: '',
|
1369
|
+
selection: [1, 1]
|
1370
|
+
};
|
1371
|
+
}
|
1372
|
+
}
|
1373
|
+
}
|
1374
|
+
});
|
1375
|
+
|
1376
|
+
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
1377
|
+
var selected = session.doc.getTextRange(range);
|
1378
|
+
if (!range.isMultiLine() && selected == '[') {
|
1379
|
+
var line = session.doc.getLine(range.start.row);
|
1380
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
1381
|
+
if (rightChar == ']') {
|
1382
|
+
range.end.column++;
|
1383
|
+
return range;
|
1384
|
+
}
|
1385
|
+
}
|
1386
|
+
});
|
1387
|
+
|
1388
|
+
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
1389
|
+
if (text == '"' || text == "'") {
|
1390
|
+
var quote = text;
|
1391
|
+
var selection = editor.getSelectionRange();
|
1392
|
+
var selected = session.doc.getTextRange(selection);
|
1393
|
+
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
|
1394
|
+
return {
|
1395
|
+
text: quote + selected + quote,
|
1396
|
+
selection: false
|
1397
|
+
};
|
1398
|
+
} else {
|
1399
|
+
var cursor = editor.getCursorPosition();
|
1400
|
+
var line = session.doc.getLine(cursor.row);
|
1401
|
+
var leftChar = line.substring(cursor.column-1, cursor.column);
|
1402
|
+
if (leftChar == '\\') {
|
1403
|
+
return null;
|
1404
|
+
}
|
1405
|
+
var tokens = session.getTokens(selection.start.row);
|
1406
|
+
var col = 0, token;
|
1407
|
+
var quotepos = -1; // Track whether we're inside an open quote.
|
1408
|
+
|
1409
|
+
for (var x = 0; x < tokens.length; x++) {
|
1410
|
+
token = tokens[x];
|
1411
|
+
if (token.type == "string") {
|
1412
|
+
quotepos = -1;
|
1413
|
+
} else if (quotepos < 0) {
|
1414
|
+
quotepos = token.value.indexOf(quote);
|
1415
|
+
}
|
1416
|
+
if ((token.value.length + col) > selection.start.column) {
|
1417
|
+
break;
|
1418
|
+
}
|
1419
|
+
col += tokens[x].value.length;
|
1420
|
+
}
|
1421
|
+
if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
|
1422
|
+
if (!CstyleBehaviour.isSaneInsertion(editor, session))
|
1423
|
+
return;
|
1424
|
+
return {
|
1425
|
+
text: quote + quote,
|
1426
|
+
selection: [1,1]
|
1427
|
+
};
|
1428
|
+
} else if (token && token.type === "string") {
|
1429
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
1430
|
+
if (rightChar == quote) {
|
1431
|
+
return {
|
1432
|
+
text: '',
|
1433
|
+
selection: [1, 1]
|
1434
|
+
};
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
}
|
1438
|
+
}
|
1439
|
+
});
|
1440
|
+
|
1441
|
+
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
|
1442
|
+
var selected = session.doc.getTextRange(range);
|
1443
|
+
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
|
1444
|
+
var line = session.doc.getLine(range.start.row);
|
1445
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
1446
|
+
if (rightChar == selected) {
|
1447
|
+
range.end.column++;
|
1448
|
+
return range;
|
1449
|
+
}
|
1450
|
+
}
|
1451
|
+
});
|
1452
|
+
|
1453
|
+
};
|
1454
|
+
|
1455
|
+
oop.inherits(CstyleBehaviour, Behaviour);
|
1456
|
+
|
1457
|
+
exports.CstyleBehaviour = CstyleBehaviour;
|
1458
|
+
});
|
1459
|
+
|
1460
|
+
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
1461
|
+
|
1462
|
+
|
1463
|
+
var oop = require("../../lib/oop");
|
1464
|
+
var Range = require("../../range").Range;
|
1465
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
1466
|
+
|
1467
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
1468
|
+
if (commentRegex) {
|
1469
|
+
this.foldingStartMarker = new RegExp(
|
1470
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
1471
|
+
);
|
1472
|
+
this.foldingStopMarker = new RegExp(
|
1473
|
+
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
1474
|
+
);
|
1475
|
+
}
|
1476
|
+
};
|
1477
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
1478
|
+
|
1479
|
+
(function() {
|
1480
|
+
|
1481
|
+
this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
|
1482
|
+
this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
|
1483
|
+
|
1484
|
+
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
1485
|
+
var line = session.getLine(row);
|
1486
|
+
var match = line.match(this.foldingStartMarker);
|
1487
|
+
if (match) {
|
1488
|
+
var i = match.index;
|
1489
|
+
|
1490
|
+
if (match[1])
|
1491
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
1492
|
+
|
1493
|
+
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
1494
|
+
|
1495
|
+
if (range && !range.isMultiLine()) {
|
1496
|
+
if (forceMultiline) {
|
1497
|
+
range = this.getSectionRange(session, row);
|
1498
|
+
} else if (foldStyle != "all")
|
1499
|
+
range = null;
|
1500
|
+
}
|
1501
|
+
|
1502
|
+
return range;
|
1503
|
+
}
|
1504
|
+
|
1505
|
+
if (foldStyle === "markbegin")
|
1506
|
+
return;
|
1507
|
+
|
1508
|
+
var match = line.match(this.foldingStopMarker);
|
1509
|
+
if (match) {
|
1510
|
+
var i = match.index + match[0].length;
|
1511
|
+
|
1512
|
+
if (match[1])
|
1513
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
1514
|
+
|
1515
|
+
return session.getCommentFoldRange(row, i, -1);
|
1516
|
+
}
|
1517
|
+
};
|
1518
|
+
|
1519
|
+
this.getSectionRange = function(session, row) {
|
1520
|
+
var line = session.getLine(row);
|
1521
|
+
var startIndent = line.search(/\S/);
|
1522
|
+
var startRow = row;
|
1523
|
+
var startColumn = line.length;
|
1524
|
+
row = row + 1;
|
1525
|
+
var endRow = row;
|
1526
|
+
var maxRow = session.getLength();
|
1527
|
+
while (++row < maxRow) {
|
1528
|
+
line = session.getLine(row);
|
1529
|
+
var indent = line.search(/\S/);
|
1530
|
+
if (indent === -1)
|
1531
|
+
continue;
|
1532
|
+
if (startIndent > indent)
|
1533
|
+
break;
|
1534
|
+
var subRange = this.getFoldWidgetRange(session, "all", row);
|
1535
|
+
|
1536
|
+
if (subRange) {
|
1537
|
+
if (subRange.start.row <= startRow) {
|
1538
|
+
break;
|
1539
|
+
} else if (subRange.isMultiLine()) {
|
1540
|
+
row = subRange.end.row;
|
1541
|
+
} else if (startIndent == indent) {
|
1542
|
+
break;
|
1543
|
+
}
|
1544
|
+
}
|
1545
|
+
endRow = row;
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
1549
|
+
};
|
1550
|
+
|
1551
|
+
}).call(FoldMode.prototype);
|
1552
|
+
|
1553
|
+
});
|