From 11569fdec123e9c7aeaf38d8a122842c4c758fdf Mon Sep 17 00:00:00 2001 From: bnewbold Date: Sat, 14 Jan 2017 19:41:51 -0800 Subject: parse out exponentiation --- modelica-parser-lalrpop/src/parser.lalrpop | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modelica-parser-lalrpop/src/parser.lalrpop') diff --git a/modelica-parser-lalrpop/src/parser.lalrpop b/modelica-parser-lalrpop/src/parser.lalrpop index cb59a82..2d2469c 100644 --- a/modelica-parser-lalrpop/src/parser.lalrpop +++ b/modelica-parser-lalrpop/src/parser.lalrpop @@ -161,7 +161,8 @@ factor: Expr = { "/" => Expr::BinExpr(BinOperator::Divide, Box::new(lhs), Box::new(rhs)), "^" => - Expr::BinExpr(BinOperator::Divide, Box::new(lhs), Box::new(rhs)), + Expr::BinExpr(BinOperator::Exponentiate, Box::new(lhs), Box::new(rhs)), + // TODO: this could be a "negate" unary op? "-" => Expr::BinExpr(BinOperator::Multiply, Box::new(Expr::Integer(-1)), Box::new(t)), term, -- cgit v1.2.3