copy all flag fields in a Token

This commit is contained in:
Robert Reif 2011-03-07 20:04:25 -05:00
parent e305a155af
commit d74ae3b0f0
3 changed files with 24 additions and 0 deletions

View File

@ -107,6 +107,9 @@ void Token::deleteThis()
_isName = _next->_isName;
_isNumber = _next->_isNumber;
_isBoolean = _next->_isBoolean;
_isUnsigned = _next->_isUnsigned;
_isSigned = _next->_isSigned;
_isLong = _next->_isLong;
_isUnused = _next->_isUnused;
_varId = _next->_varId;
_fileIndex = _next->_fileIndex;

View File

@ -141,14 +141,26 @@ public:
{
return _isName;
}
void isName(bool name)
{
_isName = name;
}
bool isNumber() const
{
return _isNumber;
}
void isNumber(bool number)
{
_isNumber = number;
}
bool isBoolean() const
{
return _isBoolean;
}
void isBoolean(bool boolean)
{
_isBoolean = boolean;
}
bool isUnsigned() const
{
return _isUnsigned;

View File

@ -243,13 +243,18 @@ void Tokenizer::insertTokens(Token *dest, const Token *src, unsigned int n)
dest->fileIndex(src->fileIndex());
dest->linenr(src->linenr());
dest->varId(src->varId());
dest->isName(src->isName());
dest->isNumber(src->isNumber());
dest->isBoolean(src->isBoolean());
dest->isUnsigned(src->isUnsigned());
dest->isSigned(src->isSigned());
dest->isLong(src->isLong());
dest->isUnused(src->isUnused());
src = src->next();
--n;
}
}
//---------------------------------------------------------------------------
Token *Tokenizer::copyTokens(Token *dest, const Token *first, const Token *last)
@ -262,9 +267,13 @@ Token *Tokenizer::copyTokens(Token *dest, const Token *first, const Token *last)
tok2 = tok2->next();
tok2->fileIndex(dest->fileIndex());
tok2->linenr(dest->linenr());
tok2->isName(tok->isName());
tok2->isNumber(tok->isNumber());
tok2->isBoolean(tok->isBoolean());
tok2->isUnsigned(tok->isUnsigned());
tok2->isSigned(tok->isSigned());
tok2->isLong(tok->isLong());
tok2->isUnused(tok->isUnused());
// Check for links and fix them up
if (tok2->str() == "(" || tok2->str() == "[" || tok2->str() == "{")