Commit f9797f8e by Niels

try

parent 1aebb6e6
......@@ -2402,7 +2402,8 @@ class basic_json
end_object,
name_separator,
value_separator,
parse_error
parse_error,
end_of_input
};
/// the type of a lexer character
......@@ -2611,15 +2612,19 @@ class basic_json
re2c:define:YYLIMIT = buffer_re2c_limit;
*/
for (;;)
{
lexer_start:
// set current to the begin of the buffer
current_re2c = buffer_re2c;
if (current_re2c == buffer_re2c_limit)
{
return last_token = token_type::end_of_input;
}
/*!re2c
// whitespace
ws = [ \t\n\r]*;
ws { continue; }
ws { goto lexer_start; }
// structural characters
"[" { return last_token = token_type::begin_array; }
......@@ -2661,7 +2666,6 @@ class basic_json
* { return last_token = token_type::parse_error; }
*/
}
}
inline static std::string token_type_name(token_type t)
{
......@@ -2693,6 +2697,8 @@ class basic_json
return ",";
case (token_type::parse_error):
return "<parse error>";
case (token_type::end_of_input):
return "<end of input>";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment