diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-12-18 13:18:36 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-12-18 13:18:36 -0800 |
commit | a142e057162499db0df37e8abf5e515c6e297a04 (patch) | |
tree | c450439f6a7b66a27c585cba38173140e7c69130 | |
parent | 105db26ee52763474f014f86655c4ebc3830f63c (diff) | |
download | modelthing-a142e057162499db0df37e8abf5e515c6e297a04.tar.gz modelthing-a142e057162499db0df37e8abf5e515c6e297a04.zip |
parser: quantity field for component declaration
-rw-r--r-- | modelica-parser-lalrpop/src/ast.rs | 1 | ||||
-rw-r--r-- | modelica-parser-lalrpop/src/parser.lalrpop | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/modelica-parser-lalrpop/src/ast.rs b/modelica-parser-lalrpop/src/ast.rs index 2c55782..3b31072 100644 --- a/modelica-parser-lalrpop/src/ast.rs +++ b/modelica-parser-lalrpop/src/ast.rs @@ -86,6 +86,7 @@ pub struct ComponentClause { pub struct ComponentDeclaration { pub name: String, pub value: Option<Expr>, + pub quantity: Option<String>, pub units: Option<String>, pub description: Option<String>, } diff --git a/modelica-parser-lalrpop/src/parser.lalrpop b/modelica-parser-lalrpop/src/parser.lalrpop index 2c64889..a2c5d44 100644 --- a/modelica-parser-lalrpop/src/parser.lalrpop +++ b/modelica-parser-lalrpop/src/parser.lalrpop @@ -54,7 +54,7 @@ component_clause: ComponentClause = { component_declaration: ComponentDeclaration = { <name:identifier> <units:units_declaration?> <value:value_declaration?> <desc:string_literal?> (",")? => - ComponentDeclaration { name:name, description:desc, value:value, units:units }, + ComponentDeclaration { name:name, description:desc, value:value, units:units, quantity:None }, }; component_prefix: ComponentPrefix = { |