mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
fix grammar: if_xx with else part
This commit is contained in:
parent
db80417bd7
commit
f4b50368ba
@ -4,13 +4,17 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
sub start() {
|
sub start() {
|
||||||
const ubyte x=0
|
sys.clear_carry()
|
||||||
|
cx16.r0s=-42
|
||||||
|
|
||||||
if x==3 {
|
if_z
|
||||||
txt.print("three")
|
txt.print("zero")
|
||||||
} else if x==4 {
|
else if_cs
|
||||||
txt.print("four")
|
txt.print("carry")
|
||||||
}
|
else if_neg
|
||||||
|
txt.print("negative")
|
||||||
|
else
|
||||||
|
txt.print("nothing")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ if_stmt : 'if' expression EOL? (statement | statement_block) EOL? else_part? ;
|
|||||||
else_part : 'else' EOL? (statement | statement_block) ; // statement is constrained later
|
else_part : 'else' EOL? (statement | statement_block) ; // statement is constrained later
|
||||||
|
|
||||||
|
|
||||||
branch_stmt : branchcondition EOL? (statement | statement_block) EOL? else_part? EOL ;
|
branch_stmt : branchcondition EOL? (statement | statement_block) EOL? else_part? ;
|
||||||
|
|
||||||
branchcondition: 'if_cs' | 'if_cc' | 'if_eq' | 'if_z' | 'if_ne' | 'if_nz' | 'if_pl' | 'if_pos' | 'if_mi' | 'if_neg' | 'if_vs' | 'if_vc' ;
|
branchcondition: 'if_cs' | 'if_cc' | 'if_eq' | 'if_z' | 'if_ne' | 'if_nz' | 'if_pl' | 'if_pos' | 'if_mi' | 'if_neg' | 'if_vs' | 'if_vc' ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user