summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-25 17:45:22 -0700
committerCarl Worth <cworth@cworth.org>2010-05-25 17:45:22 -0700
commit652fa272ea4bdb9bfe6cd7f8413b3a3b03972987 (patch)
tree18af77107f28ce742e2f5a25df56ddee53d3bca7
parentc7581c2e6e6897eddc55c537c92417b813a8b81e (diff)
Avoid swallowing initial left parenthesis from nested macro invocation.
We weren't including this left parenthesis in the argument's token list so the nested function invocation wasn not being recognized. With this fix, tests 21 and 22 now pass.
-rw-r--r--glcpp-parse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/glcpp-parse.y b/glcpp-parse.y
index ec966580fc..131102fab9 100644
--- a/glcpp-parse.y
+++ b/glcpp-parse.y
@@ -754,9 +754,12 @@ _arguments_parse (argument_list_t *arguments, token_node_t **node_ret)
if (node == NULL || node->token->type != '(')
return FUNCTION_NOT_A_FUNCTION;
+ last = node;
+ node = node->next;
+
argument = NULL;
- for (paren_count = 0; node; last = node, node = node->next) {
+ for (paren_count = 1; node; last = node, node = node->next) {
if (node->token->type == '(')
{
paren_count++;
@@ -770,7 +773,8 @@ _arguments_parse (argument_list_t *arguments, token_node_t **node_ret)
break;
}
}
- else if (node->token->type == ',' &&
+
+ if (node->token->type == ',' &&
paren_count == 1)
{
argument = NULL;