token : minor refactoring to TOKEN::insertToken. Give the linenr and fileIndex the same values as this token. It's better than nothing

This commit is contained in:
Daniel Marjamäki 2008-12-16 17:05:43 +00:00
parent 40f3ef61c9
commit e853f28912
2 changed files with 7 additions and 5 deletions

View File

@ -366,10 +366,12 @@ void TOKEN::previous( TOKEN *previous )
_previous = previous;
}
void TOKEN::insertToken( const char *str )
void TOKEN::insertToken( const char str[] )
{
TOKEN *newToken = new TOKEN;
newToken->setstr( str );
newToken->_linenr = _linenr;
newToken->_fileIndex = _fileIndex;
if( this->next() )
{
newToken->next( this->next() );

View File

@ -141,7 +141,7 @@ public:
* relations between next and previous token also.
* @param str String for the new token.
*/
void insertToken( const char *str );
void insertToken( const char str[] );
TOKEN *previous() const;