From d61738778a6ad01d1dd283f69048d3975f26bd2e Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Wed, 26 Nov 2003 19:54:09 +0000 Subject: [PATCH] Fixed parsing problem with = &x[]. This was causing the Java java-lib_various.i test to fail. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5419 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/CParse/parser.y | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 38cf6d720..eae59be57 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -3502,26 +3502,28 @@ def_args : EQUAL definetype { $$.throws = 0; } } - | EQUAL AND idcolon { - Node *n = Swig_symbol_clookup($3,0); + | EQUAL AND declarator { + Node *n = Swig_symbol_clookup($3.id,0); if (n) { String *q = Swig_symbol_qualified(n); if (Getattr(n,"access")) { if (cplus_mode == CPLUS_PUBLIC) { - Swig_warning(WARN_PARSE_PRIVATE, cparse_file, cparse_line,"'%s' is private in this context.\n", $3); + Swig_warning(WARN_PARSE_PRIVATE, cparse_file, cparse_line,"'%s' is private in this context.\n", $3.id); Swig_warning(WARN_PARSE_BAD_DEFAULT, cparse_file, cparse_line,"Can't set default argument value (ignored)\n"); } $$.val = 0; } else { if (q) { - $$.val = NewStringf("&%s::%s", q,Getattr(n,"name")); + String *temp = NewStringf("%s::%s", q, Getattr(n,"name")); + $$.val = NewStringf("&%s", SwigType_str($3.type,temp)); Delete(q); + Delete(temp); } else { - $$.val = NewStringf("&%s", $3); + $$.val = NewStringf("&%s", SwigType_str($3.type,$3.id)); } } } else { - $$.val = NewStringf("&%s",$3); + $$.val = NewStringf("&%s",SwigType_str($3.type,$3.id)); } $$.rawval = 0; $$.type = T_USER;