Skip to content

Commit 47b7e64

Browse files
committed
Fix != operator in preprocessor
1 parent 726f249 commit 47b7e64

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

tests/functional/prepro90.bi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#define MACRO YES
3+
4+
#if MACRO != YES
5+
WRONG
6+
#else
7+
OK
8+
#endif
9+

tests/functional/prepro90.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#line 1 "prepro90.bi"
2+
#line 7 "prepro90.bi"
3+
OK
4+
#line 9 "prepro90.bi"

zxbpp/zxbpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def p_expr(p):
564564
def p_exprne(p):
565565
""" expr : expr NE expr
566566
"""
567-
p[0] = '1' if p[1] != p[2] else '0'
567+
p[0] = '1' if p[1] != p[3] else '0'
568568

569569

570570
def p_expreq(p):

0 commit comments

Comments
 (0)