codemirror-rails 5.2 → 5.3

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codemirror/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/codemirror.js +34 -27
  4. data/vendor/assets/javascripts/codemirror/addons/display/rulers.js +1 -2
  5. data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +1 -0
  6. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +14 -23
  7. data/vendor/assets/javascripts/codemirror/addons/hint/sql-hint.js +12 -3
  8. data/vendor/assets/javascripts/codemirror/addons/lint/lint.js +6 -6
  9. data/vendor/assets/javascripts/codemirror/addons/search/search.js +1 -1
  10. data/vendor/assets/javascripts/codemirror/addons/search/searchcursor.js +2 -2
  11. data/vendor/assets/javascripts/codemirror/addons/tern/worker.js +1 -1
  12. data/vendor/assets/javascripts/codemirror/keymaps/vim.js +64 -67
  13. data/vendor/assets/javascripts/codemirror/modes/apl.js +1 -2
  14. data/vendor/assets/javascripts/codemirror/modes/asn.1.js +204 -0
  15. data/vendor/assets/javascripts/codemirror/modes/asterisk.js +2 -4
  16. data/vendor/assets/javascripts/codemirror/modes/clike.js +98 -36
  17. data/vendor/assets/javascripts/codemirror/modes/css.js +1 -16
  18. data/vendor/assets/javascripts/codemirror/modes/cypher.js +1 -1
  19. data/vendor/assets/javascripts/codemirror/modes/dylan.js +18 -26
  20. data/vendor/assets/javascripts/codemirror/modes/ecl.js +1 -2
  21. data/vendor/assets/javascripts/codemirror/modes/eiffel.js +0 -2
  22. data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +2 -2
  23. data/vendor/assets/javascripts/codemirror/modes/julia.js +0 -2
  24. data/vendor/assets/javascripts/codemirror/modes/livescript.js +2 -2
  25. data/vendor/assets/javascripts/codemirror/modes/mathematica.js +175 -0
  26. data/vendor/assets/javascripts/codemirror/modes/php.js +1 -0
  27. data/vendor/assets/javascripts/codemirror/modes/pig.js +15 -25
  28. data/vendor/assets/javascripts/codemirror/modes/sql.js +2 -2
  29. data/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js +36 -47
  30. data/vendor/assets/javascripts/codemirror/modes/tiki.js +8 -19
  31. data/vendor/assets/javascripts/codemirror/modes/ttcn-cfg.js +214 -0
  32. data/vendor/assets/javascripts/codemirror/modes/ttcn.js +283 -0
  33. data/vendor/assets/javascripts/codemirror/modes/xquery.js +30 -40
  34. data/vendor/assets/stylesheets/codemirror/addons/dialog/dialog.css +2 -2
  35. data/vendor/assets/stylesheets/codemirror/themes/monokai.css +1 -0
  36. data/vendor/assets/stylesheets/codemirror/themes/ttcn.css +66 -0
  37. metadata +8 -7
  38. data/vendor/assets/javascripts/codemirror/addons/mode/multiplex_test.js +0 -33
  39. data/vendor/assets/javascripts/codemirror/modes/less_test.js +0 -54
  40. data/vendor/assets/javascripts/codemirror/modes/scss_test.js +0 -110
  41. data/vendor/assets/javascripts/codemirror/modes/test.js +0 -67
@@ -329,7 +329,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
329
329
  if (type == "}") return popContext(state);
330
330
  if (type == "{" || type == ";") return popAndPass(type, stream, state);
331
331
  if (type == "word") override = "variable";
332
- else if (type != "variable") override = "error";
332
+ else if (type != "variable" && type != "(" && type != ")") override = "error";
333
333
  return "interpolation";
334
334
  };
335
335
 
@@ -653,16 +653,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
653
653
  return ["comment", "comment"];
654
654
  }
655
655
 
656
- function tokenSGMLComment(stream, state) {
657
- if (stream.skipTo("-->")) {
658
- stream.match("-->");
659
- state.tokenize = null;
660
- } else {
661
- stream.skipToEnd();
662
- }
663
- return ["comment", "comment"];
664
- }
665
-
666
656
  CodeMirror.defineMIME("text/css", {
667
657
  documentTypes: documentTypes,
668
658
  mediaTypes: mediaTypes,
@@ -674,11 +664,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
674
664
  colorKeywords: colorKeywords,
675
665
  valueKeywords: valueKeywords,
676
666
  tokenHooks: {
677
- "<": function(stream, state) {
678
- if (!stream.match("!--")) return false;
679
- state.tokenize = tokenSGMLComment;
680
- return tokenSGMLComment(stream, state);
681
- },
682
667
  "/": function(stream, state) {
683
668
  if (!stream.eat("*")) return false;
684
669
  state.tokenize = tokenCComment;
@@ -19,7 +19,7 @@
19
19
 
20
20
  CodeMirror.defineMode("cypher", function(config) {
21
21
  var tokenBase = function(stream/*, state*/) {
22
- var ch = stream.next(), curPunc = null;
22
+ var ch = stream.next();
23
23
  if (ch === "\"" || ch === "'") {
24
24
  stream.match(/.+?["']/);
25
25
  return "string";
@@ -154,20 +154,12 @@ CodeMirror.defineMode("dylan", function(_config) {
154
154
  return f(stream, state);
155
155
  }
156
156
 
157
- var type, content;
158
-
159
- function ret(_type, style, _content) {
160
- type = _type;
161
- content = _content;
162
- return style;
163
- }
164
-
165
157
  function tokenBase(stream, state) {
166
158
  // String
167
159
  var ch = stream.peek();
168
160
  if (ch == "'" || ch == '"') {
169
161
  stream.next();
170
- return chain(stream, state, tokenString(ch, "string", "string"));
162
+ return chain(stream, state, tokenString(ch, "string"));
171
163
  }
172
164
  // Comment
173
165
  else if (ch == "/") {
@@ -176,16 +168,16 @@ CodeMirror.defineMode("dylan", function(_config) {
176
168
  return chain(stream, state, tokenComment);
177
169
  } else if (stream.eat("/")) {
178
170
  stream.skipToEnd();
179
- return ret("comment", "comment");
171
+ return "comment";
180
172
  } else {
181
173
  stream.skipTo(" ");
182
- return ret("operator", "operator");
174
+ return "operator";
183
175
  }
184
176
  }
185
177
  // Decimal
186
178
  else if (/\d/.test(ch)) {
187
179
  stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
188
- return ret("number", "number");
180
+ return "number";
189
181
  }
190
182
  // Hash
191
183
  else if (ch == "#") {
@@ -194,33 +186,33 @@ CodeMirror.defineMode("dylan", function(_config) {
194
186
  ch = stream.peek();
195
187
  if (ch == '"') {
196
188
  stream.next();
197
- return chain(stream, state, tokenString('"', "symbol", "string-2"));
189
+ return chain(stream, state, tokenString('"', "string-2"));
198
190
  }
199
191
  // Binary number
200
192
  else if (ch == "b") {
201
193
  stream.next();
202
194
  stream.eatWhile(/[01]/);
203
- return ret("number", "number");
195
+ return "number";
204
196
  }
205
197
  // Hex number
206
198
  else if (ch == "x") {
207
199
  stream.next();
208
200
  stream.eatWhile(/[\da-f]/i);
209
- return ret("number", "number");
201
+ return "number";
210
202
  }
211
203
  // Octal number
212
204
  else if (ch == "o") {
213
205
  stream.next();
214
206
  stream.eatWhile(/[0-7]/);
215
- return ret("number", "number");
207
+ return "number";
216
208
  }
217
209
  // Hash symbol
218
210
  else {
219
211
  stream.eatWhile(/[-a-zA-Z]/);
220
- return ret("hash", "keyword");
212
+ return "keyword";
221
213
  }
222
214
  } else if (stream.match("end")) {
223
- return ret("end", "keyword");
215
+ return "keyword";
224
216
  }
225
217
  for (var name in patterns) {
226
218
  if (patterns.hasOwnProperty(name)) {
@@ -228,21 +220,21 @@ CodeMirror.defineMode("dylan", function(_config) {
228
220
  if ((pattern instanceof Array && pattern.some(function(p) {
229
221
  return stream.match(p);
230
222
  })) || stream.match(pattern))
231
- return ret(name, patternStyles[name], stream.current());
223
+ return patternStyles[name];
232
224
  }
233
225
  }
234
226
  if (stream.match("define")) {
235
- return ret("definition", "def");
227
+ return "def";
236
228
  } else {
237
229
  stream.eatWhile(/[\w\-]/);
238
230
  // Keyword
239
231
  if (wordLookup[stream.current()]) {
240
- return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current());
232
+ return styleLookup[stream.current()];
241
233
  } else if (stream.current().match(symbol)) {
242
- return ret("variable", "variable");
234
+ return "variable";
243
235
  } else {
244
236
  stream.next();
245
- return ret("other", "variable-2");
237
+ return "variable-2";
246
238
  }
247
239
  }
248
240
  }
@@ -257,10 +249,10 @@ CodeMirror.defineMode("dylan", function(_config) {
257
249
  }
258
250
  maybeEnd = (ch == "*");
259
251
  }
260
- return ret("comment", "comment");
252
+ return "comment";
261
253
  }
262
254
 
263
- function tokenString(quote, type, style) {
255
+ function tokenString(quote, style) {
264
256
  return function(stream, state) {
265
257
  var next, end = false;
266
258
  while ((next = stream.next()) != null) {
@@ -271,7 +263,7 @@ CodeMirror.defineMode("dylan", function(_config) {
271
263
  }
272
264
  if (end)
273
265
  state.tokenize = tokenBase;
274
- return ret(type, style);
266
+ return style;
275
267
  };
276
268
  }
277
269
 
@@ -34,7 +34,6 @@ CodeMirror.defineMode("ecl", function(config) {
34
34
  var blockKeywords = words("catch class do else finally for if switch try while");
35
35
  var atoms = words("true false null");
36
36
  var hooks = {"#": metaHook};
37
- var multiLineStrings;
38
37
  var isOperatorChar = /[+\-*&%=<>!?|\/]/;
39
38
 
40
39
  var curPunc;
@@ -112,7 +111,7 @@ CodeMirror.defineMode("ecl", function(config) {
112
111
  if (next == quote && !escaped) {end = true; break;}
113
112
  escaped = !escaped && next == "\\";
114
113
  }
115
- if (end || !(escaped || multiLineStrings))
114
+ if (end || !escaped)
116
115
  state.tokenize = tokenBase;
117
116
  return "string";
118
117
  };
@@ -84,7 +84,6 @@ CodeMirror.defineMode("eiffel", function() {
84
84
  'or'
85
85
  ]);
86
86
  var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
87
- var curPunc;
88
87
 
89
88
  function chain(newtok, stream, state) {
90
89
  state.tokenize.push(newtok);
@@ -92,7 +91,6 @@ CodeMirror.defineMode("eiffel", function() {
92
91
  }
93
92
 
94
93
  function tokenBase(stream, state) {
95
- curPunc = null;
96
94
  if (stream.eatSpace()) return null;
97
95
  var ch = stream.next();
98
96
  if (ch == '"'||ch == "'") {
@@ -57,9 +57,9 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
57
57
  }
58
58
  function maybeBackup(stream, pat, style) {
59
59
  var cur = stream.current();
60
- var close = cur.search(pat), m;
60
+ var close = cur.search(pat);
61
61
  if (close > -1) stream.backUp(cur.length - close);
62
- else if (m = cur.match(/<\/?$/)) {
62
+ else if (cur.match(/<\/?$/)) {
63
63
  stream.backUp(cur.length);
64
64
  if (!stream.match(pat, false)) stream.match(cur);
65
65
  }
@@ -34,7 +34,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
34
34
  var closers = wordRegexp(blockClosers);
35
35
  var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
36
36
  var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
37
- var indentInfo = null;
38
37
 
39
38
  function in_array(state) {
40
39
  var ch = cur_scope(state);
@@ -247,7 +246,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
247
246
  }
248
247
 
249
248
  function tokenLexer(stream, state) {
250
- indentInfo = null;
251
249
  var style = state.tokenize(stream, state);
252
250
  var current = stream.current();
253
251
 
@@ -24,8 +24,8 @@
24
24
  var nr = Rules[next_rule];
25
25
  if (nr.splice) {
26
26
  for (var i$ = 0; i$ < nr.length; ++i$) {
27
- var r = nr[i$], m;
28
- if (r.regex && (m = stream.match(r.regex))) {
27
+ var r = nr[i$];
28
+ if (r.regex && stream.match(r.regex)) {
29
29
  state.next = r.next || state.next;
30
30
  return r.token;
31
31
  }
@@ -0,0 +1,175 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ // Mathematica mode copyright (c) 2015 by Calin Barbat
5
+ // Based on code by Patrick Scheibe (halirutan)
6
+ // See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js
7
+
8
+ (function(mod) {
9
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
10
+ mod(require("../../lib/codemirror"));
11
+ else if (typeof define == "function" && define.amd) // AMD
12
+ define(["../../lib/codemirror"], mod);
13
+ else // Plain browser env
14
+ mod(CodeMirror);
15
+ })(function(CodeMirror) {
16
+ "use strict";
17
+
18
+ CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
19
+
20
+ // used pattern building blocks
21
+ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*';
22
+ var pBase = "(?:\\d+)";
23
+ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)";
24
+ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)";
25
+ var pPrecision = "(?:`(?:`?"+pFloat+")?)";
26
+
27
+ // regular expressions
28
+ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))');
29
+ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)');
30
+ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');
31
+
32
+ function tokenBase(stream, state) {
33
+ var ch;
34
+
35
+ // get next character
36
+ ch = stream.next();
37
+
38
+ // string
39
+ if (ch === '"') {
40
+ state.tokenize = tokenString;
41
+ return state.tokenize(stream, state);
42
+ }
43
+
44
+ // comment
45
+ if (ch === '(') {
46
+ if (stream.eat('*')) {
47
+ state.commentLevel++;
48
+ state.tokenize = tokenComment;
49
+ return state.tokenize(stream, state);
50
+ }
51
+ }
52
+
53
+ // go back one character
54
+ stream.backUp(1);
55
+
56
+ // look for numbers
57
+ // Numbers in a baseform
58
+ if (stream.match(reBaseForm, true, false)) {
59
+ return 'number';
60
+ }
61
+
62
+ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition
63
+ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.
64
+ if (stream.match(reFloatForm, true, false)) {
65
+ return 'number';
66
+ }
67
+
68
+ /* In[23] and Out[34] */
69
+ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) {
70
+ return 'atom';
71
+ }
72
+
73
+ // usage
74
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
75
+ return 'meta';
76
+ }
77
+
78
+ // message
79
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
80
+ return 'string-2';
81
+ }
82
+
83
+ // this makes a look-ahead match for something like variable:{_Integer}
84
+ // the match is then forwarded to the mma-patterns tokenizer.
85
+ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) {
86
+ return 'variable-2';
87
+ }
88
+
89
+ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)
90
+ // Cannot start with a number, but can have numbers at any other position. Examples
91
+ // blub__Integer, a1_, b34_Integer32
92
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
93
+ return 'variable-2';
94
+ }
95
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) {
96
+ return 'variable-2';
97
+ }
98
+ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
99
+ return 'variable-2';
100
+ }
101
+
102
+ // Named characters in Mathematica, like \[Gamma].
103
+ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) {
104
+ return 'variable-3';
105
+ }
106
+
107
+ // Match all braces separately
108
+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
109
+ return 'bracket';
110
+ }
111
+
112
+ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match
113
+ // only one.
114
+ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) {
115
+ return 'variable-2';
116
+ }
117
+
118
+ // Literals like variables, keywords, functions
119
+ if (stream.match(reIdInContext, true, false)) {
120
+ return 'keyword';
121
+ }
122
+
123
+ // operators. Note that operators like @@ or /; are matched separately for each symbol.
124
+ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
125
+ return 'operator';
126
+ }
127
+
128
+ // everything else is an error
129
+ return 'error';
130
+ }
131
+
132
+ function tokenString(stream, state) {
133
+ var next, end = false, escaped = false;
134
+ while ((next = stream.next()) != null) {
135
+ if (next === '"' && !escaped) {
136
+ end = true;
137
+ break;
138
+ }
139
+ escaped = !escaped && next === '\\';
140
+ }
141
+ if (end && !escaped) {
142
+ state.tokenize = tokenBase;
143
+ }
144
+ return 'string';
145
+ };
146
+
147
+ function tokenComment(stream, state) {
148
+ var prev, next;
149
+ while(state.commentLevel > 0 && (next = stream.next()) != null) {
150
+ if (prev === '(' && next === '*') state.commentLevel++;
151
+ if (prev === '*' && next === ')') state.commentLevel--;
152
+ prev = next;
153
+ }
154
+ if (state.commentLevel <= 0) {
155
+ state.tokenize = tokenBase;
156
+ }
157
+ return 'comment';
158
+ }
159
+
160
+ return {
161
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
162
+ token: function(stream, state) {
163
+ if (stream.eatSpace()) return null;
164
+ return state.tokenize(stream, state);
165
+ },
166
+ blockCommentStart: "(*",
167
+ blockCommentEnd: "*)"
168
+ };
169
+ });
170
+
171
+ CodeMirror.defineMIME('text/x-mathematica', {
172
+ name: 'mathematica'
173
+ });
174
+
175
+ });
@@ -94,6 +94,7 @@
94
94
  helperType: "php",
95
95
  keywords: keywords(phpKeywords),
96
96
  blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
97
+ defKeywords: keywords("class function interface namespace trait"),
97
98
  atoms: keywords(phpAtoms),
98
99
  builtin: keywords(phpBuiltin),
99
100
  multiLineStrings: true,
@@ -30,12 +30,6 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
30
30
  return f(stream, state);
31
31
  }
32
32
 
33
- var type;
34
- function ret(tp, style) {
35
- type = tp;
36
- return style;
37
- }
38
-
39
33
  function tokenComment(stream, state) {
40
34
  var isEnd = false;
41
35
  var ch;
@@ -46,7 +40,7 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
46
40
  }
47
41
  isEnd = (ch == "*");
48
42
  }
49
- return ret("comment", "comment");
43
+ return "comment";
50
44
  }
51
45
 
52
46
  function tokenString(quote) {
@@ -60,10 +54,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
60
54
  }
61
55
  if (end || !(escaped || multiLineStrings))
62
56
  state.tokenize = tokenBase;
63
- return ret("string", "error");
57
+ return "error";
64
58
  };
65
59
  }
66
60
 
61
+
67
62
  function tokenBase(stream, state) {
68
63
  var ch = stream.next();
69
64
 
@@ -72,11 +67,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
72
67
  return chain(stream, state, tokenString(ch));
73
68
  // is it one of the special chars
74
69
  else if(/[\[\]{}\(\),;\.]/.test(ch))
75
- return ret(ch);
70
+ return null;
76
71
  // is it a number?
77
72
  else if(/\d/.test(ch)) {
78
73
  stream.eatWhile(/[\w\.]/);
79
- return ret("number", "number");
74
+ return "number";
80
75
  }
81
76
  // multi line comment or operator
82
77
  else if (ch == "/") {
@@ -85,47 +80,42 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
85
80
  }
86
81
  else {
87
82
  stream.eatWhile(isOperatorChar);
88
- return ret("operator", "operator");
83
+ return "operator";
89
84
  }
90
85
  }
91
86
  // single line comment or operator
92
87
  else if (ch=="-") {
93
88
  if(stream.eat("-")){
94
89
  stream.skipToEnd();
95
- return ret("comment", "comment");
90
+ return "comment";
96
91
  }
97
92
  else {
98
93
  stream.eatWhile(isOperatorChar);
99
- return ret("operator", "operator");
94
+ return "operator";
100
95
  }
101
96
  }
102
97
  // is it an operator
103
98
  else if (isOperatorChar.test(ch)) {
104
99
  stream.eatWhile(isOperatorChar);
105
- return ret("operator", "operator");
100
+ return "operator";
106
101
  }
107
102
  else {
108
103
  // get the while word
109
104
  stream.eatWhile(/[\w\$_]/);
110
105
  // is it one of the listed keywords?
111
106
  if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
112
- if (stream.eat(")") || stream.eat(".")) {
113
- //keywords can be used as variables like flatten(group), group.$0 etc..
114
- }
115
- else {
116
- return ("keyword", "keyword");
117
- }
107
+ //keywords can be used as variables like flatten(group), group.$0 etc..
108
+ if (!stream.eat(")") && !stream.eat("."))
109
+ return "keyword";
118
110
  }
119
111
  // is it one of the builtin functions?
120
112
  if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase()))
121
- {
122
- return ("keyword", "variable-2");
123
- }
113
+ return "variable-2";
124
114
  // is it one of the listed types?
125
115
  if (types && types.propertyIsEnumerable(stream.current().toUpperCase()))
126
- return ("keyword", "variable-3");
116
+ return "variable-3";
127
117
  // default is a 'variable'
128
- return ret("variable", "pig-word");
118
+ return "variable";
129
119
  }
130
120
  }
131
121