Simplify get() now that we don't need it to ignorespaces (#928)

* Simplify get() now that we don't need it to ignorespaces

Continuation of #912

* Remove commented-out code

* Drop get() alias, rename unget() to pushToken(), use it
This commit is contained in:
Erik Demaine
2017-10-15 12:33:13 -04:00
committed by Kevin Barabash
parent 50d120d614
commit 2f88abed98
2 changed files with 7 additions and 38 deletions

View File

@@ -140,17 +140,14 @@ export default class Parser {
* and fetches the one after that as the new look ahead.
*/
consume() {
this.nextToken = this.gullet.get(false);
this.nextToken = this.gullet.expandNextToken();
}
/**
* Switches between "text" and "math" modes, reconsuming nextToken
* in case it would be read differently in the new mode.
* Switches between "text" and "math" modes.
*/
switchMode(newMode) {
this.gullet.unget(this.nextToken);
this.mode = newMode;
this.consume();
}
/**