ace-rails-ap 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,7 +38,7 @@ var TextileHighlightRules = require("./textile_highlight_rules").TextileHighligh
|
|
45
38
|
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
46
39
|
|
47
40
|
var Mode = function() {
|
48
|
-
this
|
41
|
+
this.HighlightRules = TextileHighlightRules;
|
49
42
|
this.$outdent = new MatchingBraceOutdent();
|
50
43
|
};
|
51
44
|
oop.inherits(Mode, TextMode);
|
@@ -66,6 +59,7 @@ oop.inherits(Mode, TextMode);
|
|
66
59
|
this.$outdent.autoOutdent(doc, row);
|
67
60
|
};
|
68
61
|
|
62
|
+
this.$id = "ace/mode/textile";
|
69
63
|
}).call(Mode.prototype);
|
70
64
|
|
71
65
|
exports.Mode = Mode;
|
@@ -83,7 +77,7 @@ var TextileHighlightRules = function() {
|
|
83
77
|
"start" : [
|
84
78
|
{
|
85
79
|
token : function(value) {
|
86
|
-
if (value.
|
80
|
+
if (value.charAt(0) == "h")
|
87
81
|
return "markup.heading." + value.charAt(1);
|
88
82
|
else
|
89
83
|
return "markup.heading";
|
@@ -168,12 +162,7 @@ var MatchingBraceOutdent = function() {};
|
|
168
162
|
};
|
169
163
|
|
170
164
|
this.$getIndent = function(line) {
|
171
|
-
|
172
|
-
if (match) {
|
173
|
-
return match[1];
|
174
|
-
}
|
175
|
-
|
176
|
-
return "";
|
165
|
+
return line.match(/^\s*/)[0];
|
177
166
|
};
|
178
167
|
|
179
168
|
}).call(MatchingBraceOutdent.prototype);
|
@@ -0,0 +1,200 @@
|
|
1
|
+
define('ace/mode/tmsnippet', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/text_highlight_rules', 'ace/mode/folding/coffee'], function(require, exports, module) {
|
2
|
+
|
3
|
+
|
4
|
+
var oop = require("../lib/oop");
|
5
|
+
var TextMode = require("./text").Mode;
|
6
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
7
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
8
|
+
|
9
|
+
var SnippetHighlightRules = function() {
|
10
|
+
|
11
|
+
var builtins = "SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|" +
|
12
|
+
"LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME";
|
13
|
+
|
14
|
+
this.$rules = {
|
15
|
+
"start" : [
|
16
|
+
{token:"constant.language.escape", regex: /\\[\$}`\\]/},
|
17
|
+
{token:"keyword", regex: "\\$(?:TM_)?(?:" + builtins + ")\\b"},
|
18
|
+
{token:"variable", regex: "\\$\\w+"},
|
19
|
+
{onMatch: function(value, state, stack) {
|
20
|
+
if (stack[1])
|
21
|
+
stack[1]++;
|
22
|
+
else
|
23
|
+
stack.unshift(state, 1);
|
24
|
+
return this.tokenName;
|
25
|
+
}, tokenName: "markup.list", regex: "\\${", next: "varDecl"},
|
26
|
+
{onMatch: function(value, state, stack) {
|
27
|
+
if (!stack[1])
|
28
|
+
return "text";
|
29
|
+
stack[1]--;
|
30
|
+
if (!stack[1])
|
31
|
+
stack.splice(0,2);
|
32
|
+
return this.tokenName;
|
33
|
+
}, tokenName: "markup.list", regex: "}"},
|
34
|
+
{token: "doc.comment", regex:/^\${2}-{5,}$/}
|
35
|
+
],
|
36
|
+
"varDecl" : [
|
37
|
+
{regex: /\d+\b/, token: "constant.numeric"},
|
38
|
+
{token:"keyword", regex: "(?:TM_)?(?:" + builtins + ")\\b"},
|
39
|
+
{token:"variable", regex: "\\w+"},
|
40
|
+
{regex: /:/, token: "punctuation.operator", next: "start"},
|
41
|
+
{regex: /\//, token: "string.regex", next: "regexp"},
|
42
|
+
{regex: "", next: "start"}
|
43
|
+
],
|
44
|
+
"regexp" : [
|
45
|
+
{regex: /\\./, token: "escape"},
|
46
|
+
{regex: /\[/, token: "regex.start", next: "charClass"},
|
47
|
+
{regex: "/", token: "string.regex", next: "format"},
|
48
|
+
{"token": "string.regex", regex:"."}
|
49
|
+
],
|
50
|
+
charClass : [
|
51
|
+
{regex: "\\.", token: "escape"},
|
52
|
+
{regex: "\\]", token: "regex.end", next: "regexp"},
|
53
|
+
{"token": "string.regex", regex:"."}
|
54
|
+
],
|
55
|
+
"format" : [
|
56
|
+
{regex: /\\[ulULE]/, token: "keyword"},
|
57
|
+
{regex: /\$\d+/, token: "variable"},
|
58
|
+
{regex: "/[gim]*:?", token: "string.regex", next: "start"},
|
59
|
+
{"token": "string", regex:"."}
|
60
|
+
]
|
61
|
+
};
|
62
|
+
};
|
63
|
+
oop.inherits(SnippetHighlightRules, TextHighlightRules);
|
64
|
+
|
65
|
+
exports.SnippetHighlightRules = SnippetHighlightRules;
|
66
|
+
|
67
|
+
var SnippetGroupHighlightRules = function() {
|
68
|
+
this.$rules = {
|
69
|
+
"start" : [
|
70
|
+
{token: "text", regex: "^\\t", next: "sn-start"},
|
71
|
+
{token:"invalid", regex: /^ \s*/},
|
72
|
+
{token:"comment", regex: /^#.*/},
|
73
|
+
{token:"constant.language.escape", regex: "^regex ", next: "regex"},
|
74
|
+
{token:"constant.language.escape", regex: "^(trigger|endTrigger|name|snippet|guard|endGuard|tabTrigger|key)\\b"}
|
75
|
+
],
|
76
|
+
"regex" : [
|
77
|
+
{token:"text", regex: "\\."},
|
78
|
+
{token:"keyword", regex: "/"},
|
79
|
+
{token:"empty", regex: "$", next: "start"}
|
80
|
+
]
|
81
|
+
};
|
82
|
+
this.embedRules(SnippetHighlightRules, "sn-", [
|
83
|
+
{token: "text", regex: "^\\t", next: "sn-start"},
|
84
|
+
{onMatch: function(value, state, stack) {
|
85
|
+
stack.splice(stack.length);
|
86
|
+
return this.tokenName;
|
87
|
+
}, tokenName: "text", regex: "^(?!\t)", next: "start"},
|
88
|
+
])
|
89
|
+
|
90
|
+
};
|
91
|
+
|
92
|
+
oop.inherits(SnippetGroupHighlightRules, TextHighlightRules);
|
93
|
+
|
94
|
+
exports.SnippetGroupHighlightRules = SnippetGroupHighlightRules;
|
95
|
+
|
96
|
+
var FoldMode = require("./folding/coffee").FoldMode;
|
97
|
+
|
98
|
+
var Mode = function() {
|
99
|
+
var highlighter = new SnippetGroupHighlightRules();
|
100
|
+
this.foldingRules = new FoldMode();
|
101
|
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
102
|
+
};
|
103
|
+
oop.inherits(Mode, TextMode);
|
104
|
+
|
105
|
+
(function() {
|
106
|
+
this.getNextLineIndent = function(state, line, tab) {
|
107
|
+
return this.$getIndent(line);
|
108
|
+
};
|
109
|
+
}).call(Mode.prototype);
|
110
|
+
exports.Mode = Mode;
|
111
|
+
|
112
|
+
|
113
|
+
});
|
114
|
+
|
115
|
+
define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) {
|
116
|
+
|
117
|
+
|
118
|
+
var oop = require("../../lib/oop");
|
119
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
120
|
+
var Range = require("../../range").Range;
|
121
|
+
|
122
|
+
var FoldMode = exports.FoldMode = function() {};
|
123
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
124
|
+
|
125
|
+
(function() {
|
126
|
+
|
127
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
128
|
+
var range = this.indentationBlock(session, row);
|
129
|
+
if (range)
|
130
|
+
return range;
|
131
|
+
|
132
|
+
var re = /\S/;
|
133
|
+
var line = session.getLine(row);
|
134
|
+
var startLevel = line.search(re);
|
135
|
+
if (startLevel == -1 || line[startLevel] != "#")
|
136
|
+
return;
|
137
|
+
|
138
|
+
var startColumn = line.length;
|
139
|
+
var maxRow = session.getLength();
|
140
|
+
var startRow = row;
|
141
|
+
var endRow = row;
|
142
|
+
|
143
|
+
while (++row < maxRow) {
|
144
|
+
line = session.getLine(row);
|
145
|
+
var level = line.search(re);
|
146
|
+
|
147
|
+
if (level == -1)
|
148
|
+
continue;
|
149
|
+
|
150
|
+
if (line[level] != "#")
|
151
|
+
break;
|
152
|
+
|
153
|
+
endRow = row;
|
154
|
+
}
|
155
|
+
|
156
|
+
if (endRow > startRow) {
|
157
|
+
var endColumn = session.getLine(endRow).length;
|
158
|
+
return new Range(startRow, startColumn, endRow, endColumn);
|
159
|
+
}
|
160
|
+
};
|
161
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
162
|
+
var line = session.getLine(row);
|
163
|
+
var indent = line.search(/\S/);
|
164
|
+
var next = session.getLine(row + 1);
|
165
|
+
var prev = session.getLine(row - 1);
|
166
|
+
var prevIndent = prev.search(/\S/);
|
167
|
+
var nextIndent = next.search(/\S/);
|
168
|
+
|
169
|
+
if (indent == -1) {
|
170
|
+
session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
|
171
|
+
return "";
|
172
|
+
}
|
173
|
+
if (prevIndent == -1) {
|
174
|
+
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
|
175
|
+
session.foldWidgets[row - 1] = "";
|
176
|
+
session.foldWidgets[row + 1] = "";
|
177
|
+
return "start";
|
178
|
+
}
|
179
|
+
} else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
|
180
|
+
if (session.getLine(row - 2).search(/\S/) == -1) {
|
181
|
+
session.foldWidgets[row - 1] = "start";
|
182
|
+
session.foldWidgets[row + 1] = "";
|
183
|
+
return "";
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
if (prevIndent!= -1 && prevIndent < indent)
|
188
|
+
session.foldWidgets[row - 1] = "start";
|
189
|
+
else
|
190
|
+
session.foldWidgets[row - 1] = "";
|
191
|
+
|
192
|
+
if (indent < nextIndent)
|
193
|
+
return "start";
|
194
|
+
else
|
195
|
+
return "";
|
196
|
+
};
|
197
|
+
|
198
|
+
}).call(FoldMode.prototype);
|
199
|
+
|
200
|
+
});
|
@@ -0,0 +1,177 @@
|
|
1
|
+
/* ***** BEGIN LICENSE BLOCK *****
|
2
|
+
* Distributed under the BSD license:
|
3
|
+
*
|
4
|
+
* Copyright (c) 2013, 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
|
+
*
|
30
|
+
* Contributor(s):
|
31
|
+
*
|
32
|
+
* Garen J. Torikian
|
33
|
+
*
|
34
|
+
* ***** END LICENSE BLOCK ***** */
|
35
|
+
|
36
|
+
define('ace/mode/toml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/toml_highlight_rules', 'ace/mode/folding/ini'], function(require, exports, module) {
|
37
|
+
|
38
|
+
|
39
|
+
var oop = require("../lib/oop");
|
40
|
+
var TextMode = require("./text").Mode;
|
41
|
+
var Tokenizer = require("../tokenizer").Tokenizer;
|
42
|
+
var TomlHighlightRules = require("./toml_highlight_rules").TomlHighlightRules;
|
43
|
+
var FoldMode = require("./folding/ini").FoldMode;
|
44
|
+
|
45
|
+
var Mode = function() {
|
46
|
+
this.HighlightRules = TomlHighlightRules;
|
47
|
+
this.foldingRules = new FoldMode();
|
48
|
+
};
|
49
|
+
oop.inherits(Mode, TextMode);
|
50
|
+
|
51
|
+
(function() {
|
52
|
+
this.lineCommentStart = "#";
|
53
|
+
this.$id = "ace/mode/toml";
|
54
|
+
}).call(Mode.prototype);
|
55
|
+
|
56
|
+
exports.Mode = Mode;
|
57
|
+
});
|
58
|
+
|
59
|
+
define('ace/mode/toml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
60
|
+
|
61
|
+
|
62
|
+
var oop = require("../lib/oop");
|
63
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
64
|
+
|
65
|
+
var TomlHighlightRules = function() {
|
66
|
+
var keywordMapper = this.createKeywordMapper({
|
67
|
+
"constant.language.boolean": "true|false"
|
68
|
+
}, "identifier");
|
69
|
+
|
70
|
+
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
|
71
|
+
|
72
|
+
this.$rules = {
|
73
|
+
"start": [
|
74
|
+
{
|
75
|
+
token: "comment.toml",
|
76
|
+
regex: /#.*$/
|
77
|
+
},
|
78
|
+
{
|
79
|
+
token : "string",
|
80
|
+
regex : '"(?=.)',
|
81
|
+
next : "qqstring"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
token: ["variable.keygroup.toml"],
|
85
|
+
regex: "(?:^\\s*)(\\[([^\\]]+)\\])"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
token : keywordMapper,
|
89
|
+
regex : identifierRe
|
90
|
+
},
|
91
|
+
{
|
92
|
+
token : "support.date.toml",
|
93
|
+
regex: "\\d{4}-\\d{2}-\\d{2}(T)\\d{2}:\\d{2}:\\d{2}(Z)"
|
94
|
+
},
|
95
|
+
{
|
96
|
+
token: "constant.numeric.toml",
|
97
|
+
regex: "-?\\d+(\\.?\\d+)?"
|
98
|
+
}
|
99
|
+
],
|
100
|
+
"qqstring" : [
|
101
|
+
{
|
102
|
+
token : "string",
|
103
|
+
regex : "\\\\$",
|
104
|
+
next : "qqstring"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
token : "constant.language.escape",
|
108
|
+
regex : '\\\\[0tnr"\\\\]'
|
109
|
+
},
|
110
|
+
{
|
111
|
+
token : "string",
|
112
|
+
regex : '"|$',
|
113
|
+
next : "start"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
defaultToken: "string"
|
117
|
+
}
|
118
|
+
]
|
119
|
+
}
|
120
|
+
|
121
|
+
};
|
122
|
+
|
123
|
+
oop.inherits(TomlHighlightRules, TextHighlightRules);
|
124
|
+
|
125
|
+
exports.TomlHighlightRules = TomlHighlightRules;
|
126
|
+
});
|
127
|
+
|
128
|
+
define('ace/mode/folding/ini', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
129
|
+
|
130
|
+
|
131
|
+
var oop = require("../../lib/oop");
|
132
|
+
var Range = require("../../range").Range;
|
133
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
134
|
+
|
135
|
+
var FoldMode = exports.FoldMode = function() {
|
136
|
+
};
|
137
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
138
|
+
|
139
|
+
(function() {
|
140
|
+
|
141
|
+
this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/;
|
142
|
+
|
143
|
+
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
144
|
+
var re = this.foldingStartMarker;
|
145
|
+
var line = session.getLine(row);
|
146
|
+
|
147
|
+
var m = line.match(re);
|
148
|
+
|
149
|
+
if (!m) return;
|
150
|
+
|
151
|
+
var startName = m[1] + ".";
|
152
|
+
|
153
|
+
var startColumn = line.length;
|
154
|
+
var maxRow = session.getLength();
|
155
|
+
var startRow = row;
|
156
|
+
var endRow = row;
|
157
|
+
|
158
|
+
while (++row < maxRow) {
|
159
|
+
line = session.getLine(row);
|
160
|
+
if (/^\s*$/.test(line))
|
161
|
+
continue;
|
162
|
+
m = line.match(re);
|
163
|
+
if (m && m[1].lastIndexOf(startName, 0) !== 0)
|
164
|
+
break;
|
165
|
+
|
166
|
+
endRow = row;
|
167
|
+
}
|
168
|
+
|
169
|
+
if (endRow > startRow) {
|
170
|
+
var endColumn = session.getLine(endRow).length;
|
171
|
+
return new Range(startRow, startColumn, endRow, endColumn);
|
172
|
+
}
|
173
|
+
};
|
174
|
+
|
175
|
+
}).call(FoldMode.prototype);
|
176
|
+
|
177
|
+
});
|