Skip to content
New issue

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

tutorial1 #261

Open
EthanQi-zx opened this issue Feb 18, 2025 · 1 comment
Open

tutorial1 #261

EthanQi-zx opened this issue Feb 18, 2025 · 1 comment

Comments

@EthanQi-zx
Copy link

请问为啥tutorial1里的 “lept_parse() 没有把 v.type 改成 LEPT_NULL”,
static int lept_parse_null(lept_context* c, lept_value* v) { EXPECT(c, 'n'); if (c->json[0] != 'u' || c->json[1] != 'l' || c->json[2] != 'l') return LEPT_PARSE_INVALID_VALUE; c->json += 3; v->type = LEPT_NULL; return LEPT_PARSE_OK; }
这里最后返回LEPT_PARSE_OK之前不是吧v-type设置成LEPT_NULL了吗?

@colorsmc
Copy link

改了啊,你可以用lept_get_type()获取一下v.type的值看一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants