parsanol 1.3.128-arm-linux → 1.3.129-arm-linux

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: 19a0e3a8445f5771ca1a372cfc8ae0b27893883862171a2a691e07f4fa2af094
4
- data.tar.gz: c0d334c8671764d372da56c5ce24200b3c84f301e8fb8847dc71cb50f07b1b35
3
+ metadata.gz: cc5b22c92ad2b6c2155b050c0a904e293758b6ba6a50a4be0ca5f3676f957a2a
4
+ data.tar.gz: f600012d26f0a706a1818980a3f98148c05c8b918ab9457e205cda11abbd39ce
5
5
  SHA512:
6
- metadata.gz: ce55d83f0ebc1f0459f985d41382c2764980f4558ebcd600b35eb1afa370cdcb97ffb5136fef383cebfb9dfca468ba4fa27ece36dcad7af33654b5db3f291c38
7
- data.tar.gz: e85ad04b0c81ea1ba1fdbbd1a1652e24e1a2b5ab55fe71d07069ba48a9483f451cf2de995645dcbc6befbd1813cac96c4bf1b24261ed9fe0ceffd5518b885aba
6
+ metadata.gz: 65cd647e2615a8c71cf6cdad62af2cf68180057a48376ec922210823177bec264f354f8a2e71f3bbb850fc9be72819b0c509f9e86d0463f15dd7e3a880adca0d
7
+ data.tar.gz: 1f7a4dd5fec3525487cc74396da93cd146c32a8ab3cc5878fe4ce6a155bead0722489397adff87e4c3dd2747460e2ac99717bb788ce67a33c4e8c17e71905452
@@ -36,11 +36,14 @@ module Parsanol
36
36
  # bound map (parsanol-ruby#413): a capture present in the parse
37
37
  # but bound nowhere is silent data loss, the one case the
38
38
  # binding layer's other checks miss. Absence in the TREE is
39
- # legitimate optionality and never raises. Coverage is checked
40
- # against every hash key anywhere in the bound map, not just the
41
- # binding's own leaf: a `(raw)` binding carries its entire
39
+ # legitimate optionality and never raises. Delivery is EITHER
40
+ # the binding's own leaf/prefix reaching the map (the capture
41
+ # may rename on the way — capture "doc_year" binds under path
42
+ # "year", parsanol-ruby#434) OR the capture name appearing as a
43
+ # key anywhere in the map: a `(raw)` binding carries its entire
42
44
  # subtree, so captures nested inside a raw-bound ancestor are
43
- # delivered through it (parsanol-ruby#427 — BS 9113 bundled_list).
45
+ # delivered through it (parsanol-ruby#427 — BS 9113
46
+ # bundled_list).
44
47
  bound_keys = {}
45
48
  walk_keys = lambda do |node|
46
49
  case node
@@ -53,7 +56,7 @@ module Parsanol
53
56
  walk_keys.call(out)
54
57
  lost = bindings.select do |binding|
55
58
  capture = binding["capture"].to_sym
56
- present.include?(capture) && !bound_keys.key?(capture)
59
+ present.include?(capture) && !bound?(out, binding) && !bound_keys.key?(capture)
57
60
  end
58
61
  unless lost.empty?
59
62
  raise BindError,
@@ -63,6 +66,23 @@ module Parsanol
63
66
  out
64
67
  end
65
68
 
69
+ # Did this binding contribute anything to the bound map? Scalars
70
+ # bind under their leaf key; array groups bind under their prefix.
71
+ # The leaf is the PATH's tail, so a capture-to-path rename reads
72
+ # as delivered when its own path landed (parsanol-ruby#434).
73
+ def bound?(out, binding)
74
+ path = binding["path"].to_s
75
+ if path.include?("[]")
76
+ prefix = path.split("[]").first.to_sym
77
+ rows = out[prefix]
78
+ rows.is_a?(Array) && rows.any? do |row|
79
+ row.is_a?(Hash) && row.key?(leaf_key(binding))
80
+ end
81
+ else
82
+ out.key?(leaf_key(binding))
83
+ end
84
+ end
85
+
66
86
  # Canonical test-value form: one equality surface for capture and
67
87
  # example expectations on both sides of the comparison (Slice vs
68
88
  # source literal was comparing heterogeneous types). Terminals
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.128"
4
+ VERSION = "1.3.129"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsanol
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.128
4
+ version: 1.3.129
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.