From ca9f71752beab713e555ceeb551c3465e8619fbe Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 26 Dec 2023 14:42:36 +0800 Subject: [PATCH] fix --- include/json5.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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