| 79 | } |
| 80 | |
| 81 | function tokenString(quote) { |
| 82 | return function(stream, state) { |
| 83 | if (stream.eat("\\")) { |
| 84 | var ch = stream.next(); |
| 85 | if (ch == "x") stream.match(/^[a-f0-9]{2}/i); |
| 86 | else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); |
| 87 | else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); |
| 88 | else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); |
| 89 | else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); |
| 90 | return "string-2"; |
| 91 | } else { |
| 92 | var next; |
| 93 | while ((next = stream.next()) != null) { |
| 94 | if (next == quote) { state.tokenize = tokenBase; break; } |
| 95 | if (next == "\\") { stream.backUp(1); break; } |
| 96 | } |
| 97 | return "string"; |
| 98 | } |
| 99 | }; |
| 100 | } |
| 101 | |
| 102 | function push(state, type, stream) { |
| 103 | state.ctx = {type: type, |