New dedicated priority for binary operators between relational and sum ones

This commit is contained in:
Celestino Amoroso 2024-12-25 07:41:08 +01:00
parent 6211be8a8f
commit edf8818f51
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ func newBinNotTerm(tk *Token) (inst *term) {
tk: *tk, tk: *tk,
children: make([]*term, 0, 1), children: make([]*term, 0, 1),
position: posPrefix, position: posPrefix,
priority: priNot, priority: priBinary,
evalFunc: evalBinaryNot, evalFunc: evalBinaryNot,
} }
} }
@ -39,7 +39,7 @@ func newBinAndTerm(tk *Token) (inst *term) {
tk: *tk, tk: *tk,
children: make([]*term, 0, 2), children: make([]*term, 0, 2),
position: posInfix, position: posInfix,
priority: priAnd, priority: priBinary,
evalFunc: evalBinaryAnd, evalFunc: evalBinaryAnd,
} }
} }
@ -71,7 +71,7 @@ func newBinOrTerm(tk *Token) (inst *term) {
tk: *tk, tk: *tk,
children: make([]*term, 0, 2), children: make([]*term, 0, 2),
position: posInfix, position: posInfix,
priority: priOr, priority: priBinary,
evalFunc: evalBinaryOr, evalFunc: evalBinaryOr,
} }
} }

View File

@ -19,6 +19,7 @@ const (
priAnd priAnd
priNot priNot
priRelational priRelational
priBinary
priSum priSum
priProduct priProduct
priFraction priFraction