diff --git a/ast/token.go b/ast/token.go index 721143a..645e203 100644 --- a/ast/token.go +++ b/ast/token.go @@ -152,6 +152,8 @@ func GetTagAsStr(tag Token_t) string { return "LIST" case STRING: return "STRING" + case BOOL: + return "BOOL" case NUMBER: return "NUMBER" case SYMBOL: diff --git a/stdlib/control_flow.go b/stdlib/control_flow.go index c14cb31..5889e33 100644 --- a/stdlib/control_flow.go +++ b/stdlib/control_flow.go @@ -63,7 +63,7 @@ func shs_while(in *ast.Token, vt ast.VarTable, ft ast.FuncTable) *ast.Token { var res *ast.Token eval := cond.Eval(ft, vt, false) - if cond == nil || cond.Tag != ast.BOOL { + if eval == nil || eval.Tag != ast.BOOL { log.Log(log.ERR, "first argument to while must be a bool statement", "while")