Closed vincent-io closed 3 years ago
Same thing for |
(bor, same error), ^^
(xor), <<
(shl), >>
(shr), >>>
(lshr), <<>
(rotl), >><
(rotr).
|
has the same error as &
, the others trigger
pico8.lua.parser.ParserError: exp2 in binop
Not sure why, but adding b'&', b'|', b'^^', b'<<', b'>>', b'>>>', b'<<>', b'>><'
in BINOP_PATS
in parser.lua is not enough, now I get:
... File ".../picotool/pico8/lua/parser.py", line 719, in _exp return self._exp_binop(exp_term) File ".../picotool/pico8/lua/parser.py", line 751, in _exp_binop exp_second = self._assert(self._exp_term(), 'exp2 in binop') File ".../picotool/pico8/lua/parser.py", line 339, in _assert raise ParserError(desc, token=self._peek()) pico8.lua.parser.ParserError: exp2 in binop at line 117 char 24
I added the binary operators in 54b84fe74b95c98a562822b2c42f6b3e9f4c0690. (Your change may not have worked because the lexer patterns are ordering sensitive, e.g. >>>
has to come before >>
.)
I added the unary operators in dd7b9b40ec5f7598cc36d009f30286aa0b0d575a.
Pico-8 version 0.2.0 introduced the
&
operator to do bitwise and (deprecating https://pico-8.fandom.com/wiki/Band), but this is not supported by picotool: