summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-04-22 18:24:59 -0400
committerTavian Barnes <tavianator@gmail.com>2011-04-22 18:25:09 -0400
commit13e11b2fafe60cad7d04d80c602adc12d6080036 (patch)
treea36a93bc780b9b9e0eec30a486d8a4a9a6ddbd24 /dimension/common.rules
parent4e3c3918450d004bc00de4ad58eb7b707156f9aa (diff)
downloaddimension-13e11b2fafe60cad7d04d80c602adc12d6080036.tar.xz
Handle symbol aliases in dmnsn_find_symbol() directly.
Fixes infinite loops when macro arguments have the same name as existing symbols.
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules8
1 files changed, 1 insertions, 7 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index 9383d4b..a987c69 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -22,14 +22,8 @@
/* Fundamental language elements */
IDENTIFIER: "identifier" {
- const char *id = $1;
- dmnsn_astnode *symbol = dmnsn_find_symbol(symtable, id);
- while (symbol && symbol->type == DMNSN_AST_IDENTIFIER) {
- id = symbol->ptr;
- symbol = dmnsn_find_symbol(symtable, id);
- }
$$ = dmnsn_new_astleaf(DMNSN_AST_IDENTIFIER, @$);
- $$.ptr = dmnsn_strdup(id);
+ $$.ptr = dmnsn_strdup($1);
dmnsn_free($1);
}
;