diff --git a/src/evaluator.py b/src/evaluator.py index 7c0a066..711f64b 100644 --- a/src/evaluator.py +++ b/src/evaluator.py @@ -54,8 +54,14 @@ def evaluate(lex, lab, debugmode, unvoiced, voiced, executionStack, currentStack if lex[ep].lexeme == "ʟ": # Unconditional jump ep = lab[lex[ep+1].lexeme] elif lex[ep].lexeme == "ʌ": # Conditional skip - ele = currentStack.pop() - truthy = ele != 0 or ele != "" or ele != [] + truthy = False + con = currentStack.pop() + if type(con) in [int, float]: + truthy = con != 0 + elif type(con) in [str]: + truthy = con != "" + elif type(con) in [list]: + truthy = con != [] ep += 1 if truthy else 0 # loop index getters and setters elif lex[ep].lexeme == "e":