Skip to content

Fix: parsing ident starting with underscore in certain dialects #1835

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MohamedAbdeen21
Copy link
Contributor

@MohamedAbdeen21 MohamedAbdeen21 commented Apr 30, 2025

The dialects that support underscore as a separator in numeric literals used to parse ._123 as a number, idk if that's valid SQL, but it's fine. However, that means that something like ._abc would be parsed as Number ._ and word abc, which is wrong.

This PR splits the tokenizer match branch for numbers and periods into two branches to make things easier, fixes the issue mentioned above, and adds tests.

CC: @mvzink

The dialects that support underscore as a separator in numeric literals
used to parse ._123 as a number, meaning that an identifier like
._abc would be parsed as Number `._` and word `abc`, which is
obv wrong.

This PR splits the tokenizer branch for numbers and periods into
two branches to make things easier, fixes the issue mentioned above
and adds tests.
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.

1 participant