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
|
Bill Egert
|
||||||
Daniel Marjamäki
|
Daniel Marjamäki
|
||||||
|
Edoardo Prezioso
|
||||||
Gianluca Scacco
|
Gianluca Scacco
|
||||||
Greg Hewgill
|
Greg Hewgill
|
||||||
Hoang Tuan Su
|
Hoang Tuan Su
|
||||||
|
|
|
@ -121,11 +121,14 @@ std::string Token::strValue() const
|
||||||
return _str.substr(1, _str.length() - 2);
|
return _str.substr(1, _str.length() - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Token::deleteNext()
|
void Token::deleteNext(unsigned long index)
|
||||||
{
|
{
|
||||||
Token *n = _next;
|
while(_next && index--) {
|
||||||
_next = n->next();
|
Token *n = _next;
|
||||||
delete n;
|
_next = n->next();
|
||||||
|
delete n;
|
||||||
|
}
|
||||||
|
|
||||||
if (_next)
|
if (_next)
|
||||||
_next->previous(this);
|
_next->previous(this);
|
||||||
else if (tokensBack)
|
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.
|
* Returns token in given index, related to this token.
|
||||||
|
|
Loading…
Reference in New Issue