| 77 | tokenBase.isBase = true; |
| 78 | |
| 79 | function startString(quote, stream, state) { |
| 80 | var tripleQuoted = false; |
| 81 | if (quote != "/" && stream.eat(quote)) { |
| 82 | if (stream.eat(quote)) tripleQuoted = true; |
| 83 | else return "string"; |
| 84 | } |
| 85 | function t(stream, state) { |
| 86 | var escaped = false, next, end = !tripleQuoted; |
| 87 | while ((next = stream.next()) != null) { |
| 88 | if (next == quote && !escaped) { |
| 89 | if (!tripleQuoted) { break; } |
| 90 | if (stream.match(quote + quote)) { end = true; break; } |
| 91 | } |
| 92 | if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { |
| 93 | state.tokenize.push(tokenBaseUntilBrace()); |
| 94 | return "string"; |
| 95 | } |
| 96 | escaped = !escaped && next == "\\"; |
| 97 | } |
| 98 | if (end) state.tokenize.pop(); |
| 99 | return "string"; |
| 100 | } |
| 101 | state.tokenize.push(t); |
| 102 | return t(stream, state); |
| 103 | } |
| 104 | |
| 105 | function tokenBaseUntilBrace() { |
| 106 | var depth = 1; |