Improve ast printing for boolean operators

This commit is contained in:
Anton Medvedev
2024-01-17 23:21:11 +01:00
parent 84f18d7e5d
commit 7d4dd1a708
3 changed files with 36 additions and 6 deletions
+4
View File
@@ -16,6 +16,10 @@ func Less(a, b string) bool {
return Binary[a].Precedence < Binary[b].Precedence
}
func IsBoolean(op string) bool {
return op == "and" || op == "or" || op == "&&" || op == "||"
}
var Unary = map[string]Operator{
"not": {50, Left},
"!": {50, Left},