mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
cpp: inline namespace now ignored
git-svn-id: svn://ultimatepp.org/upp/trunk@8752 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ad419400cd
commit
024fa1ac8d
2 changed files with 19 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue