Skip to content

Support float literals: Nan, Inf, Infinity #23

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: master
Choose a base branch
from

Conversation

nafraf
Copy link

@nafraf nafraf commented Mar 14, 2023

This PR is to support float literals (Nan, Inf, Infinity), this is part of the solution to redisgraph issue Support isNaN function and Inf, Infinity, and NaN literals.

cypher-lint sample output:

$ echo 'RETURN NaN' | ./cypher-lint -a -1
@0  0..11  statement           body=@1
@1  0..11  > query             clauses=[@2]
@2  0..11  > > RETURN          projections=[@3]
@3  7..11  > > > projection    expression=@4, alias=@5
@4  7..10  > > > > NAN
@5  7..11  > > > > identifier  `NaN`
$ echo 'RETURN Inf' | ./cypher-lint -a -1
@0  0..11  statement           body=@1
@1  0..11  > query             clauses=[@2]
@2  0..11  > > RETURN          projections=[@3]
@3  7..11  > > > projection    expression=@4, alias=@5
@4  7..10  > > > > INF
@5  7..11  > > > > identifier  `Inf`
$ echo 'RETURN INFINITY' | ./cypher-lint -a -1
@0  0..16  statement           body=@1
@1  0..16  > query             clauses=[@2]
@2  0..16  > > RETURN          projections=[@3]
@3  7..16  > > > projection    expression=@4, alias=@5
@4  7..15  > > > > INF
@5  7..16  > > > > identifier  `INFINITY`

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