We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int lept_parse(lept_value* v, const char* json) { lept_context c; int ret; assert(v != NULL); c.json = json; v->type = LEPT_NULL; lept_parse_whitespace(&c); if ((ret = lept_parse_value(&c, v)) == LEPT_PARSE_OK) { lept_parse_whitespace(&c); if (*c.json != '\0') ret = LEPT_PARSE_ROOT_NOT_SINGULAR; } return ret; }
老师好,不知道是不是找到了一个小纰漏, :> 因为在之前规定了lept_parse() 若失败,会把 v 设为 null 类型,所以我觉得,应该在判断JSON文本没有完结之后,加一句 v->type =LEPT_NULL,这样在 test_parse_root_not_singular() 函数中,可以正确 解析"false x"; 这类的情况。否则 EXPECT_EQ_INT(LEPT_NULL, lept_get_type(&v));将会打印错误信息。
v->type =LEPT_NULL
test_parse_root_not_singular()
EXPECT_EQ_INT(LEPT_NULL, lept_get_type(&v));
The text was updated successfully, but these errors were encountered:
参见 #11
Sorry, something went wrong.
No branches or pull requests
老师好,不知道是不是找到了一个小纰漏, :>
因为在之前规定了lept_parse() 若失败,会把 v 设为 null 类型,所以我觉得,应该在判断JSON文本没有完结之后,加一句
v->type =LEPT_NULL
,这样在test_parse_root_not_singular()
函数中,可以正确 解析"false x"; 这类的情况。否则EXPECT_EQ_INT(LEPT_NULL, lept_get_type(&v));
将会打印错误信息。The text was updated successfully, but these errors were encountered: