diff options
author | Pushkar Joshi | 2012-03-06 17:05:05 -0800 |
---|---|---|
committer | Pushkar Joshi | 2012-03-06 17:05:05 -0800 |
commit | 794abd077a0cd4c797d3f566281deca77b184bfe (patch) | |
tree | 3bf4a83ca714def2671fe8cef93db859b0d5553f /imports/codemirror/mode/smalltalk/smalltalk.js | |
parent | c155cd238b6f9e0b8191e0fc533f7bc974b762c2 (diff) | |
parent | 2e3943a8f751ec572066f168b58464c24b9f29e5 (diff) | |
download | ninja-794abd077a0cd4c797d3f566281deca77b184bfe.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'imports/codemirror/mode/smalltalk/smalltalk.js')
-rw-r--r--[-rwxr-xr-x] | imports/codemirror/mode/smalltalk/smalltalk.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/imports/codemirror/mode/smalltalk/smalltalk.js b/imports/codemirror/mode/smalltalk/smalltalk.js index e002e666..e5893322 100755..100644 --- a/imports/codemirror/mode/smalltalk/smalltalk.js +++ b/imports/codemirror/mode/smalltalk/smalltalk.js | |||
@@ -27,45 +27,45 @@ CodeMirror.defineMode('smalltalk', function(config, modeConfig) { | |||
27 | 27 | ||
28 | var next = function(stream, context, state) { | 28 | var next = function(stream, context, state) { |
29 | var token = new Token(null, context, false); | 29 | var token = new Token(null, context, false); |
30 | var char = stream.next(); | 30 | var aChar = stream.next(); |
31 | 31 | ||
32 | if (char === '"') { | 32 | if (aChar === '"') { |
33 | token = nextComment(stream, new Context(nextComment, context)); | 33 | token = nextComment(stream, new Context(nextComment, context)); |
34 | 34 | ||
35 | } else if (char === '\'') { | 35 | } else if (aChar === '\'') { |
36 | token = nextString(stream, new Context(nextString, context)); | 36 | token = nextString(stream, new Context(nextString, context)); |
37 | 37 | ||
38 | } else if (char === '#') { | 38 | } else if (aChar === '#') { |
39 | stream.eatWhile(/[^ .]/); | 39 | stream.eatWhile(/[^ .]/); |
40 | token.name = 'string-2'; | 40 | token.name = 'string-2'; |
41 | 41 | ||
42 | } else if (char === '$') { | 42 | } else if (aChar === '$') { |
43 | stream.eatWhile(/[^ ]/); | 43 | stream.eatWhile(/[^ ]/); |
44 | token.name = 'string-2'; | 44 | token.name = 'string-2'; |
45 | 45 | ||
46 | } else if (char === '|' && state.expectVariable) { | 46 | } else if (aChar === '|' && state.expectVariable) { |
47 | token.context = new Context(nextTemporaries, context); | 47 | token.context = new Context(nextTemporaries, context); |
48 | 48 | ||
49 | } else if (/[\[\]{}()]/.test(char)) { | 49 | } else if (/[\[\]{}()]/.test(aChar)) { |
50 | token.name = 'bracket'; | 50 | token.name = 'bracket'; |
51 | token.eos = /[\[{(]/.test(char); | 51 | token.eos = /[\[{(]/.test(aChar); |
52 | 52 | ||
53 | if (char === '[') { | 53 | if (aChar === '[') { |
54 | state.indentation++; | 54 | state.indentation++; |
55 | } else if (char === ']') { | 55 | } else if (aChar === ']') { |
56 | state.indentation = Math.max(0, state.indentation - 1); | 56 | state.indentation = Math.max(0, state.indentation - 1); |
57 | } | 57 | } |
58 | 58 | ||
59 | } else if (specialChars.test(char)) { | 59 | } else if (specialChars.test(aChar)) { |
60 | stream.eatWhile(specialChars); | 60 | stream.eatWhile(specialChars); |
61 | token.name = 'operator'; | 61 | token.name = 'operator'; |
62 | token.eos = char !== ';'; // ; cascaded message expression | 62 | token.eos = aChar !== ';'; // ; cascaded message expression |
63 | 63 | ||
64 | } else if (/\d/.test(char)) { | 64 | } else if (/\d/.test(aChar)) { |
65 | stream.eatWhile(/[\w\d]/); | 65 | stream.eatWhile(/[\w\d]/); |
66 | token.name = 'number' | 66 | token.name = 'number' |
67 | 67 | ||
68 | } else if (/[\w_]/.test(char)) { | 68 | } else if (/[\w_]/.test(aChar)) { |
69 | stream.eatWhile(/[\w\d_]/); | 69 | stream.eatWhile(/[\w\d_]/); |
70 | token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; | 70 | token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; |
71 | 71 | ||
@@ -88,9 +88,9 @@ CodeMirror.defineMode('smalltalk', function(config, modeConfig) { | |||
88 | 88 | ||
89 | var nextTemporaries = function(stream, context, state) { | 89 | var nextTemporaries = function(stream, context, state) { |
90 | var token = new Token(null, context, false); | 90 | var token = new Token(null, context, false); |
91 | var char = stream.next(); | 91 | var aChar = stream.next(); |
92 | 92 | ||
93 | if (char === '|') { | 93 | if (aChar === '|') { |
94 | token.context = context.parent; | 94 | token.context = context.parent; |
95 | token.eos = true; | 95 | token.eos = true; |
96 | 96 | ||