Skip to content

Commit 2b908f6

Browse files
committed
Implement JSON::ResumableParser
Only available on MRI for now.
1 parent 53f9d99 commit 2b908f6

4 files changed

Lines changed: 954 additions & 129 deletions

File tree

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
### Unreleased
44

5+
* Changed the C parser to no longer be recursive, so parsing very deep documents with `max_nesting: false` will no longer
6+
result in `SystemStackError stack level too deep` errors.
7+
* Added `JSON::ResumableParser` to parse streams of JSON documents. Not yet available on JRuby.
58
* Deprecate default support of JavaScript comments in the parser and add `allow_comments: true` parsing option.
69
* Integrate with Ruby 4.1 `ruby_sized_xfree`.
710

ext/json/ext/json.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@
2828
#else
2929
# define JSON_UNREACHABLE_RETURN UNREACHABLE_RETURN
3030
#endif
31+
3132
/* shims */
3233

34+
#ifndef UNDEF_P
35+
#define UNDEF_P(val) (val == Qundef)
36+
#endif
37+
3338
#if SIZEOF_UINT64_T == SIZEOF_LONG_LONG
3439
# define INT64T2NUM(x) LL2NUM(x)
3540
# define UINT64T2NUM(x) ULL2NUM(x)

0 commit comments

Comments
 (0)