Clang import; CXXDeleteExpr
This commit is contained in:
parent
51e775e21e
commit
6386f0e633
|
@ -44,6 +44,7 @@ static const std::string CXXBoolLiteralExpr = "CXXBoolLiteralExpr";
|
|||
static const std::string CXXConstructorDecl = "CXXConstructorDecl";
|
||||
static const std::string CXXConstructExpr = "CXXConstructExpr";
|
||||
static const std::string CXXDefaultArgExpr = "CXXDefaultArgExpr";
|
||||
static const std::string CXXDeleteExpr = "CXXDeleteExpr";
|
||||
static const std::string CXXForRangeStmt = "CXXForRangeStmt";
|
||||
static const std::string CXXMemberCallExpr = "CXXMemberCallExpr";
|
||||
static const std::string CXXMethodDecl = "CXXMethodDecl";
|
||||
|
@ -608,6 +609,11 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList)
|
|||
createTokensFunctionDecl(tokenList);
|
||||
return nullptr;
|
||||
}
|
||||
if (nodeType == CXXDeleteExpr) {
|
||||
addtoken(tokenList, "delete");
|
||||
children[0]->createTokens(tokenList);
|
||||
return nullptr;
|
||||
}
|
||||
if (nodeType == CXXForRangeStmt) {
|
||||
Token *forToken = addtoken(tokenList, "for");
|
||||
Token *par1 = addtoken(tokenList, "(");
|
||||
|
|
|
@ -45,6 +45,7 @@ private:
|
|||
TEST_CASE(cxxConstructExpr1);
|
||||
TEST_CASE(cxxConstructExpr2);
|
||||
TEST_CASE(cxxConstructExpr3);
|
||||
TEST_CASE(cxxDeleteExpr);
|
||||
TEST_CASE(cxxForRangeStmt);
|
||||
TEST_CASE(cxxMemberCall);
|
||||
TEST_CASE(cxxMethodDecl);
|
||||
|
@ -311,6 +312,16 @@ private:
|
|||
ASSERT_EQUALS("void f ( ) { char * p@1 ; std::string s@2 ( p@1 ) ; }", parse(clang));
|
||||
}
|
||||
|
||||
void cxxDeleteExpr() {
|
||||
const char clang[] = "|-FunctionDecl 0x2e0e740 <1.cpp:1:1, col:28> col:6 f 'void (int *)'\n"
|
||||
"| |-ParmVarDecl 0x2e0e680 <col:8, col:13> col:13 used p 'int *'\n"
|
||||
"| `-CompoundStmt 0x2e0ee70 <col:16, col:28>\n"
|
||||
"| `-CXXDeleteExpr 0x2e0ee48 <col:18, col:25> 'void' Function 0x2e0ebb8 'operator delete' 'void (void *) noexcept'\n"
|
||||
"| `-ImplicitCastExpr 0x2e0e850 <col:25> 'int *' <LValueToRValue>\n"
|
||||
"| `-DeclRefExpr 0x2e0e828 <col:25> 'int *' lvalue ParmVar 0x2e0e680 'p' 'int *'";
|
||||
ASSERT_EQUALS("void f ( int * p@1 ) { delete p@1 ; }", parse(clang));
|
||||
}
|
||||
|
||||
void cxxForRangeStmt() {
|
||||
const char clang[] = "`-FunctionDecl 0x4280820 <line:4:1, line:8:1> line:4:6 foo 'void ()'\n"
|
||||
" `-CompoundStmt 0x42810f0 <col:12, line:8:1>\n"
|
||||
|
|
Loading…
Reference in New Issue