Change RJP_PARSE_NONE to RJP_PARSE_NO_EXT to better clarify its purpose

This commit is contained in:
rexy712 2020-04-09 14:53:05 -07:00
parent 6813cfc9ea
commit df95db7882
6 changed files with 178 additions and 182 deletions

View File

@ -66,7 +66,7 @@ typedef enum RJP_format_flag{
}RJP_format_flag;
typedef enum RJP_parse_flag{
RJP_PARSE_NONE = 0,
RJP_PARSE_NO_EXT = 0,
RJP_PARSE_ALLOW_COMMENTS = 1,
RJP_PARSE_ALLOW_TRAILING_COMMA = 2,
RJP_PARSE_ALL_EXT = RJP_PARSE_ALLOW_COMMENTS | RJP_PARSE_ALLOW_TRAILING_COMMA
@ -117,7 +117,6 @@ typedef struct RJP_parse_error{
/***************** NON OBJECT OPERATIONS *******************/
void* rjp_alloc(RJP_index nbytes);
void* rjp_calloc(RJP_index num, RJP_index nbytes);
void* rjp_realloc(void* ptr, RJP_index nbytes);
void rjp_free(void* dest);
RJP_index rjp_escape_strcpy(char* dest, const char* src);

View File

@ -49,8 +49,8 @@ namespace rjp{
};
string to_json(const value& val, int format = RJP_FORMAT_PRETTY);
parse_res parse_json(const rexy::string_base& str, RJP_parse_flag = RJP_PARSE_NONE);
parse_res parse_json(const char* str, RJP_parse_flag = RJP_PARSE_NONE);
parse_res parse_json(const rexy::string_base& str, RJP_parse_flag = RJP_PARSE_NO_EXT);
parse_res parse_json(const char* str, RJP_parse_flag = RJP_PARSE_NO_EXT);
namespace detail{
template<int... Indexes>
struct sequence_tup{};

View File

@ -41,49 +41,49 @@ struct parse_pair{
};
struct parse_pair should_pass_strings[] = {
{"{}", RJP_PARSE_NONE},
{"[]", RJP_PARSE_NONE},
{"\"s\"", RJP_PARSE_NONE},
{"\"\\n\"", RJP_PARSE_NONE},
{"\"\\\"\"", RJP_PARSE_NONE},
{"\"str\\nstr\"", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE10\"", RJP_PARSE_NONE},
{"true", RJP_PARSE_NONE},
{"false", RJP_PARSE_NONE},
{"null", RJP_PARSE_NONE},
{"5", RJP_PARSE_NONE},
{"-5", RJP_PARSE_NONE},
{"+5", RJP_PARSE_NONE},
{"5.5", RJP_PARSE_NONE},
{"-5.5", RJP_PARSE_NONE},
{"+5.5", RJP_PARSE_NONE},
{"5.5e6", RJP_PARSE_NONE},
{"-5.5e6", RJP_PARSE_NONE},
{"+5.5e6", RJP_PARSE_NONE},
{"5.5e+6", RJP_PARSE_NONE},
{"-5.5e+6", RJP_PARSE_NONE},
{"+5.5e+6", RJP_PARSE_NONE},
{"5.5e-6", RJP_PARSE_NONE},
{"-5.5e-6", RJP_PARSE_NONE},
{"+5.5e-6", RJP_PARSE_NONE},
{" {}", RJP_PARSE_NONE},
{"\n{}\n", RJP_PARSE_NONE},
{" { \"key\" \t:\n\n\n5 \n\t\n } ", RJP_PARSE_NONE},
{" {\t }\n", RJP_PARSE_NONE},
{"5.5 ", RJP_PARSE_NONE},
{"{\"key\":5}", RJP_PARSE_NONE},
{"{\"key\":{}}", RJP_PARSE_NONE},
{"{\"\\uD83D\\uDE10\":5}", RJP_PARSE_NONE},
{"{\"😐\":5}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5}}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5,\"key2\":6}}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5},\"key2\":6}", RJP_PARSE_NONE},
{"[5, 6, 7, 8, 9, \"10\"]", RJP_PARSE_NONE},
{"[[5,6],[7,8],[9,\"10\"]]", RJP_PARSE_NONE},
{"{\"arr\":[5,6,6]}", RJP_PARSE_NONE},
{"[{\"arr\":[5,6,6]}]", RJP_PARSE_NONE},
{"[{\"arr\":[5,6,6]}, 6]", RJP_PARSE_NONE},
{"[5,6,6,6,6.6]", RJP_PARSE_NONE},
{"{}", RJP_PARSE_NO_EXT},
{"[]", RJP_PARSE_NO_EXT},
{"\"s\"", RJP_PARSE_NO_EXT},
{"\"\\n\"", RJP_PARSE_NO_EXT},
{"\"\\\"\"", RJP_PARSE_NO_EXT},
{"\"str\\nstr\"", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"true", RJP_PARSE_NO_EXT},
{"false", RJP_PARSE_NO_EXT},
{"null", RJP_PARSE_NO_EXT},
{"5", RJP_PARSE_NO_EXT},
{"-5", RJP_PARSE_NO_EXT},
{"+5", RJP_PARSE_NO_EXT},
{"5.5", RJP_PARSE_NO_EXT},
{"-5.5", RJP_PARSE_NO_EXT},
{"+5.5", RJP_PARSE_NO_EXT},
{"5.5e6", RJP_PARSE_NO_EXT},
{"-5.5e6", RJP_PARSE_NO_EXT},
{"+5.5e6", RJP_PARSE_NO_EXT},
{"5.5e+6", RJP_PARSE_NO_EXT},
{"-5.5e+6", RJP_PARSE_NO_EXT},
{"+5.5e+6", RJP_PARSE_NO_EXT},
{"5.5e-6", RJP_PARSE_NO_EXT},
{"-5.5e-6", RJP_PARSE_NO_EXT},
{"+5.5e-6", RJP_PARSE_NO_EXT},
{" {}", RJP_PARSE_NO_EXT},
{"\n{}\n", RJP_PARSE_NO_EXT},
{" { \"key\" \t:\n\n\n5 \n\t\n } ", RJP_PARSE_NO_EXT},
{" {\t }\n", RJP_PARSE_NO_EXT},
{"5.5 ", RJP_PARSE_NO_EXT},
{"{\"key\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":{}}", RJP_PARSE_NO_EXT},
{"{\"\\uD83D\\uDE10\":5}", RJP_PARSE_NO_EXT},
{"{\"😐\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5}}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5,\"key2\":6}}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5},\"key2\":6}", RJP_PARSE_NO_EXT},
{"[5, 6, 7, 8, 9, \"10\"]", RJP_PARSE_NO_EXT},
{"[[5,6],[7,8],[9,\"10\"]]", RJP_PARSE_NO_EXT},
{"{\"arr\":[5,6,6]}", RJP_PARSE_NO_EXT},
{"[{\"arr\":[5,6,6]}]", RJP_PARSE_NO_EXT},
{"[{\"arr\":[5,6,6]}, 6]", RJP_PARSE_NO_EXT},
{"[5,6,6,6,6.6]", RJP_PARSE_NO_EXT},
{"[6,7,]", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"{\"1\":1,\"2\":2,}", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"[6,]", RJP_PARSE_ALLOW_TRAILING_COMMA},
@ -99,48 +99,48 @@ struct parse_pair should_pass_strings[] = {
};
const int should_pass_cnt = sizeof(should_pass_strings)/sizeof(should_pass_strings[0]);
struct parse_pair should_fail_strings[] = {
{"//comment\n{}", RJP_PARSE_NONE},
{"{", RJP_PARSE_NONE},
{"}", RJP_PARSE_NONE},
{"[", RJP_PARSE_NONE},
{"]", RJP_PARSE_NONE},
{"6.", RJP_PARSE_NONE},
{"6.6e", RJP_PARSE_NONE},
{"6.6e+", RJP_PARSE_NONE},
{"5e", RJP_PARSE_NONE},
{"{6}", RJP_PARSE_NONE},
{"[\"key\":5]", RJP_PARSE_NONE},
{"\"string\n\"", RJP_PARSE_NONE},
{"[3 4]", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE1\"", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE1Q\"", RJP_PARSE_NONE},
{"\"\\uD83\\uDE10\"", RJP_PARSE_NONE},
{"\"\\uF83D\\uDE10\"", RJP_PARSE_NONE},
{"\"\\uU83D\\uDE10\"", RJP_PARSE_NONE},
{"{\"key\":1 \"key2\":2}", RJP_PARSE_NONE},
{"{\"key\" 1}", RJP_PARSE_NONE},
{"6, 7", RJP_PARSE_NONE},
{"[,]", RJP_PARSE_NONE},
{"{, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"[1, 2],", RJP_PARSE_NONE},
{"{\"key\nkey\":5}", RJP_PARSE_NONE},
{"{\"key\":\"key\n\"}", RJP_PARSE_NONE},
{"[6,7,]", RJP_PARSE_NONE},
{"{\"1\":1,\"2\":2, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"[6,]", RJP_PARSE_NONE},
{"{\"1\":1, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"{//comment\"key\":\n5}", RJP_PARSE_NONE},
{"{/*\"key\":*/5}", RJP_PARSE_NONE},
{"[5, /*6*/, 7]", RJP_PARSE_NONE},
{"{/*comment}", RJP_PARSE_NONE},
{"{//comment}", RJP_PARSE_NONE},
{"{\"key\"://comment\n5}", RJP_PARSE_NONE},
{"{\"key\"//comment\n:5}", RJP_PARSE_NONE},
{"{}//comment", RJP_PARSE_NONE},
{"{//\"key\":5\n}", RJP_PARSE_NONE},
{"5 //comment*/", RJP_PARSE_NONE},
{"{/*\"key\":5*/\"key\":5}", RJP_PARSE_NONE},
{"[5, /*comment*/6]", RJP_PARSE_NONE},
{"//comment\n{}", RJP_PARSE_NO_EXT},
{"{", RJP_PARSE_NO_EXT},
{"}", RJP_PARSE_NO_EXT},
{"[", RJP_PARSE_NO_EXT},
{"]", RJP_PARSE_NO_EXT},
{"6.", RJP_PARSE_NO_EXT},
{"6.6e", RJP_PARSE_NO_EXT},
{"6.6e+", RJP_PARSE_NO_EXT},
{"5e", RJP_PARSE_NO_EXT},
{"{6}", RJP_PARSE_NO_EXT},
{"[\"key\":5]", RJP_PARSE_NO_EXT},
{"\"string\n\"", RJP_PARSE_NO_EXT},
{"[3 4]", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE1\"", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE1Q\"", RJP_PARSE_NO_EXT},
{"\"\\uD83\\uDE10\"", RJP_PARSE_NO_EXT},
{"\"\\uF83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"\"\\uU83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"{\"key\":1 \"key2\":2}", RJP_PARSE_NO_EXT},
{"{\"key\" 1}", RJP_PARSE_NO_EXT},
{"6, 7", RJP_PARSE_NO_EXT},
{"[,]", RJP_PARSE_NO_EXT},
{"{, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"[1, 2],", RJP_PARSE_NO_EXT},
{"{\"key\nkey\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":\"key\n\"}", RJP_PARSE_NO_EXT},
{"[6,7,]", RJP_PARSE_NO_EXT},
{"{\"1\":1,\"2\":2, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"[6,]", RJP_PARSE_NO_EXT},
{"{\"1\":1, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"{//comment\"key\":\n5}", RJP_PARSE_NO_EXT},
{"{/*\"key\":*/5}", RJP_PARSE_NO_EXT},
{"[5, /*6*/, 7]", RJP_PARSE_NO_EXT},
{"{/*comment}", RJP_PARSE_NO_EXT},
{"{//comment}", RJP_PARSE_NO_EXT},
{"{\"key\"://comment\n5}", RJP_PARSE_NO_EXT},
{"{\"key\"//comment\n:5}", RJP_PARSE_NO_EXT},
{"{}//comment", RJP_PARSE_NO_EXT},
{"{//\"key\":5\n}", RJP_PARSE_NO_EXT},
{"5 //comment*/", RJP_PARSE_NO_EXT},
{"{/*\"key\":5*/\"key\":5}", RJP_PARSE_NO_EXT},
{"[5, /*comment*/6]", RJP_PARSE_NO_EXT},
{"{\"key\"//:5}", RJP_PARSE_ALLOW_COMMENTS},
{"{,}", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"[,]", RJP_PARSE_ALLOW_TRAILING_COMMA},

View File

@ -30,9 +30,6 @@ void* rjp_alloc(RJP_index nbytes){
void* rjp_calloc(RJP_index num, RJP_index nbytes){
return calloc(num, nbytes);
}
void* rjp_realloc(void* ptr, RJP_index nbytes){
return realloc(ptr, nbytes);
}
void rjp_free(void* data){
free(data);
}

View File

@ -374,7 +374,7 @@ void rjp_delete_parse_error(RJP_parse_error* err){
}
RJP_value* rjp_simple_parse(const char* str){
return rjp_parse(str, RJP_PARSE_NONE, NULL);
return rjp_parse(str, RJP_PARSE_NO_EXT, NULL);
}
RJP_value* rjp_parse(const char* str, int flags, RJP_parse_error* err){

View File

@ -63,53 +63,53 @@ struct parse_pair{
};
struct parse_pair should_pass_strings[] = {
{"{}", RJP_PARSE_NONE},
{"[]", RJP_PARSE_NONE},
{"\"s\"", RJP_PARSE_NONE},
{"\"\"", RJP_PARSE_NONE},
{"\"\\n\"", RJP_PARSE_NONE},
{"\"\\\"\"", RJP_PARSE_NONE},
{"\"str\\nstr\"", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE10\"", RJP_PARSE_NONE},
{"true", RJP_PARSE_NONE},
{"false", RJP_PARSE_NONE},
{"null", RJP_PARSE_NONE},
{"5", RJP_PARSE_NONE},
{"-5", RJP_PARSE_NONE},
{"+5", RJP_PARSE_NONE},
{"5.5", RJP_PARSE_NONE},
{"-5.5", RJP_PARSE_NONE},
{"+5.5", RJP_PARSE_NONE},
{"5.5e6", RJP_PARSE_NONE},
{"-5.5e6", RJP_PARSE_NONE},
{"+5.5e6", RJP_PARSE_NONE},
{"5.5e+6", RJP_PARSE_NONE},
{"-5.5e+6", RJP_PARSE_NONE},
{"+5.5e+6", RJP_PARSE_NONE},
{"5.5e-6", RJP_PARSE_NONE},
{"-5.5e-6", RJP_PARSE_NONE},
{"+5.5e-6", RJP_PARSE_NONE},
{" {}", RJP_PARSE_NONE},
{"\n{}\n", RJP_PARSE_NONE},
{" { \"key\" \t:\n\n\n5 \n\t\n } ", RJP_PARSE_NONE},
{" {\t }\n", RJP_PARSE_NONE},
{"5.5 ", RJP_PARSE_NONE},
{"{\"key\":5}", RJP_PARSE_NONE},
{"{\"key\":\"\"}", RJP_PARSE_NONE},
{"{\"key\":{}}", RJP_PARSE_NONE},
{"{\"\\uD83D\\uDE10\":5}", RJP_PARSE_NONE},
{"{\"😐\":5}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5}}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5,\"key2\":6}}", RJP_PARSE_NONE},
{"{\"key\":{\"key\":5},\"key2\":6}", RJP_PARSE_NONE},
{"[5, 6, 7, 8, 9, \"10\"]", RJP_PARSE_NONE},
{"[[5,6],[7,8],[9,\"10\"]]", RJP_PARSE_NONE},
{"{\"arr\":[5,6,6]}", RJP_PARSE_NONE},
{"[{\"arr\":[5,6,6]}]", RJP_PARSE_NONE},
{"[{\"arr\":[5,6,6]}, 6]", RJP_PARSE_NONE},
{"[5,6,6,6,6.6]", RJP_PARSE_NONE},
{"{}", RJP_PARSE_NO_EXT},
{"[]", RJP_PARSE_NO_EXT},
{"\"s\"", RJP_PARSE_NO_EXT},
{"\"\"", RJP_PARSE_NO_EXT},
{"\"\\n\"", RJP_PARSE_NO_EXT},
{"\"\\\"\"", RJP_PARSE_NO_EXT},
{"\"str\\nstr\"", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"true", RJP_PARSE_NO_EXT},
{"false", RJP_PARSE_NO_EXT},
{"null", RJP_PARSE_NO_EXT},
{"5", RJP_PARSE_NO_EXT},
{"-5", RJP_PARSE_NO_EXT},
{"+5", RJP_PARSE_NO_EXT},
{"5.5", RJP_PARSE_NO_EXT},
{"-5.5", RJP_PARSE_NO_EXT},
{"+5.5", RJP_PARSE_NO_EXT},
{"5.5e6", RJP_PARSE_NO_EXT},
{"-5.5e6", RJP_PARSE_NO_EXT},
{"+5.5e6", RJP_PARSE_NO_EXT},
{"5.5e+6", RJP_PARSE_NO_EXT},
{"-5.5e+6", RJP_PARSE_NO_EXT},
{"+5.5e+6", RJP_PARSE_NO_EXT},
{"5.5e-6", RJP_PARSE_NO_EXT},
{"-5.5e-6", RJP_PARSE_NO_EXT},
{"+5.5e-6", RJP_PARSE_NO_EXT},
{" {}", RJP_PARSE_NO_EXT},
{"\n{}\n", RJP_PARSE_NO_EXT},
{" { \"key\" \t:\n\n\n5 \n\t\n } ", RJP_PARSE_NO_EXT},
{" {\t }\n", RJP_PARSE_NO_EXT},
{"5.5 ", RJP_PARSE_NO_EXT},
{"{\"key\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":\"\"}", RJP_PARSE_NO_EXT},
{"{\"key\":{}}", RJP_PARSE_NO_EXT},
{"{\"\\uD83D\\uDE10\":5}", RJP_PARSE_NO_EXT},
{"{\"😐\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5}}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5,\"key2\":6}}", RJP_PARSE_NO_EXT},
{"{\"key\":{\"key\":5},\"key2\":6}", RJP_PARSE_NO_EXT},
{"[5, 6, 7, 8, 9, \"10\"]", RJP_PARSE_NO_EXT},
{"[[5,6],[7,8],[9,\"10\"]]", RJP_PARSE_NO_EXT},
{"{\"arr\":[5,6,6]}", RJP_PARSE_NO_EXT},
{"[{\"arr\":[5,6,6]}]", RJP_PARSE_NO_EXT},
{"[{\"arr\":[5,6,6]}, 6]", RJP_PARSE_NO_EXT},
{"[5,6,6,6,6.6]", RJP_PARSE_NO_EXT},
{"[6,7,]", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"[\"value\",\"\"]", RJP_PARSE_NONE},
{"[\"value\",\"\"]", RJP_PARSE_NO_EXT},
{"{\"1\":1,\"2\":2,}", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"[6,]", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"{\"1\":1,}", RJP_PARSE_ALLOW_TRAILING_COMMA},
@ -124,49 +124,49 @@ struct parse_pair should_pass_strings[] = {
};
const int should_pass_cnt = sizeof(should_pass_strings)/sizeof(should_pass_strings[0]);
struct parse_pair should_fail_strings[] = {
{"//comment\n{}", RJP_PARSE_NONE},
{"{", RJP_PARSE_NONE},
{"}", RJP_PARSE_NONE},
{"[", RJP_PARSE_NONE},
{"]", RJP_PARSE_NONE},
{"6.", RJP_PARSE_NONE},
{"6.6e", RJP_PARSE_NONE},
{"6.6e+", RJP_PARSE_NONE},
{"5e", RJP_PARSE_NONE},
{"{6}", RJP_PARSE_NONE},
{"{\"\":5}", RJP_PARSE_NONE},
{"[\"key\":5]", RJP_PARSE_NONE},
{"\"string\n\"", RJP_PARSE_NONE},
{"[3 4]", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE1\"", RJP_PARSE_NONE},
{"\"\\uD83D\\uDE1Q\"", RJP_PARSE_NONE},
{"\"\\uD83\\uDE10\"", RJP_PARSE_NONE},
{"\"\\uF83D\\uDE10\"", RJP_PARSE_NONE},
{"\"\\uU83D\\uDE10\"", RJP_PARSE_NONE},
{"{\"key\":1 \"key2\":2}", RJP_PARSE_NONE},
{"{\"key\" 1}", RJP_PARSE_NONE},
{"6, 7", RJP_PARSE_NONE},
{"[,]", RJP_PARSE_NONE},
{"{, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"[1, 2],", RJP_PARSE_NONE},
{"{\"key\nkey\":5}", RJP_PARSE_NONE},
{"{\"key\":\"key\n\"}", RJP_PARSE_NONE},
{"[6,7,]", RJP_PARSE_NONE},
{"{\"1\":1,\"2\":2, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"[6,]", RJP_PARSE_NONE},
{"{\"1\":1, RJP_PARSE_NONE}", RJP_PARSE_NONE},
{"{//comment\"key\":\n5}", RJP_PARSE_NONE},
{"{/*\"key\":*/5}", RJP_PARSE_NONE},
{"[5, /*6*/, 7]", RJP_PARSE_NONE},
{"{/*comment}", RJP_PARSE_NONE},
{"{//comment}", RJP_PARSE_NONE},
{"{\"key\"://comment\n5}", RJP_PARSE_NONE},
{"{\"key\"//comment\n:5}", RJP_PARSE_NONE},
{"{}//comment", RJP_PARSE_NONE},
{"{//\"key\":5\n}", RJP_PARSE_NONE},
{"5 //comment*/", RJP_PARSE_NONE},
{"{/*\"key\":5*/\"key\":5}", RJP_PARSE_NONE},
{"[5, /*comment*/6]", RJP_PARSE_NONE},
{"//comment\n{}", RJP_PARSE_NO_EXT},
{"{", RJP_PARSE_NO_EXT},
{"}", RJP_PARSE_NO_EXT},
{"[", RJP_PARSE_NO_EXT},
{"]", RJP_PARSE_NO_EXT},
{"6.", RJP_PARSE_NO_EXT},
{"6.6e", RJP_PARSE_NO_EXT},
{"6.6e+", RJP_PARSE_NO_EXT},
{"5e", RJP_PARSE_NO_EXT},
{"{6}", RJP_PARSE_NO_EXT},
{"{\"\":5}", RJP_PARSE_NO_EXT},
{"[\"key\":5]", RJP_PARSE_NO_EXT},
{"\"string\n\"", RJP_PARSE_NO_EXT},
{"[3 4]", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE1\"", RJP_PARSE_NO_EXT},
{"\"\\uD83D\\uDE1Q\"", RJP_PARSE_NO_EXT},
{"\"\\uD83\\uDE10\"", RJP_PARSE_NO_EXT},
{"\"\\uF83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"\"\\uU83D\\uDE10\"", RJP_PARSE_NO_EXT},
{"{\"key\":1 \"key2\":2}", RJP_PARSE_NO_EXT},
{"{\"key\" 1}", RJP_PARSE_NO_EXT},
{"6, 7", RJP_PARSE_NO_EXT},
{"[,]", RJP_PARSE_NO_EXT},
{"{, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"[1, 2],", RJP_PARSE_NO_EXT},
{"{\"key\nkey\":5}", RJP_PARSE_NO_EXT},
{"{\"key\":\"key\n\"}", RJP_PARSE_NO_EXT},
{"[6,7,]", RJP_PARSE_NO_EXT},
{"{\"1\":1,\"2\":2, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"[6,]", RJP_PARSE_NO_EXT},
{"{\"1\":1, RJP_PARSE_NO_EXT}", RJP_PARSE_NO_EXT},
{"{//comment\"key\":\n5}", RJP_PARSE_NO_EXT},
{"{/*\"key\":*/5}", RJP_PARSE_NO_EXT},
{"[5, /*6*/, 7]", RJP_PARSE_NO_EXT},
{"{/*comment}", RJP_PARSE_NO_EXT},
{"{//comment}", RJP_PARSE_NO_EXT},
{"{\"key\"://comment\n5}", RJP_PARSE_NO_EXT},
{"{\"key\"//comment\n:5}", RJP_PARSE_NO_EXT},
{"{}//comment", RJP_PARSE_NO_EXT},
{"{//\"key\":5\n}", RJP_PARSE_NO_EXT},
{"5 //comment*/", RJP_PARSE_NO_EXT},
{"{/*\"key\":5*/\"key\":5}", RJP_PARSE_NO_EXT},
{"[5, /*comment*/6]", RJP_PARSE_NO_EXT},
{"{\"key\"//:5}", RJP_PARSE_ALLOW_COMMENTS},
{"{,}", RJP_PARSE_ALLOW_TRAILING_COMMA},
{"[,]", RJP_PARSE_ALLOW_TRAILING_COMMA},