forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -2556,24 +2556,12 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
|
|||||||
return parseQtMethod(node);
|
return parseQtMethod(node);
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
unsigned startOfName = cursor();
|
|
||||||
NameAST *name = 0;
|
NameAST *name = 0;
|
||||||
if (parseName(name)) {
|
if (parseNameId(name)) {
|
||||||
if (LA() == T_IDENTIFIER || tok().isLiteral() || (tok().isOperator() && LA() != T_LPAREN &&
|
|
||||||
LA() != T_LBRACKET)) {
|
|
||||||
rewind(startOfName);
|
|
||||||
parseName(name, false);
|
|
||||||
}
|
|
||||||
// literal
|
|
||||||
// identifier <unop> ?
|
|
||||||
// identifier <binop>
|
|
||||||
// identifier <access>
|
|
||||||
// identifier rparen
|
|
||||||
// lparen type rparen identifier [[cast-expression]]
|
|
||||||
|
|
||||||
node = name;
|
node = name;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
} // default
|
} // default
|
||||||
|
|
||||||
} // switch
|
} // switch
|
||||||
@@ -2581,6 +2569,23 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Parser::parseNameId(NameAST *&name)
|
||||||
|
{
|
||||||
|
unsigned start = cursor();
|
||||||
|
if (! parseName(name))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (LA() == T_IDENTIFIER ||
|
||||||
|
tok().isLiteral() ||
|
||||||
|
(tok().isOperator() && LA() != T_LPAREN && LA() != T_LBRACKET))
|
||||||
|
{
|
||||||
|
rewind(start);
|
||||||
|
return parseName(name, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Parser::parseNestedExpression(ExpressionAST *&node)
|
bool Parser::parseNestedExpression(ExpressionAST *&node)
|
||||||
{
|
{
|
||||||
if (LA() == T_LPAREN) {
|
if (LA() == T_LPAREN) {
|
||||||
@@ -2763,7 +2768,7 @@ bool Parser::parsePostfixExpression(ExpressionAST *&node)
|
|||||||
ast->access_token = consumeToken();
|
ast->access_token = consumeToken();
|
||||||
if (LA() == T_TEMPLATE)
|
if (LA() == T_TEMPLATE)
|
||||||
ast->template_token = consumeToken();
|
ast->template_token = consumeToken();
|
||||||
if (! parseName(ast->member_name))
|
if (! parseNameId(ast->member_name))
|
||||||
_translationUnit->error(cursor(), "expected unqualified-id before token `%s'",
|
_translationUnit->error(cursor(), "expected unqualified-id before token `%s'",
|
||||||
tok().spell());
|
tok().spell());
|
||||||
*postfix_ptr = ast;
|
*postfix_ptr = ast;
|
||||||
|
@@ -141,6 +141,7 @@ public:
|
|||||||
bool parseMultiplicativeExpression(ExpressionAST *&node);
|
bool parseMultiplicativeExpression(ExpressionAST *&node);
|
||||||
bool parseTemplateId(NameAST *&node);
|
bool parseTemplateId(NameAST *&node);
|
||||||
bool parseClassOrNamespaceName(NameAST *&node);
|
bool parseClassOrNamespaceName(NameAST *&node);
|
||||||
|
bool parseNameId(NameAST *&node);
|
||||||
bool parseName(NameAST *&node, bool acceptTemplateId = true);
|
bool parseName(NameAST *&node, bool acceptTemplateId = true);
|
||||||
bool parseNestedNameSpecifier(NestedNameSpecifierAST *&node, bool acceptTemplateId);
|
bool parseNestedNameSpecifier(NestedNameSpecifierAST *&node, bool acceptTemplateId);
|
||||||
bool parseNestedNameSpecifierOpt(NestedNameSpecifierAST *&name, bool acceptTemplateId);
|
bool parseNestedNameSpecifierOpt(NestedNameSpecifierAST *&name, bool acceptTemplateId);
|
||||||
|
Reference in New Issue
Block a user