Skip to content

Commit

Permalink
even more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dhconnelly committed Nov 28, 2024
1 parent 0daf43f commit 456370d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/json/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ constexpr const std::string_view to_string(TokenType type) {
}

int Scanner::GetChar() {
if (pos_ >= size_) return EOF;
if (pos_ >= size_) {
LOG(DEBUG) << std::format("exhausted stream, pos = {}, size = {}", pos_,
size_);
return EOF;
}
clearerr(f_);
int c = fgetc(f_);
if (c != EOF) ++pos_;
if (c != EOF) {
++pos_;
LOG(DEBUG) << std::format("no eof, got {}, new pos = {}", c, pos_);
} else {
LOG(DEBUG) << std::format("got legitimate eof at pos {}", pos_);
}
return c;
}

Expand Down

0 comments on commit 456370d

Please sign in to comment.