aboutsummaryrefslogtreecommitdiffstats
path: root/src/modelica_parser.lalrpop
diff options
context:
space:
mode:
Diffstat (limited to 'src/modelica_parser.lalrpop')
-rw-r--r--src/modelica_parser.lalrpop4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modelica_parser.lalrpop b/src/modelica_parser.lalrpop
index 9cb2c1c..52fd5eb 100644
--- a/src/modelica_parser.lalrpop
+++ b/src/modelica_parser.lalrpop
@@ -36,6 +36,8 @@ pub model: Model = {
component_declaration: Component = {
<prefix:component_prefix?> <specifier:identifier> <name:identifier> string_literal? ";" =>
Component { prefix:prefix, specifier:specifier, name:name},
+ <prefix:component_prefix?> <specifier:identifier> <name:identifier> "=" <value:expr> string_literal? ";" =>
+ Component { prefix:prefix, specifier:specifier, name:name},
};
component_prefix: ComponentPrefix = {
@@ -71,6 +73,8 @@ factor: Expr = {
Expr::BinExpr(BinOperator::Multiply, Box::new(lhs), Box::new(rhs)),
<lhs:factor> "/" <rhs:term> =>
Expr::BinExpr(BinOperator::Divide, Box::new(lhs), Box::new(rhs)),
+ <lhs:factor> "^" <rhs:term> =>
+ Expr::BinExpr(BinOperator::Divide, Box::new(lhs), Box::new(rhs)),
"-" <t:term> =>
Expr::BinExpr(BinOperator::Multiply, Box::new(Expr::Integer(-1)), Box::new(t)),
term,