ll-plus 2.10.24 → 2.10.25
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.
- package/package.json +1 -1
- package/theme-chalk/code-editor-vue3/addon/comment/comment.js +211 -0
- package/theme-chalk/code-editor-vue3/addon/comment/continuecomment.js +114 -0
- package/theme-chalk/code-editor-vue3/addon/dialog/dialog.css +32 -0
- package/theme-chalk/code-editor-vue3/addon/dialog/dialog.js +163 -0
- package/theme-chalk/code-editor-vue3/addon/display/autorefresh.js +47 -0
- package/theme-chalk/code-editor-vue3/addon/display/fullscreen.css +6 -0
- package/theme-chalk/code-editor-vue3/addon/display/fullscreen.js +41 -0
- package/theme-chalk/code-editor-vue3/addon/display/panel.js +133 -0
- package/theme-chalk/code-editor-vue3/addon/display/placeholder.js +78 -0
- package/theme-chalk/code-editor-vue3/addon/display/rulers.js +51 -0
- package/theme-chalk/code-editor-vue3/addon/edit/closebrackets.js +201 -0
- package/theme-chalk/code-editor-vue3/addon/edit/closetag.js +185 -0
- package/theme-chalk/code-editor-vue3/addon/edit/continuelist.js +101 -0
- package/theme-chalk/code-editor-vue3/addon/edit/matchbrackets.js +160 -0
- package/theme-chalk/code-editor-vue3/addon/edit/matchtags.js +66 -0
- package/theme-chalk/code-editor-vue3/addon/edit/trailingspace.js +27 -0
- package/theme-chalk/code-editor-vue3/addon/fold/brace-fold.js +119 -0
- package/theme-chalk/code-editor-vue3/addon/fold/comment-fold.js +59 -0
- package/theme-chalk/code-editor-vue3/addon/fold/foldcode.js +159 -0
- package/theme-chalk/code-editor-vue3/addon/fold/foldgutter.css +20 -0
- package/theme-chalk/code-editor-vue3/addon/fold/foldgutter.js +169 -0
- package/theme-chalk/code-editor-vue3/addon/fold/indent-fold.js +48 -0
- package/theme-chalk/code-editor-vue3/addon/fold/markdown-fold.js +49 -0
- package/theme-chalk/code-editor-vue3/addon/fold/xml-fold.js +184 -0
- package/theme-chalk/code-editor-vue3/addon/hint/anyword-hint.js +41 -0
- package/theme-chalk/code-editor-vue3/addon/hint/css-hint.js +66 -0
- package/theme-chalk/code-editor-vue3/addon/hint/html-hint.js +351 -0
- package/theme-chalk/code-editor-vue3/addon/hint/javascript-hint.js +162 -0
- package/theme-chalk/code-editor-vue3/addon/hint/show-hint.css +37 -0
- package/theme-chalk/code-editor-vue3/addon/hint/show-hint.js +523 -0
- package/theme-chalk/code-editor-vue3/addon/hint/sql-hint.js +304 -0
- package/theme-chalk/code-editor-vue3/addon/hint/xml-hint.js +132 -0
- package/theme-chalk/code-editor-vue3/addon/lint/coffeescript-lint.js +47 -0
- package/theme-chalk/code-editor-vue3/addon/lint/css-lint.js +40 -0
- package/theme-chalk/code-editor-vue3/addon/lint/html-lint.js +59 -0
- package/theme-chalk/code-editor-vue3/addon/lint/javascript-lint.js +65 -0
- package/theme-chalk/code-editor-vue3/addon/lint/json-lint.js +40 -0
- package/theme-chalk/code-editor-vue3/addon/lint/lint.css +79 -0
- package/theme-chalk/code-editor-vue3/addon/lint/lint.js +288 -0
- package/theme-chalk/code-editor-vue3/addon/lint/yaml-lint.js +41 -0
- package/theme-chalk/code-editor-vue3/addon/merge/merge.css +119 -0
- package/theme-chalk/code-editor-vue3/addon/merge/merge.js +1018 -0
- package/theme-chalk/code-editor-vue3/addon/mode/loadmode.js +66 -0
- package/theme-chalk/code-editor-vue3/addon/mode/multiplex.js +136 -0
- package/theme-chalk/code-editor-vue3/addon/mode/multiplex_test.js +49 -0
- package/theme-chalk/code-editor-vue3/addon/mode/overlay.js +90 -0
- package/theme-chalk/code-editor-vue3/addon/mode/simple.js +216 -0
- package/theme-chalk/code-editor-vue3/addon/runmode/colorize.js +40 -0
- package/theme-chalk/code-editor-vue3/addon/runmode/runmode-standalone.js +334 -0
- package/theme-chalk/code-editor-vue3/addon/runmode/runmode.js +76 -0
- package/theme-chalk/code-editor-vue3/addon/runmode/runmode.node.js +329 -0
- package/theme-chalk/code-editor-vue3/addon/scroll/annotatescrollbar.js +128 -0
- package/theme-chalk/code-editor-vue3/addon/scroll/scrollpastend.js +48 -0
- package/theme-chalk/code-editor-vue3/addon/scroll/simplescrollbars.css +66 -0
- package/theme-chalk/code-editor-vue3/addon/scroll/simplescrollbars.js +152 -0
- package/theme-chalk/code-editor-vue3/addon/search/jump-to-line.js +53 -0
- package/theme-chalk/code-editor-vue3/addon/search/match-highlighter.js +167 -0
- package/theme-chalk/code-editor-vue3/addon/search/matchesonscrollbar.css +8 -0
- package/theme-chalk/code-editor-vue3/addon/search/matchesonscrollbar.js +97 -0
- package/theme-chalk/code-editor-vue3/addon/search/search.js +295 -0
- package/theme-chalk/code-editor-vue3/addon/search/searchcursor.js +305 -0
- package/theme-chalk/code-editor-vue3/addon/selection/active-line.js +72 -0
- package/theme-chalk/code-editor-vue3/addon/selection/mark-selection.js +119 -0
- package/theme-chalk/code-editor-vue3/addon/selection/selection-pointer.js +98 -0
- package/theme-chalk/code-editor-vue3/addon/tern/tern.css +87 -0
- package/theme-chalk/code-editor-vue3/addon/tern/tern.js +756 -0
- package/theme-chalk/code-editor-vue3/addon/tern/worker.js +44 -0
- package/theme-chalk/code-editor-vue3/addon/wrap/hardwrap.js +160 -0
- package/theme-chalk/code-editor-vue3/lib/codemirror.css +344 -0
- package/theme-chalk/code-editor-vue3/lib/codemirror.js +9884 -0
- package/theme-chalk/code-editor-vue3/mode/apl/apl.js +174 -0
- package/theme-chalk/code-editor-vue3/mode/asciiarmor/asciiarmor.js +74 -0
- package/theme-chalk/code-editor-vue3/mode/asn.1/asn.1.js +204 -0
- package/theme-chalk/code-editor-vue3/mode/asterisk/asterisk.js +220 -0
- package/theme-chalk/code-editor-vue3/mode/brainfuck/brainfuck.js +85 -0
- package/theme-chalk/code-editor-vue3/mode/clike/clike.js +942 -0
- package/theme-chalk/code-editor-vue3/mode/clojure/clojure.js +293 -0
- package/theme-chalk/code-editor-vue3/mode/cmake/cmake.js +97 -0
- package/theme-chalk/code-editor-vue3/mode/cobol/cobol.js +255 -0
- package/theme-chalk/code-editor-vue3/mode/coffeescript/coffeescript.js +359 -0
- package/theme-chalk/code-editor-vue3/mode/commonlisp/commonlisp.js +125 -0
- package/theme-chalk/code-editor-vue3/mode/crystal/crystal.js +433 -0
- package/theme-chalk/code-editor-vue3/mode/cypher/cypher.js +152 -0
- package/theme-chalk/code-editor-vue3/mode/d/d.js +223 -0
- package/theme-chalk/code-editor-vue3/mode/dart/dart.js +168 -0
- package/theme-chalk/code-editor-vue3/mode/diff/diff.js +47 -0
- package/theme-chalk/code-editor-vue3/mode/django/django.js +356 -0
- package/theme-chalk/code-editor-vue3/mode/dockerfile/dockerfile.js +211 -0
- package/theme-chalk/code-editor-vue3/mode/dtd/dtd.js +142 -0
- package/theme-chalk/code-editor-vue3/mode/dylan/dylan.js +352 -0
- package/theme-chalk/code-editor-vue3/mode/ebnf/ebnf.js +195 -0
- package/theme-chalk/code-editor-vue3/mode/ecl/ecl.js +206 -0
- package/theme-chalk/code-editor-vue3/mode/eiffel/eiffel.js +160 -0
- package/theme-chalk/code-editor-vue3/mode/elm/elm.js +245 -0
- package/theme-chalk/code-editor-vue3/mode/erlang/erlang.js +619 -0
- package/theme-chalk/code-editor-vue3/mode/factor/factor.js +85 -0
- package/theme-chalk/code-editor-vue3/mode/fcl/fcl.js +173 -0
- package/theme-chalk/code-editor-vue3/mode/forth/forth.js +180 -0
- package/theme-chalk/code-editor-vue3/mode/fortran/fortran.js +188 -0
- package/theme-chalk/code-editor-vue3/mode/gas/gas.js +353 -0
- package/theme-chalk/code-editor-vue3/mode/gfm/gfm.js +129 -0
- package/theme-chalk/code-editor-vue3/mode/gherkin/gherkin.js +178 -0
- package/theme-chalk/code-editor-vue3/mode/go/go.js +187 -0
- package/theme-chalk/code-editor-vue3/mode/groovy/groovy.js +245 -0
- package/theme-chalk/code-editor-vue3/mode/haml/haml.js +161 -0
- package/theme-chalk/code-editor-vue3/mode/handlebars/handlebars.js +70 -0
- package/theme-chalk/code-editor-vue3/mode/haskell/haskell.js +268 -0
- package/theme-chalk/code-editor-vue3/mode/haskell-literate/haskell-literate.js +43 -0
- package/theme-chalk/code-editor-vue3/mode/haxe/haxe.js +515 -0
- package/theme-chalk/code-editor-vue3/mode/htmlmixed/htmlmixed.js +153 -0
- package/theme-chalk/code-editor-vue3/mode/http/http.js +113 -0
- package/theme-chalk/code-editor-vue3/mode/idl/idl.js +290 -0
- package/theme-chalk/code-editor-vue3/mode/jinja2/jinja2.js +193 -0
- package/theme-chalk/code-editor-vue3/mode/julia/julia.js +390 -0
- package/theme-chalk/code-editor-vue3/mode/livescript/livescript.js +280 -0
- package/theme-chalk/code-editor-vue3/mode/lua/lua.js +160 -0
- package/theme-chalk/code-editor-vue3/mode/markdown/markdown.js +886 -0
- package/theme-chalk/code-editor-vue3/mode/mathematica/mathematica.js +176 -0
- package/theme-chalk/code-editor-vue3/mode/mbox/mbox.js +129 -0
- package/theme-chalk/code-editor-vue3/mode/meta.js +221 -0
- package/theme-chalk/code-editor-vue3/mode/mirc/mirc.js +193 -0
- package/theme-chalk/code-editor-vue3/mode/mllike/mllike.js +359 -0
- package/theme-chalk/code-editor-vue3/mode/modelica/modelica.js +245 -0
- package/theme-chalk/code-editor-vue3/mode/mscgen/mscgen.js +175 -0
- package/theme-chalk/code-editor-vue3/mode/mumps/mumps.js +148 -0
- package/theme-chalk/code-editor-vue3/mode/nginx/nginx.js +178 -0
- package/theme-chalk/code-editor-vue3/mode/nsis/nsis.js +95 -0
- package/theme-chalk/code-editor-vue3/mode/ntriples/ntriples.js +195 -0
- package/theme-chalk/code-editor-vue3/mode/octave/octave.js +139 -0
- package/theme-chalk/code-editor-vue3/mode/oz/oz.js +252 -0
- package/theme-chalk/code-editor-vue3/mode/pascal/pascal.js +136 -0
- package/theme-chalk/code-editor-vue3/mode/pegjs/pegjs.js +111 -0
- package/theme-chalk/code-editor-vue3/mode/perl/perl.js +836 -0
- package/theme-chalk/code-editor-vue3/mode/php/php.js +234 -0
- package/theme-chalk/code-editor-vue3/mode/pig/pig.js +178 -0
- package/theme-chalk/code-editor-vue3/mode/powershell/powershell.js +398 -0
- package/theme-chalk/code-editor-vue3/mode/properties/properties.js +78 -0
- package/theme-chalk/code-editor-vue3/mode/protobuf/protobuf.js +72 -0
- package/theme-chalk/code-editor-vue3/mode/pug/pug.js +591 -0
- package/theme-chalk/code-editor-vue3/mode/puppet/puppet.js +220 -0
- package/theme-chalk/code-editor-vue3/mode/python/python.js +402 -0
- package/theme-chalk/code-editor-vue3/mode/q/q.js +139 -0
- package/theme-chalk/code-editor-vue3/mode/r/r.js +190 -0
- package/theme-chalk/code-editor-vue3/mode/rpm/changes/index.html +66 -0
- package/theme-chalk/code-editor-vue3/mode/rpm/rpm.js +109 -0
- package/theme-chalk/code-editor-vue3/mode/rst/rst.js +557 -0
- package/theme-chalk/code-editor-vue3/mode/ruby/ruby.js +303 -0
- package/theme-chalk/code-editor-vue3/mode/rust/rust.js +72 -0
- package/theme-chalk/code-editor-vue3/mode/sas/sas.js +303 -0
- package/theme-chalk/code-editor-vue3/mode/sass/sass.js +459 -0
- package/theme-chalk/code-editor-vue3/mode/scheme/scheme.js +284 -0
- package/theme-chalk/code-editor-vue3/mode/shell/shell.js +168 -0
- package/theme-chalk/code-editor-vue3/mode/sieve/sieve.js +193 -0
- package/theme-chalk/code-editor-vue3/mode/slim/slim.js +575 -0
- package/theme-chalk/code-editor-vue3/mode/smalltalk/smalltalk.js +168 -0
- package/theme-chalk/code-editor-vue3/mode/smarty/smarty.js +225 -0
- package/theme-chalk/code-editor-vue3/mode/solr/solr.js +104 -0
- package/theme-chalk/code-editor-vue3/mode/soy/soy.js +665 -0
- package/theme-chalk/code-editor-vue3/mode/sparql/sparql.js +184 -0
- package/theme-chalk/code-editor-vue3/mode/spreadsheet/spreadsheet.js +112 -0
- package/theme-chalk/code-editor-vue3/mode/sql/sql.js +525 -0
- package/theme-chalk/code-editor-vue3/mode/stex/stex.js +264 -0
- package/theme-chalk/code-editor-vue3/mode/stylus/stylus.js +775 -0
- package/theme-chalk/code-editor-vue3/mode/swift/swift.js +221 -0
- package/theme-chalk/code-editor-vue3/mode/tcl/tcl.js +140 -0
- package/theme-chalk/code-editor-vue3/mode/textile/textile.js +469 -0
- package/theme-chalk/code-editor-vue3/mode/tiddlywiki/tiddlywiki.css +14 -0
- package/theme-chalk/code-editor-vue3/mode/tiddlywiki/tiddlywiki.js +308 -0
- package/theme-chalk/code-editor-vue3/mode/tiki/tiki.css +26 -0
- package/theme-chalk/code-editor-vue3/mode/tiki/tiki.js +312 -0
- package/theme-chalk/code-editor-vue3/mode/toml/toml.js +88 -0
- package/theme-chalk/code-editor-vue3/mode/tornado/tornado.js +68 -0
- package/theme-chalk/code-editor-vue3/mode/troff/troff.js +84 -0
- package/theme-chalk/code-editor-vue3/mode/ttcn/ttcn.js +283 -0
- package/theme-chalk/code-editor-vue3/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- package/theme-chalk/code-editor-vue3/mode/turtle/turtle.js +162 -0
- package/theme-chalk/code-editor-vue3/mode/twig/twig.js +141 -0
- package/theme-chalk/code-editor-vue3/mode/vb/vb.js +275 -0
- package/theme-chalk/code-editor-vue3/mode/vbscript/vbscript.js +350 -0
- package/theme-chalk/code-editor-vue3/mode/velocity/velocity.js +202 -0
- package/theme-chalk/code-editor-vue3/mode/verilog/verilog.js +781 -0
- package/theme-chalk/code-editor-vue3/mode/vhdl/vhdl.js +189 -0
- package/theme-chalk/code-editor-vue3/mode/wast/wast.js +132 -0
- package/theme-chalk/code-editor-vue3/mode/webidl/webidl.js +195 -0
- package/theme-chalk/code-editor-vue3/mode/xml/xml.js +417 -0
- package/theme-chalk/code-editor-vue3/mode/xquery/xquery.js +448 -0
- package/theme-chalk/code-editor-vue3/mode/yacas/yacas.js +204 -0
- package/theme-chalk/code-editor-vue3/mode/yaml/yaml.js +120 -0
- package/theme-chalk/code-editor-vue3/mode/yaml-frontmatter/yaml-frontmatter.js +72 -0
- package/theme-chalk/code-editor-vue3/mode/z80/z80.js +116 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
+
|
|
4
|
+
(function(mod) {
|
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
+
mod(require("../../lib/codemirror"));
|
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
+
define(["../../lib/codemirror"], mod);
|
|
9
|
+
else // Plain browser env
|
|
10
|
+
mod(CodeMirror);
|
|
11
|
+
})(function(CodeMirror) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
CodeMirror.defineMode("d", function(config, parserConfig) {
|
|
15
|
+
var indentUnit = config.indentUnit,
|
|
16
|
+
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
|
17
|
+
keywords = parserConfig.keywords || {},
|
|
18
|
+
builtin = parserConfig.builtin || {},
|
|
19
|
+
blockKeywords = parserConfig.blockKeywords || {},
|
|
20
|
+
atoms = parserConfig.atoms || {},
|
|
21
|
+
hooks = parserConfig.hooks || {},
|
|
22
|
+
multiLineStrings = parserConfig.multiLineStrings;
|
|
23
|
+
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
|
24
|
+
|
|
25
|
+
var curPunc;
|
|
26
|
+
|
|
27
|
+
function tokenBase(stream, state) {
|
|
28
|
+
var ch = stream.next();
|
|
29
|
+
if (hooks[ch]) {
|
|
30
|
+
var result = hooks[ch](stream, state);
|
|
31
|
+
if (result !== false) return result;
|
|
32
|
+
}
|
|
33
|
+
if (ch == '"' || ch == "'" || ch == "`") {
|
|
34
|
+
state.tokenize = tokenString(ch);
|
|
35
|
+
return state.tokenize(stream, state);
|
|
36
|
+
}
|
|
37
|
+
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
|
38
|
+
curPunc = ch;
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (/\d/.test(ch)) {
|
|
42
|
+
stream.eatWhile(/[\w\.]/);
|
|
43
|
+
return "number";
|
|
44
|
+
}
|
|
45
|
+
if (ch == "/") {
|
|
46
|
+
if (stream.eat("+")) {
|
|
47
|
+
state.tokenize = tokenNestedComment;
|
|
48
|
+
return tokenNestedComment(stream, state);
|
|
49
|
+
}
|
|
50
|
+
if (stream.eat("*")) {
|
|
51
|
+
state.tokenize = tokenComment;
|
|
52
|
+
return tokenComment(stream, state);
|
|
53
|
+
}
|
|
54
|
+
if (stream.eat("/")) {
|
|
55
|
+
stream.skipToEnd();
|
|
56
|
+
return "comment";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (isOperatorChar.test(ch)) {
|
|
60
|
+
stream.eatWhile(isOperatorChar);
|
|
61
|
+
return "operator";
|
|
62
|
+
}
|
|
63
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
64
|
+
var cur = stream.current();
|
|
65
|
+
if (keywords.propertyIsEnumerable(cur)) {
|
|
66
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
|
67
|
+
return "keyword";
|
|
68
|
+
}
|
|
69
|
+
if (builtin.propertyIsEnumerable(cur)) {
|
|
70
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
|
71
|
+
return "builtin";
|
|
72
|
+
}
|
|
73
|
+
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
|
74
|
+
return "variable";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function tokenString(quote) {
|
|
78
|
+
return function(stream, state) {
|
|
79
|
+
var escaped = false, next, end = false;
|
|
80
|
+
while ((next = stream.next()) != null) {
|
|
81
|
+
if (next == quote && !escaped) {end = true; break;}
|
|
82
|
+
escaped = !escaped && next == "\\";
|
|
83
|
+
}
|
|
84
|
+
if (end || !(escaped || multiLineStrings))
|
|
85
|
+
state.tokenize = null;
|
|
86
|
+
return "string";
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function tokenComment(stream, state) {
|
|
91
|
+
var maybeEnd = false, ch;
|
|
92
|
+
while (ch = stream.next()) {
|
|
93
|
+
if (ch == "/" && maybeEnd) {
|
|
94
|
+
state.tokenize = null;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
maybeEnd = (ch == "*");
|
|
98
|
+
}
|
|
99
|
+
return "comment";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function tokenNestedComment(stream, state) {
|
|
103
|
+
var maybeEnd = false, ch;
|
|
104
|
+
while (ch = stream.next()) {
|
|
105
|
+
if (ch == "/" && maybeEnd) {
|
|
106
|
+
state.tokenize = null;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
maybeEnd = (ch == "+");
|
|
110
|
+
}
|
|
111
|
+
return "comment";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function Context(indented, column, type, align, prev) {
|
|
115
|
+
this.indented = indented;
|
|
116
|
+
this.column = column;
|
|
117
|
+
this.type = type;
|
|
118
|
+
this.align = align;
|
|
119
|
+
this.prev = prev;
|
|
120
|
+
}
|
|
121
|
+
function pushContext(state, col, type) {
|
|
122
|
+
var indent = state.indented;
|
|
123
|
+
if (state.context && state.context.type == "statement")
|
|
124
|
+
indent = state.context.indented;
|
|
125
|
+
return state.context = new Context(indent, col, type, null, state.context);
|
|
126
|
+
}
|
|
127
|
+
function popContext(state) {
|
|
128
|
+
var t = state.context.type;
|
|
129
|
+
if (t == ")" || t == "]" || t == "}")
|
|
130
|
+
state.indented = state.context.indented;
|
|
131
|
+
return state.context = state.context.prev;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Interface
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
startState: function(basecolumn) {
|
|
138
|
+
return {
|
|
139
|
+
tokenize: null,
|
|
140
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
|
141
|
+
indented: 0,
|
|
142
|
+
startOfLine: true
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
token: function(stream, state) {
|
|
147
|
+
var ctx = state.context;
|
|
148
|
+
if (stream.sol()) {
|
|
149
|
+
if (ctx.align == null) ctx.align = false;
|
|
150
|
+
state.indented = stream.indentation();
|
|
151
|
+
state.startOfLine = true;
|
|
152
|
+
}
|
|
153
|
+
if (stream.eatSpace()) return null;
|
|
154
|
+
curPunc = null;
|
|
155
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
|
156
|
+
if (style == "comment" || style == "meta") return style;
|
|
157
|
+
if (ctx.align == null) ctx.align = true;
|
|
158
|
+
|
|
159
|
+
if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
|
|
160
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
|
161
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
|
162
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
|
163
|
+
else if (curPunc == "}") {
|
|
164
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
|
165
|
+
if (ctx.type == "}") ctx = popContext(state);
|
|
166
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
|
167
|
+
}
|
|
168
|
+
else if (curPunc == ctx.type) popContext(state);
|
|
169
|
+
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
|
|
170
|
+
pushContext(state, stream.column(), "statement");
|
|
171
|
+
state.startOfLine = false;
|
|
172
|
+
return style;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
indent: function(state, textAfter) {
|
|
176
|
+
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
|
177
|
+
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
|
178
|
+
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
|
179
|
+
var closing = firstChar == ctx.type;
|
|
180
|
+
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
|
181
|
+
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
|
182
|
+
else return ctx.indented + (closing ? 0 : indentUnit);
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
electricChars: "{}",
|
|
186
|
+
blockCommentStart: "/*",
|
|
187
|
+
blockCommentEnd: "*/",
|
|
188
|
+
blockCommentContinue: " * ",
|
|
189
|
+
lineComment: "//",
|
|
190
|
+
fold: "brace"
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
function words(str) {
|
|
195
|
+
var obj = {}, words = str.split(" ");
|
|
196
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
197
|
+
return obj;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " +
|
|
201
|
+
"out scope struct switch try union unittest version while with";
|
|
202
|
+
|
|
203
|
+
CodeMirror.defineMIME("text/x-d", {
|
|
204
|
+
name: "d",
|
|
205
|
+
keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " +
|
|
206
|
+
"debug default delegate delete deprecated export extern final finally function goto immutable " +
|
|
207
|
+
"import inout invariant is lazy macro module new nothrow override package pragma private " +
|
|
208
|
+
"protected public pure ref return shared short static super synchronized template this " +
|
|
209
|
+
"throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " +
|
|
210
|
+
blockKeywords),
|
|
211
|
+
blockKeywords: words(blockKeywords),
|
|
212
|
+
builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " +
|
|
213
|
+
"ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
|
|
214
|
+
atoms: words("exit failure success true false null"),
|
|
215
|
+
hooks: {
|
|
216
|
+
"@": function(stream, _state) {
|
|
217
|
+
stream.eatWhile(/[\w\$_]/);
|
|
218
|
+
return "meta";
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
});
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
+
|
|
4
|
+
(function(mod) {
|
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
+
mod(require("../../lib/codemirror"), require("../clike/clike"));
|
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
+
define(["../../lib/codemirror", "../clike/clike"], mod);
|
|
9
|
+
else // Plain browser env
|
|
10
|
+
mod(CodeMirror);
|
|
11
|
+
})(function(CodeMirror) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var keywords = ("this super static final const abstract class extends external factory " +
|
|
15
|
+
"implements mixin get native set typedef with enum throw rethrow assert break case " +
|
|
16
|
+
"continue default in return new deferred async await covariant try catch finally " +
|
|
17
|
+
"do else for if switch while import library export part of show hide is as extension " +
|
|
18
|
+
"on yield late required sealed base interface when").split(" ");
|
|
19
|
+
var blockKeywords = "try catch finally do else for if switch while".split(" ");
|
|
20
|
+
var atoms = "true false null".split(" ");
|
|
21
|
+
var builtins = "void bool num int double dynamic var String Null Never".split(" ");
|
|
22
|
+
|
|
23
|
+
function set(words) {
|
|
24
|
+
var obj = {};
|
|
25
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function pushInterpolationStack(state) {
|
|
30
|
+
(state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function popInterpolationStack(state) {
|
|
34
|
+
return (state.interpolationStack || (state.interpolationStack = [])).pop();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function sizeInterpolationStack(state) {
|
|
38
|
+
return state.interpolationStack ? state.interpolationStack.length : 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
CodeMirror.defineMIME("application/dart", {
|
|
42
|
+
name: "clike",
|
|
43
|
+
keywords: set(keywords),
|
|
44
|
+
blockKeywords: set(blockKeywords),
|
|
45
|
+
builtin: set(builtins),
|
|
46
|
+
atoms: set(atoms),
|
|
47
|
+
// clike numbers without the suffixes, and with '_' separators.
|
|
48
|
+
number: /^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,
|
|
49
|
+
hooks: {
|
|
50
|
+
"@": function(stream) {
|
|
51
|
+
stream.eatWhile(/[\w\$_\.]/);
|
|
52
|
+
return "meta";
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// custom string handling to deal with triple-quoted strings and string interpolation
|
|
56
|
+
"'": function(stream, state) {
|
|
57
|
+
return tokenString("'", stream, state, false);
|
|
58
|
+
},
|
|
59
|
+
"\"": function(stream, state) {
|
|
60
|
+
return tokenString("\"", stream, state, false);
|
|
61
|
+
},
|
|
62
|
+
"r": function(stream, state) {
|
|
63
|
+
var peek = stream.peek();
|
|
64
|
+
if (peek == "'" || peek == "\"") {
|
|
65
|
+
return tokenString(stream.next(), stream, state, true);
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
"}": function(_stream, state) {
|
|
71
|
+
// "}" is end of interpolation, if interpolation stack is non-empty
|
|
72
|
+
if (sizeInterpolationStack(state) > 0) {
|
|
73
|
+
state.tokenize = popInterpolationStack(state);
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
"/": function(stream, state) {
|
|
80
|
+
if (!stream.eat("*")) return false
|
|
81
|
+
state.tokenize = tokenNestedComment(1)
|
|
82
|
+
return state.tokenize(stream, state)
|
|
83
|
+
},
|
|
84
|
+
token: function(stream, _, style) {
|
|
85
|
+
if (style == "variable") {
|
|
86
|
+
// Assume uppercase symbols are classes using variable-2
|
|
87
|
+
var isUpper = RegExp('^[_$]*[A-Z][a-zA-Z0-9_$]*$','g');
|
|
88
|
+
if (isUpper.test(stream.current())) {
|
|
89
|
+
return 'variable-2';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
function tokenString(quote, stream, state, raw) {
|
|
97
|
+
var tripleQuoted = false;
|
|
98
|
+
if (stream.eat(quote)) {
|
|
99
|
+
if (stream.eat(quote)) tripleQuoted = true;
|
|
100
|
+
else return "string"; //empty string
|
|
101
|
+
}
|
|
102
|
+
function tokenStringHelper(stream, state) {
|
|
103
|
+
var escaped = false;
|
|
104
|
+
while (!stream.eol()) {
|
|
105
|
+
if (!raw && !escaped && stream.peek() == "$") {
|
|
106
|
+
pushInterpolationStack(state);
|
|
107
|
+
state.tokenize = tokenInterpolation;
|
|
108
|
+
return "string";
|
|
109
|
+
}
|
|
110
|
+
var next = stream.next();
|
|
111
|
+
if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
|
|
112
|
+
state.tokenize = null;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
escaped = !raw && !escaped && next == "\\";
|
|
116
|
+
}
|
|
117
|
+
return "string";
|
|
118
|
+
}
|
|
119
|
+
state.tokenize = tokenStringHelper;
|
|
120
|
+
return tokenStringHelper(stream, state);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function tokenInterpolation(stream, state) {
|
|
124
|
+
stream.eat("$");
|
|
125
|
+
if (stream.eat("{")) {
|
|
126
|
+
// let clike handle the content of ${...},
|
|
127
|
+
// we take over again when "}" appears (see hooks).
|
|
128
|
+
state.tokenize = null;
|
|
129
|
+
} else {
|
|
130
|
+
state.tokenize = tokenInterpolationIdentifier;
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function tokenInterpolationIdentifier(stream, state) {
|
|
136
|
+
stream.eatWhile(/[\w_]/);
|
|
137
|
+
state.tokenize = popInterpolationStack(state);
|
|
138
|
+
return "variable";
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function tokenNestedComment(depth) {
|
|
142
|
+
return function (stream, state) {
|
|
143
|
+
var ch
|
|
144
|
+
while (ch = stream.next()) {
|
|
145
|
+
if (ch == "*" && stream.eat("/")) {
|
|
146
|
+
if (depth == 1) {
|
|
147
|
+
state.tokenize = null
|
|
148
|
+
break
|
|
149
|
+
} else {
|
|
150
|
+
state.tokenize = tokenNestedComment(depth - 1)
|
|
151
|
+
return state.tokenize(stream, state)
|
|
152
|
+
}
|
|
153
|
+
} else if (ch == "/" && stream.eat("*")) {
|
|
154
|
+
state.tokenize = tokenNestedComment(depth + 1)
|
|
155
|
+
return state.tokenize(stream, state)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return "comment"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
|
|
163
|
+
|
|
164
|
+
// This is needed to make loading through meta.js work.
|
|
165
|
+
CodeMirror.defineMode("dart", function(conf) {
|
|
166
|
+
return CodeMirror.getMode(conf, "application/dart");
|
|
167
|
+
}, "clike");
|
|
168
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
+
|
|
4
|
+
(function(mod) {
|
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
+
mod(require("../../lib/codemirror"));
|
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
+
define(["../../lib/codemirror"], mod);
|
|
9
|
+
else // Plain browser env
|
|
10
|
+
mod(CodeMirror);
|
|
11
|
+
})(function(CodeMirror) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
CodeMirror.defineMode("diff", function() {
|
|
15
|
+
|
|
16
|
+
var TOKEN_NAMES = {
|
|
17
|
+
'+': 'positive',
|
|
18
|
+
'-': 'negative',
|
|
19
|
+
'@': 'meta'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
token: function(stream) {
|
|
24
|
+
var tw_pos = stream.string.search(/[\t ]+?$/);
|
|
25
|
+
|
|
26
|
+
if (!stream.sol() || tw_pos === 0) {
|
|
27
|
+
stream.skipToEnd();
|
|
28
|
+
return ("error " + (
|
|
29
|
+
TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
|
|
33
|
+
|
|
34
|
+
if (tw_pos === -1) {
|
|
35
|
+
stream.skipToEnd();
|
|
36
|
+
} else {
|
|
37
|
+
stream.pos = tw_pos;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return token_name;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
CodeMirror.defineMIME("text/x-diff", "diff");
|
|
46
|
+
|
|
47
|
+
});
|