(quote)
| 49 | } |
| 50 | |
| 51 | function tokenString(quote) { |
| 52 | return function(stream, state) { |
| 53 | var next, end = false, escaped = false; |
| 54 | while ((next = stream.next()) != null) { |
| 55 | if (next === quote && !escaped) { |
| 56 | end = true; |
| 57 | break; |
| 58 | } |
| 59 | if (next === '$' && !escaped && quote !== '\'') { |
| 60 | escaped = true; |
| 61 | stream.backUp(1); |
| 62 | state.tokens.unshift(tokenDollar); |
| 63 | break; |
| 64 | } |
| 65 | escaped = !escaped && next === '\\'; |
| 66 | } |
| 67 | if (end || !escaped) { |
| 68 | state.tokens.shift(); |
| 69 | } |
| 70 | return (quote === '`' || quote === ')' ? 'quote' : 'string'); |
| 71 | }; |
| 72 | }; |
| 73 | |
| 74 | var tokenDollar = function(stream, state) { |
| 75 | if (state.tokens.length > 1) stream.eat('$'); |
no outgoing calls
no test coverage detected