Commit c8187e0
authored
feat(typia): align lenient parse recovery with TS parity (#336)
## Summary
- align Rust `typia` lenient JSON EOF recovery with upstream TS behavior
- add upstream parse parity test coverage (66 mapped parse cases)
- expand runtime `validate`/`stringify` boundary tests
- sync typia contracts/docs with parity baseline and explicit exclusions
## Details
- update `crates/typia/src/lenient_json.rs` to recover truncated EOF
inputs without parser-token errors
- keep syntax/token violations and depth guard as failures
- add `crates/typia/tests/llm_json_parse_parity.rs` with table-driven
parity checks
- update `crates/typia/tests/llm_data_runtime.rs` expectations for
recovery semantics
- update docs:
- `docs/crates-typia-core-foundation.md`
- `docs/project-typia.md`
- `crates/typia/README.md`
## Explicit parity exclusions
- JS `undefined` expectations
- non-finite numbers (`Infinity`, `-Infinity`)
- lone-surrogate code-unit expectations
## Validation
- `cargo test -p typia`
- `cargo test`1 parent 264aff2 commit c8187e0
6 files changed
Lines changed: 515 additions & 34 deletions
File tree
- crates/typia
- src
- tests
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
51 | 68 | | |
52 | 69 | | |
53 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | 237 | | |
243 | 238 | | |
244 | 239 | | |
| |||
256 | 251 | | |
257 | 252 | | |
258 | 253 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | 254 | | |
265 | 255 | | |
266 | 256 | | |
| |||
275 | 265 | | |
276 | 266 | | |
277 | 267 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 268 | | |
284 | 269 | | |
285 | 270 | | |
| |||
332 | 317 | | |
333 | 318 | | |
334 | 319 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | 320 | | |
341 | 321 | | |
342 | 322 | | |
343 | 323 | | |
344 | | - | |
| 324 | + | |
345 | 325 | | |
346 | 326 | | |
347 | 327 | | |
| |||
417 | 397 | | |
418 | 398 | | |
419 | 399 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | 400 | | |
426 | 401 | | |
427 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | | - | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
0 commit comments