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

Sync lexer punctuations with ZetaSQL #182

Conversation

apstndb
Copy link
Contributor

@apstndb apstndb commented Oct 27, 2024

This PR adds all ZetaSQL punctuations as memefish tokens.

MACRO_* are not yet implemented because they are not yet used and can be tokenized as "$" Ident, "$" IntLiteral, but they are not trivial to implement.

fixes #181

@@ -132,7 +145,6 @@ var lexerWrongTestCase = []struct {
pos Pos
message string
}{
{"?", 0, "illegal input character: '?'"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it hard to rewrite this test instead of removing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think there is no ASCII printable character remaining.
If we want to leave illegal character test case, we need to use unprintable character or some unicode chatecters.

I would try to use \b(beep character)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@makenowjust makenowjust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@makenowjust makenowjust merged commit e6a5352 into cloudspannerecosystem:main Oct 29, 2024
2 checks passed
@apstndb apstndb mentioned this pull request Nov 28, 2024
40 tasks
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.

Sync lexer punctuations with ZetaSQL
2 participants