-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump soft keyword as name token (#11459)
## Summary This PR updates various `bump` methods to allow parser to bump the soft keyword as a name token. This is required because the token vector should store the resolved token. Otherwise, the token vector and the AST are out of sync. The process is as follows: * One common method to bump the given kind for the parser which is `do_bump` * This calls in the `bump` method on the token source * The token source adds the given token kind and bump itself to the next non-trivia token * While doing this bump, it still adds the trivia tokens to the token vector The end result is that the parser informs the token source to add the given kind to the token vector and move on to the next token. Here, we can then introduce a `bump_soft_keyword_as_name` method which asserts that the current token is a soft keyword and bumps it as a name token instead. The `parse_identifier` method then calls the new method instead.
- Loading branch information
1 parent
08f881b
commit 30ecb9c
Showing
3 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters