mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
fixed operator precedence: bitwise must come before comparisons
This commit is contained in:
parent
d8e18df3a1
commit
7ef4ddf0f3
@ -3,7 +3,6 @@ TODO
|
||||
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- fix operator precedence: if rasterCount ^ $80 >= 230 EOR should precede >=
|
||||
- @(ptr) |= 3 -> asm peephole optimize remove the second ldy if the instruction before doesn't modify y
|
||||
ldy #0
|
||||
lda (starfieldPtr2),y
|
||||
|
@ -87,7 +87,7 @@ main {
|
||||
@(staticStar1) = 0
|
||||
else
|
||||
@(staticStar1) = 192
|
||||
if (rasterCount ^ $80) >= 230
|
||||
if rasterCount ^ $80 >= 230
|
||||
@(staticStar2) = 0
|
||||
else
|
||||
@(staticStar2) = 192
|
||||
|
@ -5,17 +5,16 @@
|
||||
main {
|
||||
sub start() {
|
||||
|
||||
uword @zp flags_ptr = memory("flags", 200, 0)
|
||||
txt.print("calculating...\n")
|
||||
txt.print_uwhex(flags_ptr, true)
|
||||
txt.nl()
|
||||
ubyte rasterCount = 231
|
||||
|
||||
repeat 10 {
|
||||
txt.print("new iter\n")
|
||||
txt.print_ub(@($06))
|
||||
sys.memset(flags_ptr, 200, 0)
|
||||
}
|
||||
if rasterCount >= 230
|
||||
txt.print("y1")
|
||||
|
||||
if rasterCount ^ $80 >= 230
|
||||
txt.print("y2")
|
||||
|
||||
if (rasterCount ^ $80) >= 230
|
||||
txt.print("y3")
|
||||
|
||||
txt.print("done\n")
|
||||
}
|
||||
}
|
||||
|
@ -161,10 +161,10 @@ expression :
|
||||
| left = expression EOL? bop = ('*' | '/' | '%' ) EOL? right = expression
|
||||
| left = expression EOL? bop = ('+' | '-' ) EOL? right = expression
|
||||
| left = expression EOL? bop = ('<<' | '>>' ) EOL? right = expression
|
||||
| left = expression EOL? bop = ('<' | '>' | '<=' | '>=') EOL? right = expression
|
||||
| left = expression EOL? bop = '&' EOL? right = expression
|
||||
| left = expression EOL? bop = '^' EOL? right = expression
|
||||
| left = expression EOL? bop = '|' EOL? right = expression
|
||||
| left = expression EOL? bop = ('<' | '>' | '<=' | '>=') EOL? right = expression
|
||||
| left = expression EOL? bop = ('==' | '!=') EOL? right = expression
|
||||
| rangefrom = expression rto = ('to'|'downto') rangeto = expression ('step' rangestep = expression)? // can't create separate rule due to mutual left-recursion
|
||||
| left = expression EOL? bop = 'in' EOL? right = expression
|
||||
|
Loading…
Reference in New Issue
Block a user