mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
fix(moo): Add missing Lexer methods (#43477)
This commit is contained in:
parent
41315ef7af
commit
1ed6fe521f
13
types/moo/index.d.ts
vendored
13
types/moo/index.d.ts
vendored
@ -96,6 +96,19 @@ export interface Lexer {
|
||||
* to reset() to explicitly control the internal state of the lexer.
|
||||
*/
|
||||
save(): LexerState;
|
||||
/**
|
||||
* Transitions to the provided state and pushes the state onto the state
|
||||
* stack.
|
||||
*/
|
||||
pushState(state: string): void;
|
||||
/**
|
||||
* Returns back to the previous state in the stack.
|
||||
*/
|
||||
popState(): void;
|
||||
/**
|
||||
* Transitiosn to the provided state. Does not push onto the state stack.
|
||||
*/
|
||||
setState(state: string): void;
|
||||
|
||||
[Symbol.iterator](): Iterator<Token>;
|
||||
}
|
||||
|
||||
@ -55,6 +55,11 @@ lexer = moo.states({
|
||||
},
|
||||
});
|
||||
|
||||
lexer.pushState('lit');
|
||||
lexer.popState();
|
||||
lexer.setState('lit');
|
||||
lexer.popState();
|
||||
|
||||
moo.compile({
|
||||
myError: moo.error
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user