canon 0.3.24 → 0.3.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1d317692d756e058f2a4fb6865fffa4240744ac1b7cf8c83cb026552acb3f16
4
- data.tar.gz: b993bde4273af1fdfe30d05b43bc0e642b9c3b80d857dc437196d2e7ea20567f
3
+ metadata.gz: 542f29d833d2a2b08ebf8121b9bf847e4d30bfb2f86127742aad93ef648b8ab0
4
+ data.tar.gz: 3d16c5ef20e3b540969c21d185d345a6b4fc6e6c0c548811d9af87d6d1105490
5
5
  SHA512:
6
- metadata.gz: 6ee303aab423e1bfb48b754b441c8e70b307af2a03956bd1cb7c5998dcb575cfc57c9c6ba1d02a22af74717cfbd8aaa1f05b88a52cc698da6e8547e3a0a25ce8
7
- data.tar.gz: a2de4ba755d59ecd72bfe50e53f6fea6c1136cbc98fda6886c22f5240098a84235d304040dcefb8e1d882a9bab27228f86030bf784b297cbb29df1c745a622af
6
+ metadata.gz: 83d9046ae33bf10605fd636fa9606aaeb481633c12a374046451cd44988f24c9e022257a85441e4d10babc3a0d01957597313cf02fc6373bee43566ed4af76d9
7
+ data.tar.gz: d286b0b4358c9ef2a86930ae43fb356cb98a0f475affb6f76cae2140f36145fd440851b481d859af2a7a7ba996033d0719547102d09160a596af610d800301c9
@@ -4,9 +4,10 @@ require "json"
4
4
 
5
5
  module Canon
6
6
  # The only place canon talks to a JSON engine. The yeptris fast path
7
- # (fused C-API materializer, on par with the stdlib C extension)
8
- # engages through Yeptris::YAML.load's JSON auto-detection; without
9
- # the native materializer the stdlib parser serves, unchanged.
7
+ # (fused C-API materializer) engages through Yeptris::JSON.load
8
+ # the strict JSON surface pinned to exact JSON.parse semantics
9
+ # upstream; without the native materializer the stdlib parser
10
+ # serves, unchanged.
10
11
  # Errors normalize to JSON::ParserError so canon's rescues hold on
11
12
  # both engines.
12
13
  module JsonParsing
@@ -15,8 +16,12 @@ module Canon
15
16
  def parse(json)
16
17
  if Canon::YamlBackend.yeptris_native?
17
18
  begin
18
- ::Yeptris::YAML.load(json)
19
- rescue ::Yeptris::ParseError, ::FFI::NullPointerError => e
19
+ # The strict JSON surface — spec-pinned to exact JSON.parse
20
+ # semantics upstream, deliberately separate from the YAML
21
+ # (Psych-contract) surface, which applies the YAML 1.1 quirk
22
+ # table to JSON-shaped input.
23
+ ::Yeptris::JSON.load(json)
24
+ rescue ::Yeptris::JSON::ParseError, ::Yeptris::ParseError => e
20
25
  raise JSON::ParserError, e.message
21
26
  end
22
27
  else
data/lib/canon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canon
4
- VERSION = "0.3.24"
4
+ VERSION = "0.3.25"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.24
4
+ version: 0.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.