fixed oopsies
This commit is contained in:
parent
b97fd3c64f
commit
13e7a2e1a8
1 changed files with 3 additions and 5 deletions
8
calc.lua
8
calc.lua
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue