| 31 | } |
| 32 | |
| 33 | function tokenUntil(stream, state, untilRegExp) { |
| 34 | var oldString = stream.string; |
| 35 | var match = untilRegExp.exec(oldString.substr(stream.pos)); |
| 36 | if (match) { |
| 37 | // We don't use backUp because it backs up just the position, not the state. |
| 38 | // This uses an undocumented API. |
| 39 | stream.string = oldString.substr(0, stream.pos + match.index); |
| 40 | } |
| 41 | var result = stream.hideFirstChars(state.indent, function() { |
| 42 | return state.localMode.token(stream, state.localState); |
| 43 | }); |
| 44 | stream.string = oldString; |
| 45 | return result; |
| 46 | } |
| 47 | |
| 48 | return { |
| 49 | startState: function() { |