-
Notifications
You must be signed in to change notification settings - Fork 2k
Parser: Add 'skipKeyword' function #1545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser: Add 'skipKeyword' function #1545
Conversation
based on 'expectOptionalKeyword' from graphql#1541
@OlegIlyenko I had a few review comment about |
*/ | ||
function expectKeyword(lexer: Lexer<*>, value: string): Token { | ||
function skipKeyword(lexer: Lexer<*>, value: string): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we already have skip/expect pair with matching functionality I think we need to have skipKeyword/expectKeyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thanks!
I found the terminology around "skip" a bit confusing. "skip" by itself does not imply that the token is optional. So when i saw the usage of I personally believe that this part of code might benefit from Just my 2 cents. |
based on 'expectOptionalKeyword' from #1541