(quote, style)
| 91 | } |
| 92 | |
| 93 | function tokenString(quote, style) { |
| 94 | var close = quote == "(" ? ")" : quote == "{" ? "}" : quote |
| 95 | return function(stream, state) { |
| 96 | var next, escaped = false; |
| 97 | while ((next = stream.next()) != null) { |
| 98 | if (next === close && !escaped) { |
| 99 | state.tokens.shift(); |
| 100 | break; |
| 101 | } else if (next === '$' && !escaped && quote !== "'" && stream.peek() != close) { |
| 102 | escaped = true; |
| 103 | stream.backUp(1); |
| 104 | state.tokens.unshift(tokenDollar); |
| 105 | break; |
| 106 | } else if (!escaped && quote !== close && next === quote) { |
| 107 | state.tokens.unshift(tokenString(quote, style)) |
| 108 | return tokenize(stream, state) |
| 109 | } else if (!escaped && /['"]/.test(next) && !/['"]/.test(quote)) { |
| 110 | state.tokens.unshift(tokenStringStart(next, "string")); |
| 111 | stream.backUp(1); |
| 112 | break; |
| 113 | } |
| 114 | escaped = !escaped && next === '\\'; |
| 115 | } |
| 116 | return style; |
| 117 | }; |
| 118 | }; |
| 119 | |
| 120 | function tokenStringStart(quote, style) { |
| 121 | return function(stream, state) { |
no test coverage detected