Skip to content

Disambiguating unary and binary minus #1

@wh5a

Description

@wh5a

A statement like "cu1(-pi) q[0], q[1];" cannot be parsed correctly, unless we insert a space like so: "cu1(- pi) q[0], q[1];".

The grammar needs to be changed. A quick search found some discussions:
https://stackoverflow.com/questions/32166738/disambiguating-unary-and-binary-minus-in-antlr4-grammar
https://stackoverflow.com/questions/27478834/how-compiler-distinguishes-minus-and-negative-number-during-parser-process

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions