diff --git a/include/json5.hpp b/include/json5.hpp index 1206ee3..984ce77 100644 --- a/include/json5.hpp +++ b/include/json5.hpp @@ -143,18 +143,18 @@ class parser5 enum class TokenType { - punctuator = 0, + eof = 0 + punctuator, identifier, null, boolean, numeric, string, - eof, }; struct Token { - TokenType type; + TokenType type = TokenType::eof; value _value; size_t col = 0; size_t line = 0; @@ -823,6 +823,7 @@ inline typename parser5::Token parser5::lex() return token.value(); } } + return Token{ TokenType::eof, value(), _line, _col }; } template