(quote)
| 64 | } |
| 65 | |
| 66 | function tokenString(quote) { |
| 67 | return function(stream, state) { |
| 68 | var next, end = false, escaped = false; |
| 69 | while ((next = stream.next()) != null) { |
| 70 | if (next === quote && !escaped) { |
| 71 | end = true; |
| 72 | break; |
| 73 | } |
| 74 | if (next === '$' && !escaped && quote !== '\'') { |
| 75 | escaped = true; |
| 76 | stream.backUp(1); |
| 77 | state.tokens.unshift(tokenDollar); |
| 78 | break; |
| 79 | } |
| 80 | escaped = !escaped && next === '\\'; |
| 81 | } |
| 82 | if (end || !escaped) { |
| 83 | state.tokens.shift(); |
| 84 | } |
| 85 | return (quote === '`' || quote === ')' ? 'quote' : 'string'); |
| 86 | }; |
| 87 | }; |
| 88 | |
| 89 | var tokenDollar = function(stream, state) { |
| 90 | if (state.tokens.length > 1) stream.eat('$'); |
no test coverage detected