Added documentation about kParseTrailingCommasFlag

This commit is contained in:
Milo Yip 2016-04-15 10:18:16 +08:00
parent 6bc606c926
commit 006533cdea
3 changed files with 5 additions and 2 deletions

View File

@ -116,6 +116,7 @@ GenericDocument& GenericDocument::Parse(const Ch* str);
`kParseStopWhenDoneFlag` | 当从流解析了一个完整的JSON根节点之后停止继续处理余下的流。当使用了此标志解析器便不会产生`kParseErrorDocumentRootNotSingular`错误。可使用本标志去解析同一个流里的多个JSON。
`kParseFullPrecisionFlag` | 使用完整的精确度去解析数字较慢。如不设置此标节则会使用正常的精确度较快。正常精确度会有最多3个[ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place)的误差。
`kParseCommentsFlag` | 容许单行 `// ...` 及多行 `/* ... */` 注释放宽的JSON语法
`kParseTrailingCommasFlag` | 容许在对象和数组结束前含有逗号放宽的JSON语法
由于使用了非类型模板参数而不是函数参数C++编译器能为个别组合生成代码,以改善性能及减少代码尺寸(当只用单种特化)。缺点是需要在编译期决定标志。

View File

@ -24,7 +24,8 @@
* Support null character (`"\u0000"`)
* For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.
* Support optional relaxed syntax.
* Single line (`// ...`) and multiple line (`/* ... */`) comments.
* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
## Unicode

View File

@ -24,7 +24,8 @@
* 支持空字符(`"\u0000"`)。
* 例如,可以优雅地解析及处理`["Hello\u0000World"]`。含读写字符串长度的API。
* 支持放宽的可选语法
* 单行(`// ...`)及多行(`/* ... */` 注释。
* 单行(`// ...`)及多行(`/* ... */` 注释(`kParseCommentsFlag`)。
* 在对象和数组结束前含逗号(`kParseTrailingCommasFlag`)。
## Unicode