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

Parse quote identifiers #24

Merged
merged 10 commits into from
Sep 5, 2023
Merged

Parse quote identifiers #24

merged 10 commits into from
Sep 5, 2023

Conversation

rachitnigam
Copy link
Contributor

Fixes #23.

@rachitnigam
Copy link
Contributor Author

Just tagging @elliottt for a review

Copy link
Owner

@elliottt elliottt left a 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!

Comment on lines +409 to +411
// NOTE(rachitnigam): Not sure if this is the best way to signal an
// error in the lexer.
assert!(!quoted, "unterminated | in symbol");
Copy link
Owner

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.

Copy link
Contributor Author

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!

Comment on lines +393 to +397
} else if *c == '|' {
// If we see a quote, toggle the quoted flag.
quoted = !quoted;
self.indices.next();
continue;
Copy link
Owner

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 👍

Copy link
Contributor Author

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.

@rachitnigam
Copy link
Contributor Author

Can we do a new release once this is merged?

@elliottt elliottt merged commit accd7e3 into elliottt:main Sep 5, 2023
1 check passed
@elliottt elliottt mentioned this pull request Sep 5, 2023
elliottt added a commit that referenced this pull request Sep 5, 2023
Minor version bump to include the bug fix in #24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when parsing quoted identifiers
2 participants