-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Make some improvements #130
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
感谢 |
wuxiaoweisjz
pushed a commit
to wuxiaoweisjz/json-tutorial
that referenced
this pull request
Jun 7, 2021
Make some improvements
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
暂时只看了前两章的教程要不等我全看完算了除了第八章,其他的都看完了。请叶老师看看我修改的。如果有不合适的可以讨论一下或者revert掉。Contributors很少啊,都是误操作的_(:з」∠)_
没有判断解析Object的Key时的返回值的测试呢……
代码中用的是判断第一个有效字符不是引号则返回
MissKey
,解析string失败则返回对应的错误代码。我做出来的效果是:解析失败或者解析成功但类型不是string时返回
MissKey
。这个测试需要增加嘛?就用原来的例子就好了,两边加上花括号:
第七章lept_stringify的示例和实际的不一样啊……
不是说直接返回 JSON 的字符串嘛。下面的生成null、false和true也不一样。搜索了一下,所有的代码里都没有
LEPT_STRINGIFY_OK
,只有这个md文件里有。第七章解答中,
ch < 0x20
的输出用的是大写的X:sprintf(buffer, "\\u%04X", ch);
,而且下面写:但是对数字的roundtrip测试用的是小写,解析的代码虽然也是生成的小写
"%.17g"
,两者不一致不好。实际上对ch < 0x20
是没有测试的。TEST_ROUNDTRIP("-0");
是否需要提几句?"-0"用strtod转换成double貌似确实是-0,但是我用C#好像有点难做……我只能想到单独记录符号……GitHub不能渲染Latex呢。有三处,在第八篇里。
最后一项事情就是我在我的第二章的issue里提议的一些东西。