Ensure that the original state is restored on lookahead - fixes #2086

This commit is contained in:
Logan Smyth
2015-07-26 20:48:40 -07:00
parent 507303456f
commit 0bfc5a90dc
4 changed files with 195 additions and 1 deletions

View File

@@ -91,7 +91,8 @@ export default class Tokenizer {
// TODO
lookahead() {
var old = this.state.clone();
var old = this.state;
this.state = old.clone();
this.next();
var curr = this.state.clone();
this.state = old;