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

added support for decimal values without leading digits #794

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

jagmitswami
Copy link
Contributor

@jagmitswami jagmitswami commented Oct 25, 2024

Encountered issue while handling decimal values without leading digits (for example .00457). Lexer was breaking, updated number token regex to support the similar cases and added a corresponding test case.

Sample SQL query: SELECT employee_id FROM employees WHERE salary > .456 * 1000000 AND bonus < .0000239 * salary;

An Unexpected Error Occurred
Parse error at token: 456 at line 1 column 51 Unexpected NUMBER token: {"type":"NUMBER","raw":"456","text":"456","start":50}

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@nene
Copy link
Collaborator

nene commented Oct 25, 2024

Thanks a lot!

@nene nene merged commit 472e17b into sql-formatter-org:master Oct 25, 2024
2 checks passed
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.

2 participants