diff --git a/lib.py b/lib.py index 0f03c5d..2b10240 100644 --- a/lib.py +++ b/lib.py @@ -83,6 +83,8 @@ def execute(program): return reduce(lambda a, b: (a[0], a[1]*b[1]), subs[1:]) elif ctx[0] == _ident("/"): return reduce(lambda a, b: (a[0], a[1]/b[1]), subs[1:]) + elif ctx[0] == _ident("^"): + return reduce(lambda a, b: (a[0], a[1]**b[1]), subs[1:]) elif ctx[0] == _ident("=="): return ("number", 1.0 if subs[1] == subs[2] else 0.0) elif ctx[0] == _ident("="):