-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When parsing tokens with an instance of TokenStream, it is common to assert the token type then consume it. Currently that requires two method calls.
stream.expect(TokenType.IF)
stream.next() # move past `if`If we introduce TokenStream.eat(), which asserts the token type an consumes it, we can reduce that to one method call and be more efficient in its implementations.
const token = stream.eat(TokenType.IF)Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request