summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/ASTMatcher.cpp
diff options
context:
space:
mode:
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;