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
为什么在string解析的时候会 判断是否有 ' \" ' 来判断是否是一个string ,而在tutorial07没有将 ' \" ' 添加回来
The text was updated successfully, but these errors were encountered:
在tutorial07_answer.md中的生成字符串一节里有
tutorial07_answer.md
static void lept_stringify_string(lept_context* c, const char* s, size_t len) { size_t i; assert(s != NULL); PUTC(c, '"'); // add string begin mark for (i = 0; i < len; i++) { unsigned char ch = (unsigned char)s[i]; switch (ch) { /* ... */ } } PUTC(c, '"'); // add string end mark }
有两个PUTC,加回来了。
Sorry, something went wrong.
在tutorial07_answer.md中的生成字符串一节里有 static void lept_stringify_string(lept_context* c, const char* s, size_t len) { size_t i; assert(s != NULL); PUTC(c, '"'); // add string begin mark for (i = 0; i < len; i++) { unsigned char ch = (unsigned char)s[i]; switch (ch) { /* ... */ } } PUTC(c, '"'); // add string end mark } 有两个PUTC,加回来了。
为什么加的不是' \" ' ,
因为这里的\是转义符。而双引号的转义符是可选的。也就是说:
\
PUTC(c, '\"'); PUTC(c, '"');
是等价的。两者都会添加一个双引号到字符串里。
No branches or pull requests
为什么在string解析的时候会 判断是否有 ' \" ' 来判断是否是一个string ,而在tutorial07没有将 ' \" ' 添加回来
The text was updated successfully, but these errors were encountered: