diff options
author | Carl Worth <[email protected]> | 2010-05-25 15:28:58 -0700 |
---|---|---|
committer | Carl Worth <[email protected]> | 2010-05-25 15:28:58 -0700 |
commit | e6fb7827c96451d4a09dfda31979a6b9cb27301e (patch) | |
tree | 6961af0bad06589e792449381826218746f56ca2 | |
parent | ae6517f4a83981ae363bbbfe439ec23e8deb04b1 (diff) |
Implement #undef.
Which is as simple as copying the former action back from the git
history.
Now all tests through test 11 pass.
-rw-r--r-- | glcpp-parse.y | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y index b3ef177a6da..830a6232d80 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -171,7 +171,17 @@ control_line: } | HASH_DEFINE_FUNC IDENTIFIER '(' ')' replacement_list NEWLINE | HASH_DEFINE_FUNC IDENTIFIER '(' identifier_list ')' replacement_list NEWLINE -| HASH_UNDEF IDENTIFIER NEWLINE +| HASH_UNDEF IDENTIFIER NEWLINE { + string_list_t *macro = hash_table_find (parser->defines, $2); + if (macro) { + /* XXX: Need hash table to support a real way + * to remove an element rather than prefixing + * a new node with data of NULL like this. */ + hash_table_insert (parser->defines, NULL, $2); + talloc_free (macro); + } + talloc_free ($2); + } | HASH NEWLINE ; |