fixed oopsies

This commit is contained in:
snaki 2022-08-28 21:52:35 +02:00
parent b97fd3c64f
commit 13e7a2e1a8
No known key found for this signature in database
GPG key ID: C57B0E9414459801

View file

@ -86,8 +86,6 @@ function eval(expr)
end
end
return eval(parseExpr(splitTokens(expr:toStringNoDot())))
function printTree(expr, depth)
local indent = string.rep(' ', depth)
print(indent .. 'type: ' .. expr['type'])
@ -104,8 +102,8 @@ function printTree(expr, depth)
end
end
program = '1.a.2.m.3.s.4'
tree = parseExpr(splitTokens(program))
tree = parseExpr(splitTokens(arg[1]))
print('tree:')
printTree(tree, 0)
print('result: ', eval(tree))
print('result: ' .. eval(tree))