codemirror-rails 3.24 → 4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +3001 -1798
- data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +24 -4
- data/vendor/assets/javascripts/codemirror/addons/comment/continuecomment.js +47 -32
- data/vendor/assets/javascripts/codemirror/addons/dialog/dialog.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/display/fullscreen.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/display/placeholder.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +76 -37
- data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +59 -37
- data/vendor/assets/javascripts/codemirror/addons/edit/continuelist.js +25 -17
- data/vendor/assets/javascripts/codemirror/addons/edit/matchbrackets.js +67 -46
- data/vendor/assets/javascripts/codemirror/addons/edit/matchtags.js +10 -3
- data/vendor/assets/javascripts/codemirror/addons/edit/trailingspace.js +23 -14
- data/vendor/assets/javascripts/codemirror/addons/fold/brace-fold.js +12 -3
- data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +12 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/foldcode.js +28 -3
- data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/fold/indent-fold.js +12 -1
- data/vendor/assets/javascripts/codemirror/addons/fold/markdown-fold.js +12 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +9 -4
- data/vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/hint/css-hint.js +10 -3
- data/vendor/assets/javascripts/codemirror/addons/hint/html-hint.js +11 -3
- data/vendor/assets/javascripts/codemirror/addons/hint/javascript-hint.js +9 -4
- data/vendor/assets/javascripts/codemirror/addons/hint/python-hint.js +11 -3
- data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +10 -4
- data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/hint/xml-hint.js +22 -34
- data/vendor/assets/javascripts/codemirror/addons/lint/coffeescript-lint.js +12 -1
- data/vendor/assets/javascripts/codemirror/addons/lint/css-lint.js +12 -1
- data/vendor/assets/javascripts/codemirror/addons/lint/javascript-lint.js +9 -4
- data/vendor/assets/javascripts/codemirror/addons/lint/json-lint.js +12 -1
- data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +12 -8
- data/vendor/assets/javascripts/codemirror/addons/lint/yaml-lint.js +12 -1
- data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +18 -16
- data/vendor/assets/javascripts/codemirror/addons/mode/loadmode.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +12 -0
- data/vendor/assets/javascripts/codemirror/addons/mode/overlay.js +15 -10
- data/vendor/assets/javascripts/codemirror/addons/runmode/colorize.js +11 -3
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode-standalone.js +0 -2
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.js +12 -0
- data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +4 -0
- data/vendor/assets/javascripts/codemirror/addons/scroll/scrollpastend.js +9 -2
- data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +12 -3
- data/vendor/assets/javascripts/codemirror/addons/search/search.js +24 -16
- data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +21 -2
- data/vendor/assets/javascripts/codemirror/addons/selection/active-line.js +38 -17
- data/vendor/assets/javascripts/codemirror/addons/selection/mark-selection.js +16 -9
- data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +33 -5
- data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +27 -2
- data/vendor/assets/javascripts/codemirror/keymaps/emacs.js +12 -5
- data/vendor/assets/javascripts/codemirror/keymaps/sublime.js +505 -0
- data/vendor/assets/javascripts/codemirror/keymaps/vim.js +138 -179
- data/vendor/assets/javascripts/codemirror/modes/apl.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/asterisk.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/clike.js +15 -4
- data/vendor/assets/javascripts/codemirror/modes/clojure.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/cobol.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/commonlisp.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/css.js +18 -27
- data/vendor/assets/javascripts/codemirror/modes/d.js +12 -2
- data/vendor/assets/javascripts/codemirror/modes/diff.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/dtd.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/ecl.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/eiffel.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/erlang.js +13 -1
- data/vendor/assets/javascripts/codemirror/modes/fortran.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/gas.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/gfm.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/gherkin.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/go.js +12 -1
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/haml.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/haskell.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/haxe.js +18 -9
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/http.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/jade.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +23 -16
- data/vendor/assets/javascripts/codemirror/modes/jinja2.js +53 -118
- data/vendor/assets/javascripts/codemirror/modes/julia.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/livescript.js +17 -4
- data/vendor/assets/javascripts/codemirror/modes/lua.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/mirc.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/mllike.js +12 -1
- data/vendor/assets/javascripts/codemirror/modes/nginx.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/ntriples.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/octave.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/pascal.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/pegjs.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/perl.js +84 -73
- data/vendor/assets/javascripts/codemirror/modes/php.js +20 -101
- data/vendor/assets/javascripts/codemirror/modes/pig.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/properties.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/puppet.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/python.js +21 -11
- data/vendor/assets/javascripts/codemirror/modes/q.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/r.js +13 -3
- data/vendor/assets/javascripts/codemirror/modes/{rpm-spec.js → rpm.js} +34 -2
- data/vendor/assets/javascripts/codemirror/modes/rst.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/ruby.js +11 -0
- data/vendor/assets/javascripts/codemirror/modes/rust.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/sass.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/scheme.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/shell.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/sieve.js +11 -4
- data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/smarty.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/smartymixed.js +14 -2
- data/vendor/assets/javascripts/codemirror/modes/solr.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/sparql.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/sql.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/stex.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/tcl.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/tiki.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/toml.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/turtle.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/vb.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/vbscript.js +13 -0
- data/vendor/assets/javascripts/codemirror/modes/velocity.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/verilog.js +89 -236
- data/vendor/assets/javascripts/codemirror/modes/xml.js +41 -60
- data/vendor/assets/javascripts/codemirror/modes/xquery.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/yaml.js +12 -0
- data/vendor/assets/javascripts/codemirror/modes/z80.js +12 -0
- data/vendor/assets/stylesheets/codemirror.css +15 -10
- data/vendor/assets/stylesheets/codemirror/themes/ambiance.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/lesser-dark.css +4 -0
- data/vendor/assets/stylesheets/codemirror/themes/mdn-like.css +1 -1
- data/vendor/assets/stylesheets/codemirror/themes/pastel-on-dark.css +1 -0
- data/vendor/assets/stylesheets/codemirror/themes/rubyblue.css +2 -0
- data/vendor/assets/stylesheets/codemirror/themes/solarized.css +17 -3
- metadata +20 -25
- data/vendor/assets/javascripts/codemirror/keymaps/extra.js +0 -43
- data/vendor/assets/javascripts/codemirror/modes/django.js +0 -55
- data/vendor/assets/javascripts/codemirror/modes/dylan.js +0 -284
- data/vendor/assets/javascripts/codemirror/modes/less.js +0 -347
- data/vendor/assets/javascripts/codemirror/modes/rpm-changes.js +0 -19
- data/vendor/assets/stylesheets/codemirror/modes/rpm-spec.css +0 -5
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("fortran", function() {
|
2
12
|
function words(array) {
|
3
13
|
var keys = {};
|
@@ -171,3 +181,5 @@ CodeMirror.defineMode("fortran", function() {
|
|
171
181
|
});
|
172
182
|
|
173
183
|
CodeMirror.defineMIME("text/x-fortran", "fortran");
|
184
|
+
|
185
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("gas", function(_config, parserConfig) {
|
2
12
|
'use strict';
|
3
13
|
|
@@ -328,3 +338,5 @@ CodeMirror.defineMode("gas", function(_config, parserConfig) {
|
|
328
338
|
blockCommentEnd: "*/"
|
329
339
|
};
|
330
340
|
});
|
341
|
+
|
342
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
2
12
|
var codeDepth = 0;
|
3
13
|
function blankLine(state) {
|
@@ -100,3 +110,5 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
|
100
110
|
CodeMirror.defineMIME("gfmBase", markdownConfig);
|
101
111
|
return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay);
|
102
112
|
}, "markdown");
|
113
|
+
|
114
|
+
});
|
@@ -13,6 +13,16 @@ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues
|
|
13
13
|
// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
|
14
14
|
//};
|
15
15
|
|
16
|
+
(function(mod) {
|
17
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
18
|
+
mod(require("../../lib/codemirror"));
|
19
|
+
else if (typeof define == "function" && define.amd) // AMD
|
20
|
+
define(["../../lib/codemirror"], mod);
|
21
|
+
else // Plain browser env
|
22
|
+
mod(CodeMirror);
|
23
|
+
})(function(CodeMirror) {
|
24
|
+
"use strict";
|
25
|
+
|
16
26
|
CodeMirror.defineMode("gherkin", function () {
|
17
27
|
return {
|
18
28
|
startState: function () {
|
@@ -161,3 +171,5 @@ CodeMirror.defineMode("gherkin", function () {
|
|
161
171
|
});
|
162
172
|
|
163
173
|
CodeMirror.defineMIME("text/x-feature", "gherkin");
|
174
|
+
|
175
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("go", function(config) {
|
2
12
|
var indentUnit = config.indentUnit;
|
3
13
|
|
@@ -159,7 +169,6 @@ CodeMirror.defineMode("go", function(config) {
|
|
159
169
|
},
|
160
170
|
|
161
171
|
electricChars: "{}):",
|
162
|
-
fold: "brace",
|
163
172
|
blockCommentStart: "/*",
|
164
173
|
blockCommentEnd: "*/",
|
165
174
|
lineComment: "//"
|
@@ -167,3 +176,5 @@ CodeMirror.defineMode("go", function(config) {
|
|
167
176
|
});
|
168
177
|
|
169
178
|
CodeMirror.defineMIME("text/x-go", "go");
|
179
|
+
|
180
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("groovy", function(config) {
|
2
12
|
function words(str) {
|
3
13
|
var obj = {}, words = str.split(" ");
|
@@ -209,3 +219,5 @@ CodeMirror.defineMode("groovy", function(config) {
|
|
209
219
|
});
|
210
220
|
|
211
221
|
CodeMirror.defineMIME("text/x-groovy", "groovy");
|
222
|
+
|
223
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
(function() {
|
2
12
|
"use strict";
|
3
13
|
|
@@ -147,3 +157,5 @@
|
|
147
157
|
|
148
158
|
CodeMirror.defineMIME("text/x-haml", "haml");
|
149
159
|
})();
|
160
|
+
|
161
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("haskell", function(_config, modeConfig) {
|
2
12
|
|
3
13
|
function switchState(source, setState, f) {
|
@@ -250,3 +260,5 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) {
|
|
250
260
|
});
|
251
261
|
|
252
262
|
CodeMirror.defineMIME("text/x-haskell", "haskell");
|
263
|
+
|
264
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
2
12
|
var indentUnit = config.indentUnit;
|
3
13
|
|
@@ -16,7 +26,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
|
16
26
|
"function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
|
17
27
|
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
18
28
|
"in": operator, "never": kw("property_access"), "trace":kw("trace"),
|
19
|
-
"class": type, "
|
29
|
+
"class": type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
|
20
30
|
"true": atom, "false": atom, "null": atom
|
21
31
|
};
|
22
32
|
}();
|
@@ -235,11 +245,12 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
|
235
245
|
poplex.lex = true;
|
236
246
|
|
237
247
|
function expect(wanted) {
|
238
|
-
|
248
|
+
function f(type) {
|
239
249
|
if (type == wanted) return cont();
|
240
250
|
else if (wanted == ";") return pass();
|
241
|
-
else return cont(
|
251
|
+
else return cont(f);
|
242
252
|
};
|
253
|
+
return f;
|
243
254
|
}
|
244
255
|
|
245
256
|
function statement(type) {
|
@@ -305,13 +316,12 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
|
305
316
|
|
306
317
|
function importdef (type, value) {
|
307
318
|
if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
|
308
|
-
else if(type == "variable" || type == "property" || type == "."
|
319
|
+
else if(type == "variable" || type == "property" || type == ".") return cont(importdef);
|
309
320
|
}
|
310
321
|
|
311
322
|
function typedef (type, value)
|
312
323
|
{
|
313
324
|
if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
|
314
|
-
else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
|
315
325
|
}
|
316
326
|
|
317
327
|
function maybelabel(type) {
|
@@ -423,11 +433,10 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
|
423
433
|
else return lexical.indented + (closing ? 0 : indentUnit);
|
424
434
|
},
|
425
435
|
|
426
|
-
electricChars: "{}"
|
427
|
-
blockCommentStart: "/*",
|
428
|
-
blockCommentEnd: "*/",
|
429
|
-
lineComment: "//"
|
436
|
+
electricChars: "{}"
|
430
437
|
};
|
431
438
|
});
|
432
439
|
|
433
440
|
CodeMirror.defineMIME("text/x-haxe", "haxe");
|
441
|
+
|
442
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
|
2
12
|
|
3
13
|
//config settings
|
@@ -69,3 +79,5 @@ CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingMode
|
|
69
79
|
CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"});
|
70
80
|
CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"});
|
71
81
|
CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"});
|
82
|
+
|
83
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
2
12
|
var htmlMode = CodeMirror.getMode(config, {name: "xml",
|
3
13
|
htmlMode: true,
|
@@ -103,3 +113,5 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
|
|
103
113
|
}, "xml", "javascript", "css");
|
104
114
|
|
105
115
|
CodeMirror.defineMIME("text/html", "htmlmixed");
|
116
|
+
|
117
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("http", function() {
|
2
12
|
function failFirstLine(stream, state) {
|
3
13
|
stream.skipToEnd();
|
@@ -96,3 +106,5 @@ CodeMirror.defineMode("http", function() {
|
|
96
106
|
});
|
97
107
|
|
98
108
|
CodeMirror.defineMIME("message/http", "http");
|
109
|
+
|
110
|
+
});
|
@@ -1,3 +1,13 @@
|
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
10
|
+
|
1
11
|
CodeMirror.defineMode("jade", function () {
|
2
12
|
var symbol_regex1 = /^(?:~|!|%|\^|\*|\+|=|\\|:|;|,|\/|\?|&|<|>|\|)/;
|
3
13
|
var open_paren_regex = /^(\(|\[)/;
|
@@ -88,3 +98,5 @@ CodeMirror.defineMode("jade", function () {
|
|
88
98
|
});
|
89
99
|
|
90
100
|
CodeMirror.defineMIME('text/x-jade', 'jade');
|
101
|
+
|
102
|
+
});
|
@@ -1,5 +1,15 @@
|
|
1
1
|
// TODO actually recognize syntax of TypeScript constructs
|
2
2
|
|
3
|
+
(function(mod) {
|
4
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
5
|
+
mod(require("../../lib/codemirror"));
|
6
|
+
else if (typeof define == "function" && define.amd) // AMD
|
7
|
+
define(["../../lib/codemirror"], mod);
|
8
|
+
else // Plain browser env
|
9
|
+
mod(CodeMirror);
|
10
|
+
})(function(CodeMirror) {
|
11
|
+
"use strict";
|
12
|
+
|
3
13
|
CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
4
14
|
var indentUnit = config.indentUnit;
|
5
15
|
var statementIndent = parserConfig.statementIndent;
|
@@ -301,11 +311,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
301
311
|
poplex.lex = true;
|
302
312
|
|
303
313
|
function expect(wanted) {
|
304
|
-
|
314
|
+
function exp(type) {
|
305
315
|
if (type == wanted) return cont();
|
306
316
|
else if (wanted == ";") return pass();
|
307
|
-
else return cont(
|
317
|
+
else return cont(exp);
|
308
318
|
};
|
319
|
+
return exp;
|
309
320
|
}
|
310
321
|
|
311
322
|
function statement(type, value) {
|
@@ -314,11 +325,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
314
325
|
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
315
326
|
if (type == "{") return cont(pushlex("}"), block, poplex);
|
316
327
|
if (type == ";") return cont();
|
317
|
-
if (type == "if")
|
318
|
-
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
|
319
|
-
cx.state.cc.pop()();
|
320
|
-
return cont(pushlex("form"), expression, statement, poplex, maybeelse);
|
321
|
-
}
|
328
|
+
if (type == "if") return cont(pushlex("form"), expression, statement, poplex, maybeelse);
|
322
329
|
if (type == "function") return cont(functiondef);
|
323
330
|
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
|
324
331
|
if (type == "variable") return cont(pushlex("stat"), maybelabel);
|
@@ -349,13 +356,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
349
356
|
|
350
357
|
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
|
351
358
|
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
|
352
|
-
if (type == "function") return cont(functiondef
|
359
|
+
if (type == "function") return cont(functiondef);
|
353
360
|
if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
|
354
361
|
if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);
|
355
362
|
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
|
356
363
|
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
|
357
364
|
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
|
358
|
-
if (type == "quasi") { return pass(quasi, maybeop); }
|
359
365
|
return cont();
|
360
366
|
}
|
361
367
|
function maybeexpression(type) {
|
@@ -380,22 +386,21 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
380
386
|
if (value == "?") return cont(expression, expect(":"), expr);
|
381
387
|
return cont(expr);
|
382
388
|
}
|
383
|
-
if (type == "quasi") { return
|
389
|
+
if (type == "quasi") { cx.cc.push(me); return quasi(value); }
|
384
390
|
if (type == ";") return;
|
385
391
|
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
|
386
392
|
if (type == ".") return cont(property, me);
|
387
393
|
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
|
388
394
|
}
|
389
|
-
function quasi(
|
390
|
-
if (
|
391
|
-
if (value.slice(value.length - 2) != "${") return cont(quasi);
|
395
|
+
function quasi(value) {
|
396
|
+
if (value.slice(value.length - 2) != "${") return cont();
|
392
397
|
return cont(expression, continueQuasi);
|
393
398
|
}
|
394
399
|
function continueQuasi(type) {
|
395
400
|
if (type == "}") {
|
396
401
|
cx.marked = "string-2";
|
397
402
|
cx.state.tokenize = tokenQuasi;
|
398
|
-
return cont(
|
403
|
+
return cont();
|
399
404
|
}
|
400
405
|
}
|
401
406
|
function arrowBody(type) {
|
@@ -488,7 +493,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
488
493
|
if (type == ",") return cont(vardef);
|
489
494
|
}
|
490
495
|
function maybeelse(type, value) {
|
491
|
-
if (type == "keyword b" && value == "else") return cont(pushlex("form"
|
496
|
+
if (type == "keyword b" && value == "else") return cont(pushlex("form"), statement, poplex);
|
492
497
|
}
|
493
498
|
function forspec(type) {
|
494
499
|
if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
|
@@ -601,7 +606,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
601
606
|
if (state.tokenize != tokenBase) return 0;
|
602
607
|
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
|
603
608
|
// Kludge to prevent 'maybelse' from blocking lexical scope pops
|
604
|
-
|
609
|
+
for (var i = state.cc.length - 1; i >= 0; --i) {
|
605
610
|
var c = state.cc[i];
|
606
611
|
if (c == poplex) lexical = lexical.prev;
|
607
612
|
else if (c != maybeelse) break;
|
@@ -643,3 +648,5 @@ CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
|
|
643
648
|
CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
|
644
649
|
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
|
645
650
|
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
|
651
|
+
|
652
|
+
});
|
@@ -1,128 +1,63 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
"openbrace", "closebrace", "opencomment",
|
11
|
-
"closecomment", "widthratio", "url", "with", "endwith",
|
12
|
-
"get_current_language", "trans", "endtrans", "noop", "blocktrans",
|
13
|
-
"endblocktrans", "get_available_languages",
|
14
|
-
"get_current_language_bidi", "plural"],
|
15
|
-
operator = /^[+\-*&%=<>!?|~^]/,
|
16
|
-
sign = /^[:\[\(\{]/,
|
17
|
-
atom = ["true", "false"],
|
18
|
-
number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
|
1
|
+
(function(mod) {
|
2
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
3
|
+
mod(require("../../lib/codemirror"));
|
4
|
+
else if (typeof define == "function" && define.amd) // AMD
|
5
|
+
define(["../../lib/codemirror"], mod);
|
6
|
+
else // Plain browser env
|
7
|
+
mod(CodeMirror);
|
8
|
+
})(function(CodeMirror) {
|
9
|
+
"use strict";
|
19
10
|
|
20
|
-
|
21
|
-
|
11
|
+
CodeMirror.defineMode("jinja2", function() {
|
12
|
+
var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif",
|
13
|
+
"extends", "filter", "endfilter", "firstof", "for",
|
14
|
+
"endfor", "if", "endif", "ifchanged", "endifchanged",
|
15
|
+
"ifequal", "endifequal", "ifnotequal",
|
16
|
+
"endifnotequal", "in", "include", "load", "not", "now", "or",
|
17
|
+
"parsed", "regroup", "reversed", "spaceless",
|
18
|
+
"endspaceless", "ssi", "templatetag", "openblock",
|
19
|
+
"closeblock", "openvariable", "closevariable",
|
20
|
+
"openbrace", "closebrace", "opencomment",
|
21
|
+
"closecomment", "widthratio", "url", "with", "endwith",
|
22
|
+
"get_current_language", "trans", "noop", "blocktrans",
|
23
|
+
"endblocktrans", "get_available_languages",
|
24
|
+
"get_current_language_bidi", "plural"];
|
25
|
+
keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b");
|
22
26
|
|
23
27
|
function tokenBase (stream, state) {
|
24
|
-
var ch = stream.
|
25
|
-
|
26
|
-
|
27
|
-
if (state.incomment) {
|
28
|
-
if(!stream.skipTo("#}")) {
|
29
|
-
stream.skipToEnd();
|
30
|
-
} else {
|
31
|
-
stream.eatWhile(/\#|}/);
|
32
|
-
state.incomment = false;
|
33
|
-
}
|
34
|
-
return "comment";
|
35
|
-
//Tag
|
36
|
-
} else if (state.intag) {
|
37
|
-
//After operator
|
38
|
-
if(state.operator) {
|
39
|
-
state.operator = false;
|
40
|
-
if(stream.match(atom)) {
|
41
|
-
return "atom";
|
42
|
-
}
|
43
|
-
if(stream.match(number)) {
|
44
|
-
return "number";
|
45
|
-
}
|
46
|
-
}
|
47
|
-
//After sign
|
48
|
-
if(state.sign) {
|
49
|
-
state.sign = false;
|
50
|
-
if(stream.match(atom)) {
|
51
|
-
return "atom";
|
52
|
-
}
|
53
|
-
if(stream.match(number)) {
|
54
|
-
return "number";
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
if(state.instring) {
|
59
|
-
if(ch == state.instring) {
|
60
|
-
state.instring = false;
|
61
|
-
}
|
62
|
-
stream.next();
|
63
|
-
return "string";
|
64
|
-
} else if(ch == "'" || ch == '"') {
|
65
|
-
state.instring = ch;
|
66
|
-
stream.next();
|
67
|
-
return "string";
|
68
|
-
} else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
|
69
|
-
state.intag = false;
|
70
|
-
return "tag";
|
71
|
-
} else if(stream.match(operator)) {
|
72
|
-
state.operator = true;
|
73
|
-
return "operator";
|
74
|
-
} else if(stream.match(sign)) {
|
75
|
-
state.sign = true;
|
76
|
-
} else {
|
77
|
-
if(stream.eat(" ") || stream.sol()) {
|
78
|
-
if(stream.match(keywords)) {
|
79
|
-
return "keyword";
|
80
|
-
}
|
81
|
-
if(stream.match(atom)) {
|
82
|
-
return "atom";
|
83
|
-
}
|
84
|
-
if(stream.match(number)) {
|
85
|
-
return "number";
|
86
|
-
}
|
87
|
-
if(stream.sol()) {
|
88
|
-
stream.next();
|
89
|
-
}
|
90
|
-
} else {
|
91
|
-
stream.next();
|
92
|
-
}
|
93
|
-
|
94
|
-
}
|
95
|
-
return "variable";
|
96
|
-
} else if (stream.eat("{")) {
|
97
|
-
if (ch = stream.eat("#")) {
|
98
|
-
state.incomment = true;
|
99
|
-
if(!stream.skipTo("#}")) {
|
100
|
-
stream.skipToEnd();
|
101
|
-
} else {
|
102
|
-
stream.eatWhile(/\#|}/);
|
103
|
-
state.incomment = false;
|
104
|
-
}
|
105
|
-
return "comment";
|
106
|
-
//Open tag
|
107
|
-
} else if (ch = stream.eat(/\{|%/)) {
|
108
|
-
//Cache close tag
|
109
|
-
state.intag = ch;
|
110
|
-
if(ch == "{") {
|
111
|
-
state.intag = "}";
|
112
|
-
}
|
28
|
+
var ch = stream.next();
|
29
|
+
if (ch == "{") {
|
30
|
+
if (ch = stream.eat(/\{|%|#/)) {
|
113
31
|
stream.eat("-");
|
32
|
+
state.tokenize = inTag(ch);
|
114
33
|
return "tag";
|
115
34
|
}
|
116
35
|
}
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
36
|
+
}
|
37
|
+
function inTag (close) {
|
38
|
+
if (close == "{") {
|
39
|
+
close = "}";
|
40
|
+
}
|
41
|
+
return function (stream, state) {
|
42
|
+
var ch = stream.next();
|
43
|
+
if ((ch == close || (ch == "-" && stream.eat(close)))
|
44
|
+
&& stream.eat("}")) {
|
45
|
+
state.tokenize = tokenBase;
|
46
|
+
return "tag";
|
47
|
+
}
|
48
|
+
if (stream.match(keywords)) {
|
49
|
+
return "keyword";
|
126
50
|
}
|
51
|
+
return close == "#" ? "comment" : "string";
|
52
|
+
};
|
53
|
+
}
|
54
|
+
return {
|
55
|
+
startState: function () {
|
56
|
+
return {tokenize: tokenBase};
|
57
|
+
},
|
58
|
+
token: function (stream, state) {
|
59
|
+
return state.tokenize(stream, state);
|
60
|
+
}
|
127
61
|
};
|
62
|
+
});
|
128
63
|
});
|