riff-lang / riff

The Riff programming language
https://riff.cx
BSD Zero Clause License
23 stars 1 forks source link

Increment/decrement operators being bound to preceding table literals #46

Closed darrylabbate closed 1 year ago

darrylabbate commented 1 year ago

Parser should be binding ++ to the succeeding expression. Ex:

$ riff -le 't = [] ++x'
source:<command-line> @ 0x16b933390 -> 7 bytes
0:  47        GBLA    0       // t
1:  5b        TAB     0
2:  2c        POSTINC
3:  6f        SETP
4:  4c        GBLV    1       // x
5:  3a        POP
6:  59        RET

Expected compiler output:

$ riff -le 't = []; ++x'
source:<command-line> @ 0x16b993390 -> 7 bytes
0:  47        GBLA    0       // t
1:  5b        TAB     0
2:  6f        SETP
3:  48        GBLA    1       // x
4:  2a        PREINC
5:  3a        POP
6:  59        RET