Skip to content

Commit

Permalink
Fixed a small bug in the Turtle Tokenizer's Whitespace parsing. (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
joka921 committed Sep 2, 2021
1 parent 0fabb5f commit 01bfbc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/parser/Tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ class Tokenizer {
void skipWhitespace() {
auto v = view();
auto pos = v.find_first_not_of("\x20\x09\x0D\x0A");
if (pos == string::npos) {
pos = _data.size();
}
pos = std::min(pos, v.size());
_data.remove_prefix(pos);
return;
}
Expand Down
5 changes: 2 additions & 3 deletions src/parser/TokenizerCtre.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,8 @@ class TokenizerCtre {
void skipWhitespace() {
auto v = view();
auto pos = v.find_first_not_of("\x20\x09\x0D\x0A");
if (pos != string::npos) {
_data.remove_prefix(pos);
}
pos = std::min(pos, v.size());
_data.remove_prefix(pos);
}

// ___________________________________________________________________________________
Expand Down

0 comments on commit 01bfbc4

Please sign in to comment.