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

fix(spanner/spansql): fix parsing of unary minus #2997

Merged
merged 1 commit into from
Oct 14, 2020
Merged

fix(spanner/spansql): fix parsing of unary minus #2997

merged 1 commit into from
Oct 14, 2020

Conversation

dsymonds
Copy link
Contributor

We cannot tokenise numbers with leading signs, because otherwise
ID+100 is parsed as the identifier ID followed by the literal +100
instead of an arithmetic operation. This necessitates some rearrangement
of the parsing of int64 literals to accommodate that while also
preserving the ability to parse -INT_MAX.

@dsymonds dsymonds added the api: spanner Issues related to the Spanner API. label Oct 11, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 11, 2020
Copy link
Contributor

@olavloite olavloite left a comment

Choose a reason for hiding this comment

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

See comment on unary plus, otherwise LGTM.

spanner/spansql/parser.go Outdated Show resolved Hide resolved
spanner/spansql/parser_test.go Outdated Show resolved Hide resolved
We cannot tokenise numbers with leading signs, because otherwise
`ID+100` is parsed as the identifier `ID` followed by the literal `+100`
instead of an arithmetic operation. This necessitates some rearrangement
of the parsing of int64 literals to accommodate that while also
preserving the ability to parse -INT_MAX.
@dsymonds dsymonds merged commit 3fb19a5 into googleapis:master Oct 14, 2020
@dsymonds dsymonds deleted the spansql-parse-unary branch October 14, 2020 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants