Skip to content

Commit bd03d16

Browse files
author
Avi SZYCHTER
committed
Small refactor Tokenizer::skipUntil + fix bug where getNextChar was not always EOF at the end of file
1 parent 55cc2b0 commit bd03d16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parsing/Tokenizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ std::string Tokenizer::parseNumber(bool& is_float) {
275275
void Tokenizer::skipUntil(const std::string& token) {
276276
unsigned long long initLine = lineCount();
277277

278-
while(currentToken.image != token &&
279-
currentToken.type != Token::Eof) {
278+
while(currentToken != token &&
279+
currentToken != Token::Eof) {
280280
getNextToken();
281281
}
282282

@@ -298,7 +298,7 @@ char FileTokenizer::doGetNextChar() {
298298
if (inputstream.eof())
299299
return 0;
300300

301-
char result;
301+
char result = 0;
302302
inputstream.get(result);
303303

304304
charCnt += 1;

0 commit comments

Comments
 (0)