summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-19 01:48:52 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-19 01:48:52 -0500
commitf71fc5a23b0c4d6d51308318c8f7fab7b2d1c3a1 (patch)
tree1e6b5a6bac58434a6b42d0d33d8b359e482f4f50
parent17e517be54922a848a4e79394d0969d57e5b3b9e (diff)
downloaddimension-f71fc5a23b0c4d6d51308318c8f7fab7b2d1c3a1.tar.xz
Add 'sturm' modifier to the AST anyway.
-rw-r--r--dimension/common.rules10
-rw-r--r--dimension/grammar.epilogue1
-rw-r--r--dimension/parse.h1
-rw-r--r--dimension/realize.c4
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.");
}