partiql / partiql-lang-kotlin

PartiQL libraries and tools in Kotlin.
https://partiql.org/
Apache License 2.0
538 stars 60 forks source link

Negative numeric literals are wrapped in unary operators. #1482

Open RCHowell opened 3 months ago

RCHowell commented 3 months ago

Description

Given a numeric literal like -1, this becomes an AST like unary_minus(literal(1)) which has strange downstream implications. The desired behavior is to have the sign as part of the literal like literal(-1).

To Reproduce

Steps to reproduce the behavior:

I noticed when pretty-printing I got -(1) back rather than -1.

Expected Behavior

-1

-- AST literal(-1)

Additional Context