Clang import; Set Variable::typeStartToken and Variable::typeEndToken
This commit is contained in:
parent
c99867421d
commit
adb3588b24
|
@ -1175,6 +1175,11 @@ Token * clangimport::AstNode::createTokensVarDecl(TokenList *tokenList)
|
|||
const std::string type = mExtTokens[typeIndex];
|
||||
const std::string name = mExtTokens[typeIndex - 1];
|
||||
addTypeTokens(tokenList, type);
|
||||
if (!startToken && tokenList->back()) {
|
||||
startToken = tokenList->back();
|
||||
while (Token::Match(startToken->previous(), "%type%|*|&|&&"))
|
||||
startToken = startToken->previous();
|
||||
}
|
||||
Token *vartok1 = addtoken(tokenList, name);
|
||||
Scope *scope = const_cast<Scope *>(tokenList->back()->scope());
|
||||
const AccessControl accessControl = (scope->type == Scope::ScopeType::eGlobal) ? (AccessControl::Global) : (AccessControl::Local);
|
||||
|
|
|
@ -1787,8 +1787,8 @@ Variable::Variable(const Token *name_, const std::string &clangType, const Token
|
|||
nonneg int index_, AccessControl access_, const Type *type_,
|
||||
const Scope *scope_)
|
||||
: mNameToken(name_),
|
||||
mTypeStartToken(nullptr),
|
||||
mTypeEndToken(nullptr),
|
||||
mTypeStartToken(start),
|
||||
mTypeEndToken(name_ ? name_->previous() : nullptr),
|
||||
mIndex(index_),
|
||||
mAccess(access_),
|
||||
mFlags(0),
|
||||
|
|
Loading…
Reference in New Issue