Whitespace

This commit is contained in:
Richard Berger 2020-06-11 14:00:13 -04:00
parent f25f7fee8d
commit 43d3133583
No known key found for this signature in database
GPG Key ID: A9E83994E0BA0CAB
1 changed files with 5 additions and 5 deletions

View File

@ -35,13 +35,13 @@ Tokenizer::Tokenizer(const std::string & str, const std::string & separators) :
reset();
}
Tokenizer::Tokenizer(const Tokenizer & rhs) :
Tokenizer::Tokenizer(const Tokenizer & rhs) :
text(rhs.text), separators(rhs.separators), ntokens(rhs.ntokens)
{
reset();
}
Tokenizer::Tokenizer(Tokenizer && rhs) :
Tokenizer::Tokenizer(Tokenizer && rhs) :
text(std::move(rhs.text)), separators(std::move(rhs.separators)), ntokens(rhs.ntokens)
{
reset();
@ -55,13 +55,13 @@ void Tokenizer::skip(int n) {
for(int i = 0; i < n; ++i) {
if(!has_next()) throw TokenizerException("No more tokens", "");
size_t end = text.find_first_of(separators, start);
size_t end = text.find_first_of(separators, start);
if(end == std::string::npos) {
start = end;
} else {
start = text.find_first_not_of(separators, end+1);
}
}
}
}
@ -78,7 +78,7 @@ std::string Tokenizer::next() {
std::string token = text.substr(start);
start = end;
return token;
}
}
std::string token = text.substr(start, end-start);
start = text.find_first_not_of(separators, end+1);