mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Moo lexer.reset returns a reference to the Lexer instance (#42587)
This commit is contained in:
2
types/moo/index.d.ts
vendored
2
types/moo/index.d.ts
vendored
@@ -90,7 +90,7 @@ export interface Lexer {
|
||||
/**
|
||||
* Empty the internal buffer of the lexer, and set the line, column, and offset counts back to their initial value.
|
||||
*/
|
||||
reset(chunk?: string, state?: LexerState): void;
|
||||
reset(chunk?: string, state?: LexerState): this;
|
||||
/**
|
||||
* Returns current state, which you can later pass it as the second argument
|
||||
* to reset() to explicitly control the internal state of the lexer.
|
||||
|
||||
@@ -77,6 +77,8 @@ lexer.next();
|
||||
lexer.reset('a different line\n', info);
|
||||
lexer.next();
|
||||
|
||||
Array.from(lexer.reset('lex this'));
|
||||
|
||||
// Transform: https://github.com/no-context/moo#transform
|
||||
moo.compile({
|
||||
STRING: [
|
||||
|
||||
Reference in New Issue
Block a user