st3v3nmw/c-compiler

Addition of negatives

Closed this issue · 1 comments

int y = 9+-8;

Current Output:

int y = 9+-8;
         ^^
Unexpected token +-8 on line 0
keyword -> int
identifier -> y
operator -> =
integer literal -> 9
separator -> ;

Correct Output:

keyword -> int
identifier -> y
operator -> =
integer literal -> 9
operator -> +
integer literal -> -8
separator -> ;

Related issue: #4

Fixed in #15