diff options
-rw-r--r-- | dimension/common.rules | 10 | ||||
-rw-r--r-- | dimension/grammar.epilogue | 1 | ||||
-rw-r--r-- | dimension/parse.h | 1 | ||||
-rw-r--r-- | dimension/realize.c | 4 |
4 files changed, 14 insertions, 2 deletions
diff --git a/dimension/common.rules b/dimension/common.rules index 74a40e4..f4ce31f 100644 --- a/dimension/common.rules +++ b/dimension/common.rules @@ -362,14 +362,20 @@ TORUS_MODIFIERS: /* empty */ { dmnsn_diagnostic(@2, "WARNING: Dimension does not use 'sturm';" " ignored."); + dmnsn_astnode on = dmnsn_new_ast_integer(true); + dmnsn_astnode sturm = dmnsn_new_astnode1(DMNSN_AST_STURM, @2, + on); $$ = $1; + dmnsn_array_push($$.children, &sturm); } - | TORUS_MODIFIERS "sturm" FLOAT { + | TORUS_MODIFIERS "sturm" INT { dmnsn_diagnostic(@2, "WARNING: Dimension does not use 'sturm';" " ignored."); - dmnsn_delete_astnode($3); + dmnsn_astnode sturm = dmnsn_new_astnode1(DMNSN_AST_STURM, @2, + $3); $$ = $1; + dmnsn_array_push($$.children, &sturm); } ; diff --git a/dimension/grammar.epilogue b/dimension/grammar.epilogue index 3856e1e..6aef4fe 100644 --- a/dimension/grammar.epilogue +++ b/dimension/grammar.epilogue @@ -146,6 +146,7 @@ dmnsn_astnode_string(dmnsn_astnode_type astnode_type) dmnsn_astnode_map(DMNSN_AST_UNION, "union"); dmnsn_astnode_map(DMNSN_AST_OBJECT_MODIFIERS, "object-modifiers"); + dmnsn_astnode_map(DMNSN_AST_STURM, "sturm"); dmnsn_astnode_map(DMNSN_AST_PATTERN, "pattern"); dmnsn_astnode_map(DMNSN_AST_CHECKER, "checker"); diff --git a/dimension/parse.h b/dimension/parse.h index 5336d27..ad8787a 100644 --- a/dimension/parse.h +++ b/dimension/parse.h @@ -60,6 +60,7 @@ typedef enum { DMNSN_AST_UNION, DMNSN_AST_OBJECT_MODIFIERS, + DMNSN_AST_STURM, DMNSN_AST_PATTERN, DMNSN_AST_CHECKER, diff --git a/dimension/realize.c b/dimension/realize.c index 65829eb..8ac8279 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -886,6 +886,10 @@ dmnsn_realize_object_modifiers(dmnsn_astnode astnode, dmnsn_object *object) object->interior = dmnsn_realize_interior(*modifier); break; + case DMNSN_AST_STURM: + /* Ignored */ + break; + default: dmnsn_assert(false, "Invalid object modifier."); } |