diff --git a/doc/dom.md b/doc/dom.md index 24f1a39..cb25fc4 100644 --- a/doc/dom.md +++ b/doc/dom.md @@ -115,6 +115,7 @@ Parse flags | Meaning `kParseIterativeFlag` | Iterative(constant complexity in terms of function call stack size) parsing. `kParseStopWhenDoneFlag` | After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate `kParseErrorDocumentRootNotSingular` error. Using this flag for parsing multiple JSONs in the same stream. `kParseFullPrecisionFlag` | Parse number in full precision (slower). If this flag is not set, the normal precision (faster) is used. Normal precision has maximum 3 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) error. +`kParseCommentsFlag` | Allow one-line `// ...` and multi-line `/* ... */` comments (relaxed JSON syntax). By using a non-type template parameter, instead of a function parameter, C++ compiler can generate code which is optimized for specified combinations, improving speed, and reducing code size (if only using a single specialization). The downside is the flags needed to be determined in compile-time. diff --git a/doc/dom.zh-cn.md b/doc/dom.zh-cn.md index bb4eafb..2adf343 100644 --- a/doc/dom.zh-cn.md +++ b/doc/dom.zh-cn.md @@ -115,6 +115,7 @@ GenericDocument& GenericDocument::Parse(const Ch* str); `kParseIterativeFlag` | 迭代式(调用堆栈大小为常数复杂度)解析。 `kParseStopWhenDoneFlag` | 当从流解析了一个完整的JSON根节点之后,停止继续处理余下的流。当使用了此标志,解析器便不会产生`kParseErrorDocumentRootNotSingular`错误。可使用本标志去解析同一个流里的多个JSON。 `kParseFullPrecisionFlag` | 使用完整的精确度去解析数字(较慢)。如不设置此标节,则会使用正常的精确度(较快)。正常精确度会有最多3个[ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place)的误差。 +`kParseCommentsFlag` | 容许单行 `// ...` 及多行 `/* ... */` 注释(放宽的JSON语法)。 由于使用了非类型模板参数,而不是函数参数,C++编译器能为个别组合生成代码,以改善性能及减少代码尺寸(当只用单种特化)。缺点是需要在编译期决定标志。 diff --git a/doc/features.md b/doc/features.md index fc54cd0..6b529a7 100644 --- a/doc/features.md +++ b/doc/features.md @@ -23,6 +23,8 @@ * Support Unicode surrogate. * 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. ## Unicode diff --git a/doc/features.zh-cn.md b/doc/features.zh-cn.md index 3a01a4b..85a7db1 100644 --- a/doc/features.zh-cn.md +++ b/doc/features.zh-cn.md @@ -23,6 +23,8 @@ * 支持Unicod代理对(surrogate pair)。 * 支持空字符(`"\u0000"`)。 * 例如,可以优雅地解析及处理`["Hello\u0000World"]`。含读写字符串长度的API。 +* 支持放宽的可选语法 + * 单行(`// ...`)及多行(`/* ... */`) 注释。 ## Unicode