(quote)
| 82 | } |
| 83 | |
| 84 | function tokenString(quote) { |
| 85 | return function(stream, state) { |
| 86 | var next, end = false, escaped = false; |
| 87 | while ((next = stream.next()) != null) { |
| 88 | if (next === quote && !escaped) { |
| 89 | end = true; |
| 90 | break; |
| 91 | } |
| 92 | if (next === '$' && !escaped && quote !== '\'') { |
| 93 | escaped = true; |
| 94 | stream.backUp(1); |
| 95 | state.tokens.unshift(tokenDollar); |
| 96 | break; |
| 97 | } |
| 98 | escaped = !escaped && next === '\\'; |
| 99 | } |
| 100 | if (end || !escaped) { |
| 101 | state.tokens.shift(); |
| 102 | } |
| 103 | return (quote === '`' || quote === ')' ? 'quote' : 'string'); |
| 104 | }; |
| 105 | }; |
| 106 | |
| 107 | var tokenDollar = function(stream, state) { |
| 108 | if (state.tokens.length > 1) stream.eat('$'); |
no outgoing calls
no test coverage detected