mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Fixed initializer list in C++ parser
git-svn-id: svn://ultimatepp.org/upp/trunk@447 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ada28bce45
commit
50ccc8346b
2 changed files with 11 additions and 9 deletions
|
|
@ -484,9 +484,9 @@ int Parser::RPtr()
|
|||
|
||||
void Parser::EatInitializers()
|
||||
{
|
||||
if(Key(':')) {
|
||||
while(lex != '{' && lex != t_eof) ++lex;
|
||||
}
|
||||
if(Key(':'))
|
||||
while(lex != '{' && lex != t_eof)
|
||||
++lex;
|
||||
}
|
||||
|
||||
void Parser::Declarator(Decl& d, const char *p)
|
||||
|
|
@ -556,15 +556,15 @@ void Parser::Declarator(Decl& d, const char *p)
|
|||
}
|
||||
}
|
||||
if(Key('=') || (inbody && lex == '(')) {
|
||||
int lvl = 0;
|
||||
int level = 0;
|
||||
for(;;) {
|
||||
if(lex == t_eof || lvl == 0 && (lex == ',' || lex == ')' || lex == ';'))
|
||||
if(lex == t_eof || level == 0 && (lex == ',' || lex == ')' || lex == ';'))
|
||||
break;
|
||||
if(Key('('))
|
||||
lvl++;
|
||||
if(Key('(') || Key('{'))
|
||||
level++;
|
||||
else
|
||||
if(Key(')'))
|
||||
lvl--;
|
||||
if(Key(')') || Key('}'))
|
||||
level--;
|
||||
else
|
||||
++lex;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue