mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-19 01:28:40 +00:00
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:
committed by
Kevin Barabash
parent
50d120d614
commit
2f88abed98
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user