Skip to content

Negative numeric literals are wrapped in unary operators. #1482

Open
@rchowell

Description

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

  • Java version: 11
  • PartiQL version: 0.14.5

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions