Skip to content
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

Use lookahead to resolve type soft keyword #11442

Merged
merged 4 commits into from
May 21, 2024

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented May 16, 2024

Summary

This PR updates the type alias statement parsing to use lookahead to resolve whether it's used as a keyword or as an identifier depending on the context.

The strategy here is that the first token should be either a name or a soft keyword and the second can be either a [ or =. Remember that type type = int is valid where the first type is a keyword while the second type is an identifier.

Base automatically changed from dhruv/parser-checkpoint to dhruv/parser-phase-2 May 17, 2024 11:37
@dhruvmanila dhruvmanila marked this pull request as ready for review May 20, 2024 06:41
@dhruvmanila dhruvmanila added the parser Related to the parser label May 21, 2024
@dhruvmanila dhruvmanila merged commit b75ad88 into dhruv/parser-phase-2 May 21, 2024
6 of 18 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/soft-keyword-type branch May 21, 2024 04:44
dhruvmanila added a commit that referenced this pull request May 23, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 23, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 24, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 27, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 28, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 30, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
dhruvmanila added a commit that referenced this pull request May 31, 2024
## Summary

This PR updates the `type` alias statement parsing to use lookahead to
resolve whether it's used as a keyword or as an identifier depending on
the context.

The strategy here is that the first token should be either a name or a
soft keyword and the second can be either a `[` or `=`. Remember that
`type type = int` is valid where the first `type` is a keyword while the
second `type` is an identifier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Related to the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants