(ch)
| 55 | } |
| 56 | |
| 57 | function tokenWord(ch) { |
| 58 | return function(stream, state) { |
| 59 | var word = ch; |
| 60 | while ((ch = stream.peek()) && ch.match(isStringChar) != null) { |
| 61 | word += stream.next(); |
| 62 | } |
| 63 | |
| 64 | state.tokenize = tokenBase; |
| 65 | if (isOperatorString.test(word)) |
| 66 | return "operator"; |
| 67 | else if (isNumber(word)) |
| 68 | return "number"; |
| 69 | else if (stream.peek() == ":") |
| 70 | return "field"; |
| 71 | else |
| 72 | return "string"; |
| 73 | }; |
| 74 | } |
| 75 | |
| 76 | function tokenBase(stream, state) { |
| 77 | var ch = stream.next(); |