Extend 'Token::deleteNext' by introducing a new parameter which determines how many tokens should be deleted. It's still not used, though.
This commit is contained in:
parent
5cc5330d95
commit
76972e8dd3
1
AUTHORS
1
AUTHORS
|
@ -2,6 +2,7 @@ The cppcheck team, in alphabetical order:
|
|||
|
||||
Bill Egert
|
||||
Daniel Marjamäki
|
||||
Edoardo Prezioso
|
||||
Gianluca Scacco
|
||||
Greg Hewgill
|
||||
Hoang Tuan Su
|
||||
|
|
|
@ -121,11 +121,14 @@ std::string Token::strValue() const
|
|||
return _str.substr(1, _str.length() - 2);
|
||||
}
|
||||
|
||||
void Token::deleteNext()
|
||||
void Token::deleteNext(unsigned long index)
|
||||
{
|
||||
Token *n = _next;
|
||||
_next = n->next();
|
||||
delete n;
|
||||
while(_next && index--) {
|
||||
Token *n = _next;
|
||||
_next = n->next();
|
||||
delete n;
|
||||
}
|
||||
|
||||
if (_next)
|
||||
_next->previous(this);
|
||||
else if (tokensBack)
|
||||
|
|
|
@ -59,9 +59,9 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Unlink and delete next token.
|
||||
* Unlink and delete the next 'index' tokens.
|
||||
*/
|
||||
void deleteNext();
|
||||
void deleteNext(unsigned long index = 1);
|
||||
|
||||
/**
|
||||
* Returns token in given index, related to this token.
|
||||
|
|
Loading…
Reference in New Issue