Clang import; Clang 9 fix

This commit is contained in:
Daniel Marjamäki 2020-01-25 17:22:22 +01:00
parent b6833b525f
commit 6f8799023f
1 changed files with 4 additions and 1 deletions

View File

@ -35,6 +35,7 @@ static const std::string CharacterLiteral = "CharacterLiteral";
static const std::string ClassTemplateDecl = "ClassTemplateDecl"; static const std::string ClassTemplateDecl = "ClassTemplateDecl";
static const std::string ClassTemplateSpecializationDecl = "ClassTemplateSpecializationDecl"; static const std::string ClassTemplateSpecializationDecl = "ClassTemplateSpecializationDecl";
static const std::string ConditionalOperator = "ConditionalOperator"; static const std::string ConditionalOperator = "ConditionalOperator";
static const std::string ConstantExpr = "ConstantExpr";
static const std::string CompoundAssignOperator = "CompoundAssignOperator"; static const std::string CompoundAssignOperator = "CompoundAssignOperator";
static const std::string CompoundStmt = "CompoundStmt"; static const std::string CompoundStmt = "CompoundStmt";
static const std::string ContinueStmt = "ContinueStmt"; static const std::string ContinueStmt = "ContinueStmt";
@ -535,7 +536,7 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList)
addtoken(tokenList, "case"); addtoken(tokenList, "case");
children[0]->createTokens(tokenList); children[0]->createTokens(tokenList);
addtoken(tokenList, ":"); addtoken(tokenList, ":");
children[2]->createTokens(tokenList); children.back()->createTokens(tokenList);
return nullptr; return nullptr;
} }
if (nodeType == ClassTemplateDecl) { if (nodeType == ClassTemplateDecl) {
@ -577,6 +578,8 @@ Token *clangimport::AstNode::createTokens(TokenList *tokenList)
} }
return nullptr; return nullptr;
} }
if (nodeType == ConstantExpr)
return children[0]->createTokens(tokenList);
if (nodeType == ContinueStmt) if (nodeType == ContinueStmt)
return addtoken(tokenList, "continue"); return addtoken(tokenList, "continue");
if (nodeType == CStyleCastExpr) { if (nodeType == CStyleCastExpr) {