Re:Operator precedence by textual substitution
by Taniwha on Monday May 16, 2022 @03:52AM
(#31394513)
does it work for unary +/-?
[ Parent
| on HN ]
Almost: +13 would be rewritten to ((()))+(((13))) and -13 to ((()))-(((13))). If you interpret the empty expression as 0, perhaps it would work out.
Good question!
There are other unary operators (!, ~), although I'm almost sure FORTRAN didn't support those, but 1 - -13 => 1 - 0 - 13 = -12 would fail, wouldn't it?