dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php
MIT License
367 stars 46 forks source link

Support the peek operators #80

Closed dansanderson closed 2 years ago

dansanderson commented 2 years ago

PICO-8 now has operator synonyms for peek(addr), peek2(addr), and peek4(addr) as @addr, %addr, and $addr respectively, where addr is an expression.

Careful of precedence. @x+7 is not the same as @(x+7).

dansanderson commented 2 years ago

I added the unary operators in dd7b9b40ec5f7598cc36d009f30286aa0b0d575a.

The parser's lack of operator precedence is so jank I'm not going to fix it right now. It's a trash parser, it needs to be fully replaced.