summaryrefslogtreecommitdiff
path: root/Logstat/Eval.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Logstat/Eval.hs')
-rw-r--r--Logstat/Eval.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Logstat/Eval.hs b/Logstat/Eval.hs
index ffd80e3..7dd8bb8 100644
--- a/Logstat/Eval.hs
+++ b/Logstat/Eval.hs
@@ -35,6 +35,7 @@ evalExpr st expr = case expr of
ELit e -> return e
EField f -> getField st f
ENot e -> bool . not . asBool <$> evalExpr st e
+ EIf e t f-> evalExpr st e >>= \b -> evalExpr st $ if asBool b then t else f
ENeg e -> do
v <- evalExpr st e >>= asNum
@@ -60,6 +61,7 @@ evalExpr st expr = case expr of
OMul -> iop (*)
ODiv -> idiv (/)
OMod -> idiv mod'
+ OPow -> iop (**)
OOr -> with a' return $ \a -> if asBool a then return a else with b' return return
OAnd -> with a' return $ \a -> if asBool a then with b' return return else return a
where