shithub: rgbds

Download patch

ref: 9738c88f957e51ff6834c0382b73bf7331fa25b2
parent: e33e6e24132dea1490e3039a6c85194d2b6a7a74
parent: c2787a9ea9dcc6558775aaf17669b921e642f1ff
author: Eldred Habert <eldredhabert0@gmail.com>
date: Thu Aug 29 13:14:05 EDT 2019

Merge pull request #383 from dbrotz/fix-380

Change the precedence of == to match the documentation

--- a/src/asm/asmy.y
+++ b/src/asm/asmy.y
@@ -537,8 +537,8 @@
 %token	<tzString>	T_STRING
 
 %left	<nConstValue>	T_OP_LOGICNOT
-%left	<nConstValue>	T_OP_LOGICOR T_OP_LOGICAND T_OP_LOGICEQU
-%left	<nConstValue>	T_OP_LOGICGT T_OP_LOGICLT T_OP_LOGICGE T_OP_LOGICLE T_OP_LOGICNE
+%left	<nConstValue>	T_OP_LOGICOR T_OP_LOGICAND
+%left	<nConstValue>	T_OP_LOGICGT T_OP_LOGICLT T_OP_LOGICGE T_OP_LOGICLE T_OP_LOGICNE T_OP_LOGICEQU
 %left	<nConstValue>	T_OP_ADD T_OP_SUB
 %left	<nConstValue>	T_OP_OR T_OP_XOR T_OP_AND
 %left	<nConstValue>	T_OP_SHL T_OP_SHR
--- /dev/null
+++ b/test/asm/operator-precedence.asm
@@ -1,0 +1,7 @@
+print: MACRO
+	printv \1
+	printt "\n"
+ENDM
+
+	print 1 == 1 || 1 == 2
+	print (1 == 1) || (1 == 2)
--- /dev/null
+++ b/test/asm/operator-precedence.out
@@ -1,0 +1,2 @@
+$1
+$1
--- /dev/null
+++ b/test/asm/operator-precedence.out.pipe
@@ -1,0 +1,2 @@
+$1
+$1