Skip to content

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