Re:Just Write the Parser
by tiarkrompf on Thursday October 22, 2020 @02:23PM
(#24861407)
Great question! Unary operators are really simple to add: you just look for the operator symbol first thing at the right level of precedence. Same idea as "if (peek == '(') ..." for parentheses, but outside the code that deals with '*' and '^' (if you want those to bind more strongly).
[ Parent
| on HN ]
There are no comments on this comment yet.