aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Parser.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-06-08 21:49:39 +0300
committerOrgad Shaneh <orgads@gmail.com>2014-06-12 16:04:38 +0200
commitd0f00cc29d1f53ab6c3378046827d8abaa844cbd (patch)
treedfd9d567a75208018ba1f19b5e8b7f348271b554 /src/libs/3rdparty/cplusplus/Parser.cpp
parent399967d08b6d1080c791a1c56f505ad5790a2fb1 (diff)
C++: Whitespace fixes in parser
Change-Id: I409699225b5f42db7ecb6c2dc8d150c1a66ee23c Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Parser.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Parser.cpp43
1 files changed, 14 insertions, 29 deletions
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp
index 498bdd5a65..35d8d917a0 100644
--- a/src/libs/3rdparty/cplusplus/Parser.cpp
+++ b/src/libs/3rdparty/cplusplus/Parser.cpp
@@ -369,7 +369,7 @@ void Parser::match(int kind, unsigned *token)
else {
*token = 0;
error(_tokenIndex, "expected token `%s' got `%s'",
- Token::name(kind), tok().spell());
+ Token::name(kind), tok().spell());
}
}
@@ -1367,8 +1367,7 @@ bool Parser::parseDeclSpecifierSeq(SpecifierListAST *&decl_specifier_seq,
// typename-specifier, elaborated-type-specifier
unsigned startOfElaboratedTypeSpecifier = cursor();
if (! parseElaboratedTypeSpecifier(*decl_specifier_seq_ptr)) {
- error(startOfElaboratedTypeSpecifier,
- "expected an elaborated type specifier");
+ error(startOfElaboratedTypeSpecifier, "expected an elaborated type specifier");
break;
}
decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next;
@@ -2154,9 +2153,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
if (parsePostfixExpression(ast->expression)) {
match(T_COMMA, &ast->comma_token);
} else {
- error(cursor(),
- "expected expression before `%s'",
- tok().spell());
+ error(cursor(), "expected expression before `%s'", tok().spell());
return true;
}
}
@@ -2199,9 +2196,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
bItem->expression = expr;
item = bItem;
} else {
- error(cursor(),
- "expected expression before `%s'",
- tok().spell());
+ error(cursor(), "expected expression before `%s'", tok().spell());
}
break;
}
@@ -3929,8 +3924,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
|| (_languageFeatures.cxx11Enabled && LA() == T_COLON)) {
rewind(startOfTypeSpecifier);
if (! parseEnumSpecifier(*decl_specifier_seq_ptr)) {
- error(startOfTypeSpecifier,
- "expected an enum specifier");
+ error(startOfTypeSpecifier, "expected an enum specifier");
break;
}
has_complex_type_specifier = true;
@@ -3940,8 +3934,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
} else if (! has_type_specifier && LA() == T_TYPENAME) {
unsigned startOfElaboratedTypeSpecifier = cursor();
if (! parseElaboratedTypeSpecifier(*decl_specifier_seq_ptr)) {
- error(startOfElaboratedTypeSpecifier,
- "expected an elaborated type specifier");
+ error(startOfElaboratedTypeSpecifier, "expected an elaborated type specifier");
break;
}
decl_specifier_seq_ptr = &(*decl_specifier_seq_ptr)->next;
@@ -3956,8 +3949,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *de
(LA(3) == T_COLON || LA(3) == T_LBRACE)))) {
rewind(startOfTypeSpecifier);
if (! parseClassSpecifier(*decl_specifier_seq_ptr)) {
- error(startOfTypeSpecifier,
- "wrong type specifier");
+ error(startOfTypeSpecifier, "wrong type specifier");
break;
}
has_complex_type_specifier = true;
@@ -4952,8 +4944,7 @@ bool Parser::parsePostfixExpression(ExpressionAST *&node)
if (LA() == T_TEMPLATE)
ast->template_token = consumeToken();
if (! parseNameId(ast->member_name))
- error(cursor(), "expected unqualified-id before token `%s'",
- tok().spell());
+ error(cursor(), "expected unqualified-id before token `%s'", tok().spell());
ast->base_expression = node;
node = ast;
} else break;
@@ -4978,10 +4969,8 @@ bool Parser::parseUnaryExpression(ExpressionAST *&node)
unsigned op = cursor();
UnaryExpressionAST *ast = new (_pool) UnaryExpressionAST;
ast->unary_op_token = consumeToken();
- if (! parseCastExpression(ast->expression)) {
- error(op, "expected expression after token `%s'",
- _translationUnit->spell(op));
- }
+ if (! parseCastExpression(ast->expression))
+ error(op, "expected expression after token `%s'", _translationUnit->spell(op));
node = ast;
return true;
}
@@ -5363,8 +5352,7 @@ bool Parser::parseQtMethod(ExpressionAST *&node)
ast->method_token = consumeToken();
match(T_LPAREN, &ast->lparen_token);
if (! parseDeclarator(ast->declarator, /*decl_specifier_seq =*/ 0))
- error(cursor(), "expected a function declarator before token `%s'",
- tok().spell());
+ error(cursor(), "expected a function declarator before token `%s'", tok().spell());
match(T_RPAREN, &ast->rparen_token);
node = ast;
return true;
@@ -5567,8 +5555,7 @@ bool Parser::parseObjCInterface(DeclarationAST *&node,
// a category interface
if (attributes)
- error(attributes->firstToken(),
- "invalid attributes for category interface declaration");
+ error(attributes->firstToken(), "invalid attributes for category interface declaration");
ObjCClassDeclarationAST *ast = new (_pool) ObjCClassDeclarationAST;
ast->attribute_list = attributes;
@@ -5851,9 +5838,7 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
} else {
if (! parseBlockDeclaration(declaration)) {
rewind(start);
- error(cursor(),
- "skip token `%s'", tok().spell());
-
+ error(cursor(), "skip token `%s'", tok().spell());
consumeToken();
}
}
@@ -6065,7 +6050,7 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierListAS
last = last->next;
if (!parseObjCPropertyAttribute(last->value)) {
error(_tokenIndex, "expected token `%s' got `%s'",
- Token::name(T_IDENTIFIER), tok().spell());
+ Token::name(T_IDENTIFIER), tok().spell());
break;
}
}