-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix!: tokenize keywords and identifiers correctly #428
base: main
Are you sure you want to change the base?
Conversation
We now fail on `muta`
This prevents `BITS` from being treated as the keyword `BIT` followed by the identifier `S`.
We could have resolved this the other way, by marking these keywords as reserved, but the Quil spec doesn't allow for `NaN` or `Infinity` and I think this is more useful for our purposes.
Note: These failures don't necessarily block the PR but both authors and reviewers should check the results for unintentional breaking changes. |
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.
Really clean changes! LGTM pending CI errors
7117504
to
3b9cbd0
Compare
|
Note: These failures don't necessarily block the PR but both authors and reviewers should check the results for unintentional breaking changes. |
1 similar comment
Note: These failures don't necessarily block the PR but both authors and reviewers should check the results for unintentional breaking changes. |
Fix the tokenization of identifiers and keywords so that keywords are not parsed within word boundaries. Previously,
BITS
would be parsed as the data typeBIT
followed by the identifierS
; now, it is correctly parsed as the single identifierBITS
.This also fixes the tokenization of
NaN
,Inf
, andInfinity
; previously, these were case-insensitively parsed as floats (with the same incorrect prefix behavior, sonana
would parse as the floatNaN
followed by the identifiera
), but now they are correctly parsed as normal identifiers.Closes #427