| 64 | tokenBase.isBase = true; |
| 65 | |
| 66 | function startString(quote, stream, state) { |
| 67 | var tripleQuoted = false; |
| 68 | if (quote != "/" && stream.eat(quote)) { |
| 69 | if (stream.eat(quote)) tripleQuoted = true; |
| 70 | else return "string"; |
| 71 | } |
| 72 | function t(stream, state) { |
| 73 | var escaped = false, next, end = !tripleQuoted; |
| 74 | while ((next = stream.next()) != null) { |
| 75 | if (next == quote && !escaped) { |
| 76 | if (!tripleQuoted) { break; } |
| 77 | if (stream.match(quote + quote)) { end = true; break; } |
| 78 | } |
| 79 | if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { |
| 80 | state.tokenize.push(tokenBaseUntilBrace()); |
| 81 | return "string"; |
| 82 | } |
| 83 | escaped = !escaped && next == "\\"; |
| 84 | } |
| 85 | if (end) state.tokenize.pop(); |
| 86 | return "string"; |
| 87 | } |
| 88 | state.tokenize.push(t); |
| 89 | return t(stream, state); |
| 90 | } |
| 91 | |
| 92 | function tokenBaseUntilBrace() { |
| 93 | var depth = 1; |