json 2.15.2 → 2.15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/ext/json/ext/parser/parser.c +19 -7
- data/lib/json/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0a73f62257d521165faeb372eafe66beb01fe47b4790256840f4316aa762510
|
|
4
|
+
data.tar.gz: 135d0b30fd72cd54b91b84050fe86a67b1aaf909f2024f5a545288cfbe3a2088
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d51c8d7de86d2581845d73638053da3f7c5aea014da4a960630fd78bba234647e37b301dec74f93069cc584d7f2495a394dc4a5d5514f543dee195413a863ebf
|
|
7
|
+
data.tar.gz: 3a871434b7427979f6c860e7ec33772ff61ddd0d272ac40de51fc887a14f50e65653d70b8276b2b535870a20801d7e6c2068b6f5bfb68293fc0e0de3a82aa729
|
data/CHANGES.md
CHANGED
|
@@ -428,14 +428,9 @@ static void emit_parse_warning(const char *message, JSON_ParserState *state)
|
|
|
428
428
|
|
|
429
429
|
#define PARSE_ERROR_FRAGMENT_LEN 32
|
|
430
430
|
|
|
431
|
-
|
|
432
|
-
RBIMPL_ATTR_NORETURN()
|
|
433
|
-
#endif
|
|
434
|
-
static void raise_parse_error(const char *format, JSON_ParserState *state)
|
|
431
|
+
static VALUE build_parse_error_message(const char *format, JSON_ParserState *state, long line, long column)
|
|
435
432
|
{
|
|
436
433
|
unsigned char buffer[PARSE_ERROR_FRAGMENT_LEN + 3];
|
|
437
|
-
long line, column;
|
|
438
|
-
cursor_position(state, &line, &column);
|
|
439
434
|
|
|
440
435
|
const char *ptr = "EOF";
|
|
441
436
|
if (state->cursor && state->cursor < state->end) {
|
|
@@ -470,11 +465,23 @@ static void raise_parse_error(const char *format, JSON_ParserState *state)
|
|
|
470
465
|
VALUE msg = rb_sprintf(format, ptr);
|
|
471
466
|
VALUE message = rb_enc_sprintf(enc_utf8, "%s at line %ld column %ld", RSTRING_PTR(msg), line, column);
|
|
472
467
|
RB_GC_GUARD(msg);
|
|
468
|
+
return message;
|
|
469
|
+
}
|
|
473
470
|
|
|
471
|
+
static VALUE parse_error_new(VALUE message, long line, long column)
|
|
472
|
+
{
|
|
474
473
|
VALUE exc = rb_exc_new_str(rb_path2class("JSON::ParserError"), message);
|
|
475
474
|
rb_ivar_set(exc, rb_intern("@line"), LONG2NUM(line));
|
|
476
475
|
rb_ivar_set(exc, rb_intern("@column"), LONG2NUM(column));
|
|
477
|
-
|
|
476
|
+
return exc;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
NORETURN(static) void raise_parse_error(const char *format, JSON_ParserState *state)
|
|
480
|
+
{
|
|
481
|
+
long line, column;
|
|
482
|
+
cursor_position(state, &line, &column);
|
|
483
|
+
VALUE message = build_parse_error_message(format, state, line, column);
|
|
484
|
+
rb_exc_raise(parse_error_new(message, line, column));
|
|
478
485
|
}
|
|
479
486
|
|
|
480
487
|
#ifdef RBIMPL_ATTR_NORETURN
|
|
@@ -875,6 +882,11 @@ static void raise_duplicate_key_error(JSON_ParserState *state, VALUE duplicate_k
|
|
|
875
882
|
rb_inspect(duplicate_key)
|
|
876
883
|
);
|
|
877
884
|
|
|
885
|
+
long line, column;
|
|
886
|
+
cursor_position(state, &line, &column);
|
|
887
|
+
rb_str_concat(message, build_parse_error_message("", state, line, column)) ;
|
|
888
|
+
rb_exc_raise(parse_error_new(message, line, column));
|
|
889
|
+
|
|
878
890
|
raise_parse_error(RSTRING_PTR(message), state);
|
|
879
891
|
RB_GC_GUARD(message);
|
|
880
892
|
}
|
data/lib/json/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.15.2
|
|
4
|
+
version: 2.15.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: '0'
|
|
84
84
|
requirements: []
|
|
85
|
-
rubygems_version:
|
|
85
|
+
rubygems_version: 4.0.3
|
|
86
86
|
specification_version: 4
|
|
87
87
|
summary: JSON Implementation for Ruby
|
|
88
88
|
test_files: []
|