From ed2f9793fae7d1c018e3de463617339c68faa3c0 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 10 Apr 2022 17:30:30 -0400 Subject: A few fixes + Fix an error with if statements inside loops + Fix a parser bug with boolean operators ~ Change libtnsl stub to return integers when reading a file ~ Change libtnsl stub to return -1 on EOF or file read error --- src/tparse/tree-value.go | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/tparse') diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index 25982ff..7a0148a 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -69,27 +69,30 @@ var ORDER = map[string]int{ "!|": 6, "!^": 6, + // Truthy equality + "==": 7, + "!==": 7, + // Boolean and - "&&": 7, + "&&": 8, // Boolean or - "||": 7, - // Truthy equals - "==": 7, + "||": 8, // Greater than - ">": 7, + ">": 8, // Less than - "<": 7, + "<": 8, - "!&&": 7, - "!||": 7, - "!==": 7, + "!>": 8, + "!<": 8, + ">==": 8, + "<==": 8, - "!>": 7, - "!<": 7, + "!&&": 8, + "!||": 8, // Assignement - "=": 8, + "=": 9, } // Works? Please test. -- cgit v1.2.3