diff --git a/doc/dom.md b/doc/dom.md index 24f1a39f4c281b09087d7a00288b443fe173e257..cb25fc4f3afe6869204bccc7e5da3ebbcd7b8244 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 bb4eafb4f2dbb30d2289d56a55d9be9e4567eb3e..2adf34354b53672c9a1f015bea194df5d7090374 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`閿欒銆傚彲浣跨敤鏈爣蹇楀幓瑙f瀽鍚屼竴涓祦閲岀殑澶氫釜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 fc54cd03a9cb6a9ba4723dc548272ebf37c67cd6..6b529a776460379b3e35214c264725c33303aa51 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 3a01a4ba845ae1f62c6a88e7f46295bdacbd0c0a..85a7db16274ac08a14acd878449f13eaa43424da 100644 --- a/doc/features.zh-cn.md +++ b/doc/features.zh-cn.md @@ -23,6 +23,8 @@ * 鏀寔Unicod浠g悊瀵癸紙surrogate pair锛夈€� * 鏀寔绌哄瓧绗︼紙`"\u0000"`锛夈€� * 渚嬪锛屽彲浠ヤ紭闆呭湴瑙f瀽鍙婂鐞哷["Hello\u0000World"]`銆傚惈璇诲啓瀛楃涓查暱搴︾殑API銆� +* 鏀寔鏀惧鐨勫彲閫夎娉� + * 鍗曡锛坄// ...`锛夊強澶氳锛坄/* ... */`锛� 娉ㄩ噴銆� ## Unicode