-
Notifications
You must be signed in to change notification settings - Fork 6
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
Parse quote identifiers #24
Conversation
Just tagging @elliottt for a review |
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 looks good to me, thanks for fixing this!
// NOTE(rachitnigam): Not sure if this is the best way to signal an | ||
// error in the lexer. | ||
assert!(!quoted, "unterminated | in symbol"); |
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.
Good point! We didn't really have any parse errors before, given how permissive the symbol parsing was, so it would be nice to revisit that in a follow-up PR.
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.
Yeah, some simple API to report the errors would be useful!
} else if *c == '|' { | ||
// If we see a quote, toggle the quoted flag. | ||
quoted = !quoted; | ||
self.indices.next(); | ||
continue; |
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.
Is it possible to escape the quotes? If not, this state machine seems reasonable to me 👍
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.
I don't think so? The quoted identifiers are specified as not containing |
so I imagine you can't escape but I am also new to the feature.
Can we do a new release once this is merged? |
Minor version bump to include the bug fix in #24.
Fixes #23.