-
Notifications
You must be signed in to change notification settings - Fork 72
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
potential lookahead lexer bug? #158
Comments
Which would imply that the implementation here has a potential bug, as it assumed that the reference implementation was flawed: GraphQL/Sources/GraphQL/Language/Lexer.swift Lines 137 to 141 in 5e098b3
|
Basically, when the comment says the lexer start is not changed, I think it means with respect to the current token only, but not with respect to other internal state. In fact, I think there is an optimization that means additional lexer state can and must change. Specifically, when we look ahead, we save the next token within the linked list, even though we don't modify the current token pointer, such that when we Considering that we never re-lex a token, the line and start position of the line within the body must be permanently advanced by I don't see the corresponding |
Revisiting graphql/graphql-js#2764
I'm not quite sure the reference implementation has a bug, see failing test when implementing the fix as advised:
graphql/graphql-js#4293
The text was updated successfully, but these errors were encountered: