summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-19 07:57:03 -0700
committerCarl Worth <cworth@cworth.org>2010-05-19 07:57:03 -0700
commit5d2114254592e03b6d554c5e2eea4ea442c3fa05 (patch)
tree85a53ab916ee03f5f84b5a578a4c8e096c2de3e3
parent59ca98990f814926d716a13b0201c94945133824 (diff)
Like previous fix, but for object-like macros (and add a test).
The support for an object-like amcro within a macro-invocation argument was also implemented at one level too high in the grammar. Fortunately, this is a very simple fix.
-rw-r--r--glcpp-parse.y4
-rw-r--r--tests/036-define-func-non-macro-multi-token-argument.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y
index 400f138d17..647532f209 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -169,9 +169,6 @@ argument:
$$ = _string_list_create (parser);
_string_list_append_item ($$, $1);
}
-| macro {
- $$ = _string_list_create (parser);
- }
| argument argument_word {
_string_list_append_item ($1, $2);
talloc_free ($2);
@@ -189,6 +186,7 @@ argument_word:
IDENTIFIER { $$ = $1; }
| TOKEN { $$ = $1; }
| FUNC_MACRO { $$ = $1; }
+| macro { $$ = xtalloc_strdup (parser, ""); }
;
diff --git a/tests/036-define-func-non-macro-multi-token-argument.c b/tests/036-define-func-non-macro-multi-token-argument.c
new file mode 100644
index 0000000000..b21ff33673
--- /dev/null
+++ b/tests/036-define-func-non-macro-multi-token-argument.c
@@ -0,0 +1,3 @@
+#define bar success
+#define foo(x) x
+foo(more bar)