Closed Dalyj24 closed 3 weeks ago
@Dalyj24 What kind of token would you consider adding?
Here is my approach to unary vs binary operators worked out in pseudocode for '-'. In dealing with subtraction vs negative tokens for '-', these other binary cases (-= and --) should be handled as well (To cover all tokens with '-'). Currently, tokens do not exist for the following binary (-=,+=) and unary (--, ++) operators despite existing in the list of acceptable tokens. Similar logic should also extend to +, +=, and ++.
This may or may not be helpful for issue #57 @Dalyj24 :)
Details
Right now there's only one minus token and the parser can't distinguish between a unary and a binary - sign. This means that something like "5 - 1" is detected right, but the number "-5" is not.
Issue Type
Requirements
Probably add a new token so that the parser can know the difference, and then edit the parser to parse a unary - correctly.
Notes