diff --git a/types/moo/index.d.ts b/types/moo/index.d.ts index 2a952a8f34..1a8e9f18d4 100644 --- a/types/moo/index.d.ts +++ b/types/moo/index.d.ts @@ -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. diff --git a/types/moo/moo-tests.ts b/types/moo/moo-tests.ts index 5cb9fa6f5b..9de53e87ee 100644 --- a/types/moo/moo-tests.ts +++ b/types/moo/moo-tests.ts @@ -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: [