diff options
| author | skewb1k <skewb1kunix@gmail.com> | 2026-02-10 03:59:11 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-10 08:59:11 +0800 |
| commit | fed8c8356be4d94ceb55f2880bdb77fd9b55ef1e (patch) | |
| tree | 07a6044110a57d509da45f99ae0a80054386abc7 /README.md | |
| parent | ea05d06f5a56d94d423fc697561a33ca3b8bf085 (diff) | |
| download | lua-cjson-fed8c8356be4d94ceb55f2880bdb77fd9b55ef1e.tar.gz lua-cjson-fed8c8356be4d94ceb55f2880bdb77fd9b55ef1e.tar.bz2 lua-cjson-fed8c8356be4d94ceb55f2880bdb77fd9b55ef1e.zip | |
feature: add option to allow comments in decode.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -262,3 +262,16 @@ cjson.encode(t) -- {"my_array":[]} properly re-encoded as an array | |||
| 262 | ``` | 262 | ``` |
| 263 | 263 | ||
| 264 | [Back to TOC](#table-of-contents) | 264 | [Back to TOC](#table-of-contents) |
| 265 | |||
| 266 | decode_allow_comments | ||
| 267 | -------------------------- | ||
| 268 | **syntax:** `cjson.decode_allow_comments(enabled)` | ||
| 269 | |||
| 270 | **default:** false | ||
| 271 | |||
| 272 | If enabled, allows JavaScript-style comments in `cjson.decode` input. Comments | ||
| 273 | are treated as whitespace and may appear anywhere whitespace is valid in JSON. | ||
| 274 | Supports single-line comments beginning with '//' and block comments enclosed | ||
| 275 | with '/* ... */'. | ||
| 276 | |||
| 277 | [Back to TOC](#table-of-contents) | ||
