From fd90c3503db076b95f2e97455e9e8fcf9c374a88 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 4 Feb 2010 14:55:18 +0100 Subject: Added AST nodes for compound expressions (a GNU extension). --- src/shared/cplusplus/ASTMatcher.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/shared/cplusplus/ASTMatcher.cpp') 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; -- cgit v1.2.1