summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/ASTMatcher.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2010-02-04 14:55:18 +0100
committerErik Verbruggen <erik.verbruggen@nokia.com>2010-02-07 10:49:02 +0100
commitfd90c3503db076b95f2e97455e9e8fcf9c374a88 (patch)
treebf645124798d090cd25483f1b35ba4ea64c8034b /src/shared/cplusplus/ASTMatcher.cpp
parent7cdb15e7fc0dd84fc11a91a744faf4e4eb351c8e (diff)
downloadqt-creator-fd90c3503db076b95f2e97455e9e8fcf9c374a88.tar.gz
Added AST nodes for compound expressions (a GNU extension).
Diffstat (limited to 'src/shared/cplusplus/ASTMatcher.cpp')
-rw-r--r--src/shared/cplusplus/ASTMatcher.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared/cplusplus/ASTMatcher.cpp b/src/shared/cplusplus/ASTMatcher.cpp
index febb9e5fe2..aa1a0f3ba6 100644
--- a/src/shared/cplusplus/ASTMatcher.cpp
+++ b/src/shared/cplusplus/ASTMatcher.cpp
@@ -331,6 +331,23 @@ bool ASTMatcher::match(BaseSpecifierAST *node, BaseSpecifierAST *pattern)
return true;
}
+bool ASTMatcher::match(CompoundExpressionAST *node, CompoundExpressionAST *pattern)
+{
+ (void) node;
+ (void) pattern;
+
+ pattern->lparen_token = node->lparen_token;
+
+ if (! pattern->compoundStatement)
+ pattern->compoundStatement = node->compoundStatement;
+ else if (! AST::match(node->compoundStatement, pattern->compoundStatement, this))
+ return false;
+
+ pattern->rparen_token = node->rparen_token;
+
+ return true;
+}
+
bool ASTMatcher::match(CompoundLiteralAST *node, CompoundLiteralAST *pattern)
{
(void) node;