|
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
|
2
|
+// Distributed under an MIT license: http://codemirror.net/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
|
+function Context(indented, column, type, align, prev) {
|
|
|
15
|
+ this.indented = indented;
|
|
|
16
|
+ this.column = column;
|
|
|
17
|
+ this.type = type;
|
|
|
18
|
+ this.align = align;
|
|
|
19
|
+ this.prev = prev;
|
|
|
20
|
+}
|
|
|
21
|
+function isStatement(type) {
|
|
|
22
|
+ return type == "statement" || type == "switchstatement" || type == "namespace";
|
|
|
23
|
+}
|
|
|
24
|
+function pushContext(state, col, type) {
|
|
|
25
|
+ var indent = state.indented;
|
|
|
26
|
+ if (state.context && isStatement(state.context.type) && !isStatement(type))
|
|
|
27
|
+ indent = state.context.indented;
|
|
|
28
|
+ return state.context = new Context(indent, col, type, null, state.context);
|
|
|
29
|
+}
|
|
|
30
|
+function popContext(state) {
|
|
|
31
|
+ var t = state.context.type;
|
|
|
32
|
+ if (t == ")" || t == "]" || t == "}")
|
|
|
33
|
+ state.indented = state.context.indented;
|
|
|
34
|
+ return state.context = state.context.prev;
|
|
|
35
|
+}
|
|
|
36
|
+
|
|
|
37
|
+function typeBefore(stream, state) {
|
|
|
38
|
+ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
|
|
|
39
|
+ if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
|
|
|
40
|
+}
|
|
|
41
|
+
|
|
|
42
|
+function isTopScope(context) {
|
|
|
43
|
+ for (;;) {
|
|
|
44
|
+ if (!context || context.type == "top") return true;
|
|
|
45
|
+ if (context.type == "}" && context.prev.type != "namespace") return false;
|
|
|
46
|
+ context = context.prev;
|
|
|
47
|
+ }
|
|
|
48
|
+}
|
|
|
49
|
+
|
|
|
50
|
+CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|
|
51
|
+ var indentUnit = config.indentUnit,
|
|
|
52
|
+ statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
|
|
53
|
+ dontAlignCalls = parserConfig.dontAlignCalls,
|
|
|
54
|
+ keywords = parserConfig.keywords || {},
|
|
|
55
|
+ types = parserConfig.types || {},
|
|
|
56
|
+ builtin = parserConfig.builtin || {},
|
|
|
57
|
+ blockKeywords = parserConfig.blockKeywords || {},
|
|
|
58
|
+ defKeywords = parserConfig.defKeywords || {},
|
|
|
59
|
+ atoms = parserConfig.atoms || {},
|
|
|
60
|
+ hooks = parserConfig.hooks || {},
|
|
|
61
|
+ multiLineStrings = parserConfig.multiLineStrings,
|
|
|
62
|
+ indentStatements = parserConfig.indentStatements !== false,
|
|
|
63
|
+ indentSwitch = parserConfig.indentSwitch !== false,
|
|
|
64
|
+ namespaceSeparator = parserConfig.namespaceSeparator,
|
|
|
65
|
+ isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
|
|
|
66
|
+ numberStart = parserConfig.numberStart || /[\d\.]/,
|
|
|
67
|
+ number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
|
|
|
68
|
+ isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
|
|
|
69
|
+ endStatement = parserConfig.endStatement || /^[;:,]$/;
|
|
|
70
|
+
|
|
|
71
|
+ var curPunc, isDefKeyword;
|
|
|
72
|
+
|
|
|
73
|
+ function tokenBase(stream, state) {
|
|
|
74
|
+ var ch = stream.next();
|
|
|
75
|
+ if (hooks[ch]) {
|
|
|
76
|
+ var result = hooks[ch](stream, state);
|
|
|
77
|
+ if (result !== false) return result;
|
|
|
78
|
+ }
|
|
|
79
|
+ if (ch == '"' || ch == "'") {
|
|
|
80
|
+ state.tokenize = tokenString(ch);
|
|
|
81
|
+ return state.tokenize(stream, state);
|
|
|
82
|
+ }
|
|
|
83
|
+ if (isPunctuationChar.test(ch)) {
|
|
|
84
|
+ curPunc = ch;
|
|
|
85
|
+ return null;
|
|
|
86
|
+ }
|
|
|
87
|
+ if (numberStart.test(ch)) {
|
|
|
88
|
+ stream.backUp(1)
|
|
|
89
|
+ if (stream.match(number)) return "number"
|
|
|
90
|
+ stream.next()
|
|
|
91
|
+ }
|
|
|
92
|
+ if (ch == "/") {
|
|
|
93
|
+ if (stream.eat("*")) {
|
|
|
94
|
+ state.tokenize = tokenComment;
|
|
|
95
|
+ return tokenComment(stream, state);
|
|
|
96
|
+ }
|
|
|
97
|
+ if (stream.eat("/")) {
|
|
|
98
|
+ stream.skipToEnd();
|
|
|
99
|
+ return "comment";
|
|
|
100
|
+ }
|
|
|
101
|
+ }
|
|
|
102
|
+ if (isOperatorChar.test(ch)) {
|
|
|
103
|
+ while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
|
|
|
104
|
+ return "operator";
|
|
|
105
|
+ }
|
|
|
106
|
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
|
107
|
+ if (namespaceSeparator) while (stream.match(namespaceSeparator))
|
|
|
108
|
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
|
109
|
+
|
|
|
110
|
+ var cur = stream.current();
|
|
|
111
|
+ if (contains(keywords, cur)) {
|
|
|
112
|
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
|
|
113
|
+ if (contains(defKeywords, cur)) isDefKeyword = true;
|
|
|
114
|
+ return "keyword";
|
|
|
115
|
+ }
|
|
|
116
|
+ if (contains(types, cur)) return "variable-3";
|
|
|
117
|
+ if (contains(builtin, cur)) {
|
|
|
118
|
+ if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
|
|
119
|
+ return "builtin";
|
|
|
120
|
+ }
|
|
|
121
|
+ if (contains(atoms, cur)) return "atom";
|
|
|
122
|
+ return "variable";
|
|
|
123
|
+ }
|
|
|
124
|
+
|
|
|
125
|
+ function tokenString(quote) {
|
|
|
126
|
+ return function(stream, state) {
|
|
|
127
|
+ var escaped = false, next, end = false;
|
|
|
128
|
+ while ((next = stream.next()) != null) {
|
|
|
129
|
+ if (next == quote && !escaped) {end = true; break;}
|
|
|
130
|
+ escaped = !escaped && next == "\\";
|
|
|
131
|
+ }
|
|
|
132
|
+ if (end || !(escaped || multiLineStrings))
|
|
|
133
|
+ state.tokenize = null;
|
|
|
134
|
+ return "string";
|
|
|
135
|
+ };
|
|
|
136
|
+ }
|
|
|
137
|
+
|
|
|
138
|
+ function tokenComment(stream, state) {
|
|
|
139
|
+ var maybeEnd = false, ch;
|
|
|
140
|
+ while (ch = stream.next()) {
|
|
|
141
|
+ if (ch == "/" && maybeEnd) {
|
|
|
142
|
+ state.tokenize = null;
|
|
|
143
|
+ break;
|
|
|
144
|
+ }
|
|
|
145
|
+ maybeEnd = (ch == "*");
|
|
|
146
|
+ }
|
|
|
147
|
+ return "comment";
|
|
|
148
|
+ }
|
|
|
149
|
+
|
|
|
150
|
+ // Interface
|
|
|
151
|
+
|
|
|
152
|
+ return {
|
|
|
153
|
+ startState: function(basecolumn) {
|
|
|
154
|
+ return {
|
|
|
155
|
+ tokenize: null,
|
|
|
156
|
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
|
|
157
|
+ indented: 0,
|
|
|
158
|
+ startOfLine: true,
|
|
|
159
|
+ prevToken: null
|
|
|
160
|
+ };
|
|
|
161
|
+ },
|
|
|
162
|
+
|
|
|
163
|
+ token: function(stream, state) {
|
|
|
164
|
+ var ctx = state.context;
|
|
|
165
|
+ if (stream.sol()) {
|
|
|
166
|
+ if (ctx.align == null) ctx.align = false;
|
|
|
167
|
+ state.indented = stream.indentation();
|
|
|
168
|
+ state.startOfLine = true;
|
|
|
169
|
+ }
|
|
|
170
|
+ if (stream.eatSpace()) return null;
|
|
|
171
|
+ curPunc = isDefKeyword = null;
|
|
|
172
|
+ var style = (state.tokenize || tokenBase)(stream, state);
|
|
|
173
|
+ if (style == "comment" || style == "meta") return style;
|
|
|
174
|
+ if (ctx.align == null) ctx.align = true;
|
|
|
175
|
+
|
|
|
176
|
+ if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state);
|
|
|
177
|
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
|
|
178
|
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
|
|
179
|
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
|
|
180
|
+ else if (curPunc == "}") {
|
|
|
181
|
+ while (isStatement(ctx.type)) ctx = popContext(state);
|
|
|
182
|
+ if (ctx.type == "}") ctx = popContext(state);
|
|
|
183
|
+ while (isStatement(ctx.type)) ctx = popContext(state);
|
|
|
184
|
+ }
|
|
|
185
|
+ else if (curPunc == ctx.type) popContext(state);
|
|
|
186
|
+ else if (indentStatements &&
|
|
|
187
|
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
|
|
188
|
+ (isStatement(ctx.type) && curPunc == "newstatement"))) {
|
|
|
189
|
+ var type = "statement";
|
|
|
190
|
+ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
|
|
|
191
|
+ type = "switchstatement";
|
|
|
192
|
+ else if (style == "keyword" && stream.current() == "namespace")
|
|
|
193
|
+ type = "namespace";
|
|
|
194
|
+ pushContext(state, stream.column(), type);
|
|
|
195
|
+ }
|
|
|
196
|
+
|
|
|
197
|
+ if (style == "variable" &&
|
|
|
198
|
+ ((state.prevToken == "def" ||
|
|
|
199
|
+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
|
|
|
200
|
+ isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
|
|
|
201
|
+ style = "def";
|
|
|
202
|
+
|
|
|
203
|
+ if (hooks.token) {
|
|
|
204
|
+ var result = hooks.token(stream, state, style);
|
|
|
205
|
+ if (result !== undefined) style = result;
|
|
|
206
|
+ }
|
|
|
207
|
+
|
|
|
208
|
+ if (style == "def" && parserConfig.styleDefs === false) style = "variable";
|
|
|
209
|
+
|
|
|
210
|
+ state.startOfLine = false;
|
|
|
211
|
+ state.prevToken = isDefKeyword ? "def" : style || curPunc;
|
|
|
212
|
+ return style;
|
|
|
213
|
+ },
|
|
|
214
|
+
|
|
|
215
|
+ indent: function(state, textAfter) {
|
|
|
216
|
+ if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
|
|
217
|
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
|
|
218
|
+ if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
|
|
|
219
|
+ if (hooks.indent) {
|
|
|
220
|
+ var hook = hooks.indent(state, ctx, textAfter);
|
|
|
221
|
+ if (typeof hook == "number") return hook
|
|
|
222
|
+ }
|
|
|
223
|
+ var closing = firstChar == ctx.type;
|
|
|
224
|
+ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
|
|
|
225
|
+ if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
|
|
|
226
|
+ while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
|
|
|
227
|
+ return ctx.indented
|
|
|
228
|
+ }
|
|
|
229
|
+ if (isStatement(ctx.type))
|
|
|
230
|
+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
|
|
231
|
+ if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
|
|
232
|
+ return ctx.column + (closing ? 0 : 1);
|
|
|
233
|
+ if (ctx.type == ")" && !closing)
|
|
|
234
|
+ return ctx.indented + statementIndentUnit;
|
|
|
235
|
+
|
|
|
236
|
+ return ctx.indented + (closing ? 0 : indentUnit) +
|
|
|
237
|
+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
|
|
|
238
|
+ },
|
|
|
239
|
+
|
|
|
240
|
+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
|
|
|
241
|
+ blockCommentStart: "/*",
|
|
|
242
|
+ blockCommentEnd: "*/",
|
|
|
243
|
+ lineComment: "//",
|
|
|
244
|
+ fold: "brace"
|
|
|
245
|
+ };
|
|
|
246
|
+});
|
|
|
247
|
+
|
|
|
248
|
+ function words(str) {
|
|
|
249
|
+ var obj = {}, words = str.split(" ");
|
|
|
250
|
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
|
251
|
+ return obj;
|
|
|
252
|
+ }
|
|
|
253
|
+ function contains(words, word) {
|
|
|
254
|
+ if (typeof words === "function") {
|
|
|
255
|
+ return words(word);
|
|
|
256
|
+ } else {
|
|
|
257
|
+ return words.propertyIsEnumerable(word);
|
|
|
258
|
+ }
|
|
|
259
|
+ }
|
|
|
260
|
+ var cKeywords = "auto if break case register continue return default do sizeof " +
|
|
|
261
|
+ "static else struct switch extern typedef union for goto while enum const volatile";
|
|
|
262
|
+ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
|
|
|
263
|
+
|
|
|
264
|
+ function cppHook(stream, state) {
|
|
|
265
|
+ if (!state.startOfLine) return false
|
|
|
266
|
+ for (var ch, next = null; ch = stream.peek();) {
|
|
|
267
|
+ if (ch == "\\" && stream.match(/^.$/)) {
|
|
|
268
|
+ next = cppHook
|
|
|
269
|
+ break
|
|
|
270
|
+ } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
|
|
|
271
|
+ break
|
|
|
272
|
+ }
|
|
|
273
|
+ stream.next()
|
|
|
274
|
+ }
|
|
|
275
|
+ state.tokenize = next
|
|
|
276
|
+ return "meta"
|
|
|
277
|
+ }
|
|
|
278
|
+
|
|
|
279
|
+ function pointerHook(_stream, state) {
|
|
|
280
|
+ if (state.prevToken == "variable-3") return "variable-3";
|
|
|
281
|
+ return false;
|
|
|
282
|
+ }
|
|
|
283
|
+
|
|
|
284
|
+ function cpp14Literal(stream) {
|
|
|
285
|
+ stream.eatWhile(/[\w\.']/);
|
|
|
286
|
+ return "number";
|
|
|
287
|
+ }
|
|
|
288
|
+
|
|
|
289
|
+ function cpp11StringHook(stream, state) {
|
|
|
290
|
+ stream.backUp(1);
|
|
|
291
|
+ // Raw strings.
|
|
|
292
|
+ if (stream.match(/(R|u8R|uR|UR|LR)/)) {
|
|
|
293
|
+ var match = stream.match(/"([^\s\\()]{0,16})\(/);
|
|
|
294
|
+ if (!match) {
|
|
|
295
|
+ return false;
|
|
|
296
|
+ }
|
|
|
297
|
+ state.cpp11RawStringDelim = match[1];
|
|
|
298
|
+ state.tokenize = tokenRawString;
|
|
|
299
|
+ return tokenRawString(stream, state);
|
|
|
300
|
+ }
|
|
|
301
|
+ // Unicode strings/chars.
|
|
|
302
|
+ if (stream.match(/(u8|u|U|L)/)) {
|
|
|
303
|
+ if (stream.match(/["']/, /* eat */ false)) {
|
|
|
304
|
+ return "string";
|
|
|
305
|
+ }
|
|
|
306
|
+ return false;
|
|
|
307
|
+ }
|
|
|
308
|
+ // Ignore this hook.
|
|
|
309
|
+ stream.next();
|
|
|
310
|
+ return false;
|
|
|
311
|
+ }
|
|
|
312
|
+
|
|
|
313
|
+ function cppLooksLikeConstructor(word) {
|
|
|
314
|
+ var lastTwo = /(\w+)::(\w+)$/.exec(word);
|
|
|
315
|
+ return lastTwo && lastTwo[1] == lastTwo[2];
|
|
|
316
|
+ }
|
|
|
317
|
+
|
|
|
318
|
+ // C#-style strings where "" escapes a quote.
|
|
|
319
|
+ function tokenAtString(stream, state) {
|
|
|
320
|
+ var next;
|
|
|
321
|
+ while ((next = stream.next()) != null) {
|
|
|
322
|
+ if (next == '"' && !stream.eat('"')) {
|
|
|
323
|
+ state.tokenize = null;
|
|
|
324
|
+ break;
|
|
|
325
|
+ }
|
|
|
326
|
+ }
|
|
|
327
|
+ return "string";
|
|
|
328
|
+ }
|
|
|
329
|
+
|
|
|
330
|
+ // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
|
|
|
331
|
+ // <delim> can be a string up to 16 characters long.
|
|
|
332
|
+ function tokenRawString(stream, state) {
|
|
|
333
|
+ // Escape characters that have special regex meanings.
|
|
|
334
|
+ var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
|
|
|
335
|
+ var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
|
|
|
336
|
+ if (match)
|
|
|
337
|
+ state.tokenize = null;
|
|
|
338
|
+ else
|
|
|
339
|
+ stream.skipToEnd();
|
|
|
340
|
+ return "string";
|
|
|
341
|
+ }
|
|
|
342
|
+
|
|
|
343
|
+ function def(mimes, mode) {
|
|
|
344
|
+ if (typeof mimes == "string") mimes = [mimes];
|
|
|
345
|
+ var words = [];
|
|
|
346
|
+ function add(obj) {
|
|
|
347
|
+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
|
|
348
|
+ words.push(prop);
|
|
|
349
|
+ }
|
|
|
350
|
+ add(mode.keywords);
|
|
|
351
|
+ add(mode.types);
|
|
|
352
|
+ add(mode.builtin);
|
|
|
353
|
+ add(mode.atoms);
|
|
|
354
|
+ if (words.length) {
|
|
|
355
|
+ mode.helperType = mimes[0];
|
|
|
356
|
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
|
|
|
357
|
+ }
|
|
|
358
|
+
|
|
|
359
|
+ for (var i = 0; i < mimes.length; ++i)
|
|
|
360
|
+ CodeMirror.defineMIME(mimes[i], mode);
|
|
|
361
|
+ }
|
|
|
362
|
+
|
|
|
363
|
+ def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
|
|
364
|
+ name: "clike",
|
|
|
365
|
+ keywords: words(cKeywords),
|
|
|
366
|
+ types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
|
|
|
367
|
+ "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
|
|
|
368
|
+ "uint32_t uint64_t"),
|
|
|
369
|
+ blockKeywords: words("case do else for if switch while struct"),
|
|
|
370
|
+ defKeywords: words("struct"),
|
|
|
371
|
+ typeFirstDefinitions: true,
|
|
|
372
|
+ atoms: words("null true false"),
|
|
|
373
|
+ hooks: {"#": cppHook, "*": pointerHook},
|
|
|
374
|
+ modeProps: {fold: ["brace", "include"]}
|
|
|
375
|
+ });
|
|
|
376
|
+
|
|
|
377
|
+ def(["text/x-c++src", "text/x-c++hdr"], {
|
|
|
378
|
+ name: "clike",
|
|
|
379
|
+ keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
|
|
|
380
|
+ "static_cast typeid catch operator template typename class friend private " +
|
|
|
381
|
+ "this using const_cast inline public throw virtual delete mutable protected " +
|
|
|
382
|
+ "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
|
|
|
383
|
+ "static_assert override"),
|
|
|
384
|
+ types: words(cTypes + " bool wchar_t"),
|
|
|
385
|
+ blockKeywords: words("catch class do else finally for if struct switch try while"),
|
|
|
386
|
+ defKeywords: words("class namespace struct enum union"),
|
|
|
387
|
+ typeFirstDefinitions: true,
|
|
|
388
|
+ atoms: words("true false null"),
|
|
|
389
|
+ hooks: {
|
|
|
390
|
+ "#": cppHook,
|
|
|
391
|
+ "*": pointerHook,
|
|
|
392
|
+ "u": cpp11StringHook,
|
|
|
393
|
+ "U": cpp11StringHook,
|
|
|
394
|
+ "L": cpp11StringHook,
|
|
|
395
|
+ "R": cpp11StringHook,
|
|
|
396
|
+ "0": cpp14Literal,
|
|
|
397
|
+ "1": cpp14Literal,
|
|
|
398
|
+ "2": cpp14Literal,
|
|
|
399
|
+ "3": cpp14Literal,
|
|
|
400
|
+ "4": cpp14Literal,
|
|
|
401
|
+ "5": cpp14Literal,
|
|
|
402
|
+ "6": cpp14Literal,
|
|
|
403
|
+ "7": cpp14Literal,
|
|
|
404
|
+ "8": cpp14Literal,
|
|
|
405
|
+ "9": cpp14Literal,
|
|
|
406
|
+ token: function(stream, state, style) {
|
|
|
407
|
+ if (style == "variable" && stream.peek() == "(" &&
|
|
|
408
|
+ (state.prevToken == ";" || state.prevToken == null ||
|
|
|
409
|
+ state.prevToken == "}") &&
|
|
|
410
|
+ cppLooksLikeConstructor(stream.current()))
|
|
|
411
|
+ return "def";
|
|
|
412
|
+ }
|
|
|
413
|
+ },
|
|
|
414
|
+ namespaceSeparator: "::",
|
|
|
415
|
+ modeProps: {fold: ["brace", "include"]}
|
|
|
416
|
+ });
|
|
|
417
|
+
|
|
|
418
|
+ def("text/x-java", {
|
|
|
419
|
+ name: "clike",
|
|
|
420
|
+ keywords: words("abstract assert break case catch class const continue default " +
|
|
|
421
|
+ "do else enum extends final finally float for goto if implements import " +
|
|
|
422
|
+ "instanceof interface native new package private protected public " +
|
|
|
423
|
+ "return static strictfp super switch synchronized this throw throws transient " +
|
|
|
424
|
+ "try volatile while"),
|
|
|
425
|
+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
|
|
|
426
|
+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
|
|
|
427
|
+ blockKeywords: words("catch class do else finally for if switch try while"),
|
|
|
428
|
+ defKeywords: words("class interface package enum"),
|
|
|
429
|
+ typeFirstDefinitions: true,
|
|
|
430
|
+ atoms: words("true false null"),
|
|
|
431
|
+ endStatement: /^[;:]$/,
|
|
|
432
|
+ hooks: {
|
|
|
433
|
+ "@": function(stream) {
|
|
|
434
|
+ stream.eatWhile(/[\w\$_]/);
|
|
|
435
|
+ return "meta";
|
|
|
436
|
+ }
|
|
|
437
|
+ },
|
|
|
438
|
+ modeProps: {fold: ["brace", "import"]}
|
|
|
439
|
+ });
|
|
|
440
|
+
|
|
|
441
|
+ def("text/x-csharp", {
|
|
|
442
|
+ name: "clike",
|
|
|
443
|
+ keywords: words("abstract as async await base break case catch checked class const continue" +
|
|
|
444
|
+ " default delegate do else enum event explicit extern finally fixed for" +
|
|
|
445
|
+ " foreach goto if implicit in interface internal is lock namespace new" +
|
|
|
446
|
+ " operator out override params private protected public readonly ref return sealed" +
|
|
|
447
|
+ " sizeof stackalloc static struct switch this throw try typeof unchecked" +
|
|
|
448
|
+ " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
|
|
|
449
|
+ " global group into join let orderby partial remove select set value var yield"),
|
|
|
450
|
+ types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
|
|
|
451
|
+ " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
|
|
|
452
|
+ " UInt64 bool byte char decimal double short int long object" +
|
|
|
453
|
+ " sbyte float string ushort uint ulong"),
|
|
|
454
|
+ blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
|
|
|
455
|
+ defKeywords: words("class interface namespace struct var"),
|
|
|
456
|
+ typeFirstDefinitions: true,
|
|
|
457
|
+ atoms: words("true false null"),
|
|
|
458
|
+ hooks: {
|
|
|
459
|
+ "@": function(stream, state) {
|
|
|
460
|
+ if (stream.eat('"')) {
|
|
|
461
|
+ state.tokenize = tokenAtString;
|
|
|
462
|
+ return tokenAtString(stream, state);
|
|
|
463
|
+ }
|
|
|
464
|
+ stream.eatWhile(/[\w\$_]/);
|
|
|
465
|
+ return "meta";
|
|
|
466
|
+ }
|
|
|
467
|
+ }
|
|
|
468
|
+ });
|
|
|
469
|
+
|
|
|
470
|
+ function tokenTripleString(stream, state) {
|
|
|
471
|
+ var escaped = false;
|
|
|
472
|
+ while (!stream.eol()) {
|
|
|
473
|
+ if (!escaped && stream.match('"""')) {
|
|
|
474
|
+ state.tokenize = null;
|
|
|
475
|
+ break;
|
|
|
476
|
+ }
|
|
|
477
|
+ escaped = stream.next() == "\\" && !escaped;
|
|
|
478
|
+ }
|
|
|
479
|
+ return "string";
|
|
|
480
|
+ }
|
|
|
481
|
+
|
|
|
482
|
+ def("text/x-scala", {
|
|
|
483
|
+ name: "clike",
|
|
|
484
|
+ keywords: words(
|
|
|
485
|
+
|
|
|
486
|
+ /* scala */
|
|
|
487
|
+ "abstract case catch class def do else extends final finally for forSome if " +
|
|
|
488
|
+ "implicit import lazy match new null object override package private protected return " +
|
|
|
489
|
+ "sealed super this throw trait try type val var while with yield _ : = => <- <: " +
|
|
|
490
|
+ "<% >: # @ " +
|
|
|
491
|
+
|
|
|
492
|
+ /* package scala */
|
|
|
493
|
+ "assert assume require print println printf readLine readBoolean readByte readShort " +
|
|
|
494
|
+ "readChar readInt readLong readFloat readDouble " +
|
|
|
495
|
+
|
|
|
496
|
+ ":: #:: "
|
|
|
497
|
+ ),
|
|
|
498
|
+ types: words(
|
|
|
499
|
+ "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
|
|
|
500
|
+ "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
|
|
|
501
|
+ "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
|
|
|
502
|
+ "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
|
|
|
503
|
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
|
|
|
504
|
+
|
|
|
505
|
+ /* package java.lang */
|
|
|
506
|
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
|
|
507
|
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
|
|
508
|
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
|
|
509
|
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
|
|
510
|
+ ),
|
|
|
511
|
+ multiLineStrings: true,
|
|
|
512
|
+ blockKeywords: words("catch class do else finally for forSome if match switch try while"),
|
|
|
513
|
+ defKeywords: words("class def object package trait type val var"),
|
|
|
514
|
+ atoms: words("true false null"),
|
|
|
515
|
+ indentStatements: false,
|
|
|
516
|
+ indentSwitch: false,
|
|
|
517
|
+ hooks: {
|
|
|
518
|
+ "@": function(stream) {
|
|
|
519
|
+ stream.eatWhile(/[\w\$_]/);
|
|
|
520
|
+ return "meta";
|
|
|
521
|
+ },
|
|
|
522
|
+ '"': function(stream, state) {
|
|
|
523
|
+ if (!stream.match('""')) return false;
|
|
|
524
|
+ state.tokenize = tokenTripleString;
|
|
|
525
|
+ return state.tokenize(stream, state);
|
|
|
526
|
+ },
|
|
|
527
|
+ "'": function(stream) {
|
|
|
528
|
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
|
529
|
+ return "atom";
|
|
|
530
|
+ },
|
|
|
531
|
+ "=": function(stream, state) {
|
|
|
532
|
+ var cx = state.context
|
|
|
533
|
+ if (cx.type == "}" && cx.align && stream.eat(">")) {
|
|
|
534
|
+ state.context = new Context(cx.indented, cx.column, cx.type, null, cx.prev)
|
|
|
535
|
+ return "operator"
|
|
|
536
|
+ } else {
|
|
|
537
|
+ return false
|
|
|
538
|
+ }
|
|
|
539
|
+ }
|
|
|
540
|
+ },
|
|
|
541
|
+ modeProps: {closeBrackets: {triples: '"'}}
|
|
|
542
|
+ });
|
|
|
543
|
+
|
|
|
544
|
+ function tokenKotlinString(tripleString){
|
|
|
545
|
+ return function (stream, state) {
|
|
|
546
|
+ var escaped = false, next, end = false;
|
|
|
547
|
+ while (!stream.eol()) {
|
|
|
548
|
+ if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
|
|
|
549
|
+ if (tripleString && stream.match('"""')) {end = true; break;}
|
|
|
550
|
+ next = stream.next();
|
|
|
551
|
+ if(!escaped && next == "$" && stream.match('{'))
|
|
|
552
|
+ stream.skipTo("}");
|
|
|
553
|
+ escaped = !escaped && next == "\\" && !tripleString;
|
|
|
554
|
+ }
|
|
|
555
|
+ if (end || !tripleString)
|
|
|
556
|
+ state.tokenize = null;
|
|
|
557
|
+ return "string";
|
|
|
558
|
+ }
|
|
|
559
|
+ }
|
|
|
560
|
+
|
|
|
561
|
+ def("text/x-kotlin", {
|
|
|
562
|
+ name: "clike",
|
|
|
563
|
+ keywords: words(
|
|
|
564
|
+ /*keywords*/
|
|
|
565
|
+ "package as typealias class interface this super val " +
|
|
|
566
|
+ "var fun for is in This throw return " +
|
|
|
567
|
+ "break continue object if else while do try when !in !is as? " +
|
|
|
568
|
+
|
|
|
569
|
+ /*soft keywords*/
|
|
|
570
|
+ "file import where by get set abstract enum open inner override private public internal " +
|
|
|
571
|
+ "protected catch finally out final vararg reified dynamic companion constructor init " +
|
|
|
572
|
+ "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
|
|
|
573
|
+ "external annotation crossinline const operator infix"
|
|
|
574
|
+ ),
|
|
|
575
|
+ types: words(
|
|
|
576
|
+ /* package java.lang */
|
|
|
577
|
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
|
|
578
|
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
|
|
579
|
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
|
|
580
|
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
|
|
581
|
+ ),
|
|
|
582
|
+ intendSwitch: false,
|
|
|
583
|
+ indentStatements: false,
|
|
|
584
|
+ multiLineStrings: true,
|
|
|
585
|
+ blockKeywords: words("catch class do else finally for if where try while enum"),
|
|
|
586
|
+ defKeywords: words("class val var object package interface fun"),
|
|
|
587
|
+ atoms: words("true false null this"),
|
|
|
588
|
+ hooks: {
|
|
|
589
|
+ '"': function(stream, state) {
|
|
|
590
|
+ state.tokenize = tokenKotlinString(stream.match('""'));
|
|
|
591
|
+ return state.tokenize(stream, state);
|
|
|
592
|
+ }
|
|
|
593
|
+ },
|
|
|
594
|
+ modeProps: {closeBrackets: {triples: '"'}}
|
|
|
595
|
+ });
|
|
|
596
|
+
|
|
|
597
|
+ def(["x-shader/x-vertex", "x-shader/x-fragment"], {
|
|
|
598
|
+ name: "clike",
|
|
|
599
|
+ keywords: words("sampler1D sampler2D sampler3D samplerCube " +
|
|
|
600
|
+ "sampler1DShadow sampler2DShadow " +
|
|
|
601
|
+ "const attribute uniform varying " +
|
|
|
602
|
+ "break continue discard return " +
|
|
|
603
|
+ "for while do if else struct " +
|
|
|
604
|
+ "in out inout"),
|
|
|
605
|
+ types: words("float int bool void " +
|
|
|
606
|
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
|
|
|
607
|
+ "mat2 mat3 mat4"),
|
|
|
608
|
+ blockKeywords: words("for while do if else struct"),
|
|
|
609
|
+ builtin: words("radians degrees sin cos tan asin acos atan " +
|
|
|
610
|
+ "pow exp log exp2 sqrt inversesqrt " +
|
|
|
611
|
+ "abs sign floor ceil fract mod min max clamp mix step smoothstep " +
|
|
|
612
|
+ "length distance dot cross normalize ftransform faceforward " +
|
|
|
613
|
+ "reflect refract matrixCompMult " +
|
|
|
614
|
+ "lessThan lessThanEqual greaterThan greaterThanEqual " +
|
|
|
615
|
+ "equal notEqual any all not " +
|
|
|
616
|
+ "texture1D texture1DProj texture1DLod texture1DProjLod " +
|
|
|
617
|
+ "texture2D texture2DProj texture2DLod texture2DProjLod " +
|
|
|
618
|
+ "texture3D texture3DProj texture3DLod texture3DProjLod " +
|
|
|
619
|
+ "textureCube textureCubeLod " +
|
|
|
620
|
+ "shadow1D shadow2D shadow1DProj shadow2DProj " +
|
|
|
621
|
+ "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
|
|
|
622
|
+ "dFdx dFdy fwidth " +
|
|
|
623
|
+ "noise1 noise2 noise3 noise4"),
|
|
|
624
|
+ atoms: words("true false " +
|
|
|
625
|
+ "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
|
|
|
626
|
+ "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
|
|
|
627
|
+ "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
|
|
|
628
|
+ "gl_FogCoord gl_PointCoord " +
|
|
|
629
|
+ "gl_Position gl_PointSize gl_ClipVertex " +
|
|
|
630
|
+ "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
|
|
|
631
|
+ "gl_TexCoord gl_FogFragCoord " +
|
|
|
632
|
+ "gl_FragCoord gl_FrontFacing " +
|
|
|
633
|
+ "gl_FragData gl_FragDepth " +
|
|
|
634
|
+ "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
|
|
|
635
|
+ "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
|
|
|
636
|
+ "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
|
|
|
637
|
+ "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
|
|
|
638
|
+ "gl_ProjectionMatrixInverseTranspose " +
|
|
|
639
|
+ "gl_ModelViewProjectionMatrixInverseTranspose " +
|
|
|
640
|
+ "gl_TextureMatrixInverseTranspose " +
|
|
|
641
|
+ "gl_NormalScale gl_DepthRange gl_ClipPlane " +
|
|
|
642
|
+ "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
|
|
|
643
|
+ "gl_FrontLightModelProduct gl_BackLightModelProduct " +
|
|
|
644
|
+ "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
|
|
|
645
|
+ "gl_FogParameters " +
|
|
|
646
|
+ "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
|
|
|
647
|
+ "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
|
|
|
648
|
+ "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
|
|
|
649
|
+ "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
|
|
|
650
|
+ "gl_MaxDrawBuffers"),
|
|
|
651
|
+ indentSwitch: false,
|
|
|
652
|
+ hooks: {"#": cppHook},
|
|
|
653
|
+ modeProps: {fold: ["brace", "include"]}
|
|
|
654
|
+ });
|
|
|
655
|
+
|
|
|
656
|
+ def("text/x-nesc", {
|
|
|
657
|
+ name: "clike",
|
|
|
658
|
+ keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
|
|
|
659
|
+ "implementation includes interface module new norace nx_struct nx_union post provides " +
|
|
|
660
|
+ "signal task uses abstract extends"),
|
|
|
661
|
+ types: words(cTypes),
|
|
|
662
|
+ blockKeywords: words("case do else for if switch while struct"),
|
|
|
663
|
+ atoms: words("null true false"),
|
|
|
664
|
+ hooks: {"#": cppHook},
|
|
|
665
|
+ modeProps: {fold: ["brace", "include"]}
|
|
|
666
|
+ });
|
|
|
667
|
+
|
|
|
668
|
+ def("text/x-objectivec", {
|
|
|
669
|
+ name: "clike",
|
|
|
670
|
+ keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
|
|
|
671
|
+ "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
|
|
|
672
|
+ types: words(cTypes),
|
|
|
673
|
+ atoms: words("YES NO NULL NILL ON OFF true false"),
|
|
|
674
|
+ hooks: {
|
|
|
675
|
+ "@": function(stream) {
|
|
|
676
|
+ stream.eatWhile(/[\w\$]/);
|
|
|
677
|
+ return "keyword";
|
|
|
678
|
+ },
|
|
|
679
|
+ "#": cppHook,
|
|
|
680
|
+ indent: function(_state, ctx, textAfter) {
|
|
|
681
|
+ if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
|
|
|
682
|
+ }
|
|
|
683
|
+ },
|
|
|
684
|
+ modeProps: {fold: "brace"}
|
|
|
685
|
+ });
|
|
|
686
|
+
|
|
|
687
|
+ def("text/x-squirrel", {
|
|
|
688
|
+ name: "clike",
|
|
|
689
|
+ keywords: words("base break clone continue const default delete enum extends function in class" +
|
|
|
690
|
+ " foreach local resume return this throw typeof yield constructor instanceof static"),
|
|
|
691
|
+ types: words(cTypes),
|
|
|
692
|
+ blockKeywords: words("case catch class else for foreach if switch try while"),
|
|
|
693
|
+ defKeywords: words("function local class"),
|
|
|
694
|
+ typeFirstDefinitions: true,
|
|
|
695
|
+ atoms: words("true false null"),
|
|
|
696
|
+ hooks: {"#": cppHook},
|
|
|
697
|
+ modeProps: {fold: ["brace", "include"]}
|
|
|
698
|
+ });
|
|
|
699
|
+
|
|
|
700
|
+ // Ceylon Strings need to deal with interpolation
|
|
|
701
|
+ var stringTokenizer = null;
|
|
|
702
|
+ function tokenCeylonString(type) {
|
|
|
703
|
+ return function(stream, state) {
|
|
|
704
|
+ var escaped = false, next, end = false;
|
|
|
705
|
+ while (!stream.eol()) {
|
|
|
706
|
+ if (!escaped && stream.match('"') &&
|
|
|
707
|
+ (type == "single" || stream.match('""'))) {
|
|
|
708
|
+ end = true;
|
|
|
709
|
+ break;
|
|
|
710
|
+ }
|
|
|
711
|
+ if (!escaped && stream.match('``')) {
|
|
|
712
|
+ stringTokenizer = tokenCeylonString(type);
|
|
|
713
|
+ end = true;
|
|
|
714
|
+ break;
|
|
|
715
|
+ }
|
|
|
716
|
+ next = stream.next();
|
|
|
717
|
+ escaped = type == "single" && !escaped && next == "\\";
|
|
|
718
|
+ }
|
|
|
719
|
+ if (end)
|
|
|
720
|
+ state.tokenize = null;
|
|
|
721
|
+ return "string";
|
|
|
722
|
+ }
|
|
|
723
|
+ }
|
|
|
724
|
+
|
|
|
725
|
+ def("text/x-ceylon", {
|
|
|
726
|
+ name: "clike",
|
|
|
727
|
+ keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
|
|
|
728
|
+ " exists extends finally for function given if import in interface is let module new" +
|
|
|
729
|
+ " nonempty object of out outer package return satisfies super switch then this throw" +
|
|
|
730
|
+ " try value void while"),
|
|
|
731
|
+ types: function(word) {
|
|
|
732
|
+ // In Ceylon all identifiers that start with an uppercase are types
|
|
|
733
|
+ var first = word.charAt(0);
|
|
|
734
|
+ return (first === first.toUpperCase() && first !== first.toLowerCase());
|
|
|
735
|
+ },
|
|
|
736
|
+ blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
|
|
|
737
|
+ defKeywords: words("class dynamic function interface module object package value"),
|
|
|
738
|
+ builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
|
|
|
739
|
+ " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
|
|
|
740
|
+ isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
|
|
|
741
|
+ isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
|
|
|
742
|
+ numberStart: /[\d#$]/,
|
|
|
743
|
+ number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
|
|
|
744
|
+ multiLineStrings: true,
|
|
|
745
|
+ typeFirstDefinitions: true,
|
|
|
746
|
+ atoms: words("true false null larger smaller equal empty finished"),
|
|
|
747
|
+ indentSwitch: false,
|
|
|
748
|
+ styleDefs: false,
|
|
|
749
|
+ hooks: {
|
|
|
750
|
+ "@": function(stream) {
|
|
|
751
|
+ stream.eatWhile(/[\w\$_]/);
|
|
|
752
|
+ return "meta";
|
|
|
753
|
+ },
|
|
|
754
|
+ '"': function(stream, state) {
|
|
|
755
|
+ state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
|
|
|
756
|
+ return state.tokenize(stream, state);
|
|
|
757
|
+ },
|
|
|
758
|
+ '`': function(stream, state) {
|
|
|
759
|
+ if (!stringTokenizer || !stream.match('`')) return false;
|
|
|
760
|
+ state.tokenize = stringTokenizer;
|
|
|
761
|
+ stringTokenizer = null;
|
|
|
762
|
+ return state.tokenize(stream, state);
|
|
|
763
|
+ },
|
|
|
764
|
+ "'": function(stream) {
|
|
|
765
|
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
|
|
766
|
+ return "atom";
|
|
|
767
|
+ },
|
|
|
768
|
+ token: function(_stream, state, style) {
|
|
|
769
|
+ if ((style == "variable" || style == "variable-3") &&
|
|
|
770
|
+ state.prevToken == ".") {
|
|
|
771
|
+ return "variable-2";
|
|
|
772
|
+ }
|
|
|
773
|
+ }
|
|
|
774
|
+ },
|
|
|
775
|
+ modeProps: {
|
|
|
776
|
+ fold: ["brace", "import"],
|
|
|
777
|
+ closeBrackets: {triples: '"'}
|
|
|
778
|
+ }
|
|
|
779
|
+ });
|
|
|
780
|
+
|
|
|
781
|
+});
|