| 45 | // If a variable is encountered along the way, we display it differently when it |
| 46 | // is encapsulated in a double-quoted string. |
| 47 | function tokenString(stream, state) { |
| 48 | var current, prev, found_var = false; |
| 49 | while (!stream.eol() && (current = stream.next()) != state.pending) { |
| 50 | if (current === '$' && prev != '\\' && state.pending == '"') { |
| 51 | found_var = true; |
| 52 | break; |
| 53 | } |
| 54 | prev = current; |
| 55 | } |
| 56 | if (found_var) { |
| 57 | stream.backUp(1); |
| 58 | } |
| 59 | if (current == state.pending) { |
| 60 | state.continueString = false; |
| 61 | } else { |
| 62 | state.continueString = true; |
| 63 | } |
| 64 | return "string"; |
| 65 | } |
| 66 | |
| 67 | // Main function |
| 68 | function tokenize(stream, state) { |