cpp: inline namespace now ignored

git-svn-id: svn://ultimatepp.org/upp/trunk@8752 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-07-26 08:27:11 +00:00
parent ad419400cd
commit 024fa1ac8d
2 changed files with 19 additions and 7 deletions

View file

@ -551,6 +551,7 @@ struct Parser {
bool UsingNamespace();
void SetScopeCurrent();
void ScopeBody();
void DoNamespace();
void Do();
String AnonymousName();
String StructDeclaration(const String& tp, const String& tn);

View file

@ -1500,6 +1500,17 @@ void Parser::ClassEnum()
SetScopeCurrent();
}
void Parser::DoNamespace()
{
if(Key('{'))
while(!Key('}')) {
if(lex == t_eof)
ThrowError("Unexpected end of file");
Do();
}
Key(';');
}
void Parser::Do()
{
LLOG("Do, scope: " << current_scope);
@ -1513,18 +1524,18 @@ void Parser::Do()
while(lex != t_eof && lex != ';')
++lex;
else
if(lex == tk_inline && lex[1] == tk_namespace) { // for now, inline namespace is simply ignored
while(lex != t_eof && lex != '{')
++lex;
DoNamespace();
}
else
if(Key(';')) // 'empty' declaration, result of some ignores
;
else
if(Key(tk_extern) && lex == t_string) { // extern "C++" kind
++lex;
if(Key('{'))
while(!Key('}')) {
if(lex == t_eof)
ThrowError("Unexpected end of file");
Do();
}
Key(';');
DoNamespace();
}
else
if(Key(tk_template)) {