parsanol 1.3.77-arm-linux → 1.3.79-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: 429a4964c85119a64fcbe26e965c0dbb72832243656dcf7adac52af44467123a
4
- data.tar.gz: e2d9c235c40b39db79f63b3d4f7197bff1dcf396e9c40f304bea267f1ba55b0d
3
+ metadata.gz: 3b400959abdd0fff2f2a6841f35db7ead79f1853c565f7d8def56191c0864697
4
+ data.tar.gz: 469053fa95da3561c14e8cfb278ff134461edf599efd837d628aee316281ea4a
5
5
  SHA512:
6
- metadata.gz: 855ae1e5ecf70b2e91c77891cf11716c29c9b5ca72ba9493fa59a817e201859a83558b3a6a4bf7813d312456fc489ca15dd59c0995e16635e37bcdaa0e3c26e3
7
- data.tar.gz: 7b16e9e544408a33a7d7e404b15e2e22b28bfce59b3bd2960f9d6483c42220e25f5f7eb9f2cf72e09a38ebaf289ffa42e654c5aa66104e4ec422c10396f9f064
6
+ metadata.gz: f48f171c91d3b4f12d5f508d9e02dedef27066620052770ab82b023ba9ee43317e8f0c6aa36c516cc8e0238f28c5e32e1c68a95d56560a03cd3c126ff4d1fab2
7
+ data.tar.gz: e59521ee0b495463a04728d26271193fb9a11ca769d794ad380256016786afcfefcebe878277222881fd8a6b676583c2116dde29f3e8e4b10ab09270d395387b
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: data/lib/parsanol/3.2/parsanol_native.so
3
- size: 33849188 bytes
4
- sha256: ca4c41aa664d038aef54496b5ef3d0e1607614ed2a0fb6dee25d8b70d3d2623c
3
+ size: 33857428 bytes
4
+ sha256: 555fffa50043f91efe6d1003cf97ba60224c83b0118205bff2033615de4bf54d
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: data/lib/parsanol/3.3/parsanol_native.so
3
- size: 34034452 bytes
4
- sha256: d3660cf198539d8155431a55aa11a704a21221300a20efe1fec7d80aa7886bc8
3
+ size: 34042676 bytes
4
+ sha256: 63a27cccdad9628f8dba74a5efdf1d6993ad7b5ad69a434746608ca1df28dd9c
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: data/lib/parsanol/3.4/parsanol_native.so
3
- size: 34027504 bytes
4
- sha256: 33690f49159bf260583a614afe9d117c646c9fd4bca01f1771ffda635be5dfb5
3
+ size: 34036828 bytes
4
+ sha256: a7917405bf0af8cbff7095c8391970d47165543ec62fcc25518a3bd017e03397
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: data/lib/parsanol/4.0/parsanol_native.so
3
- size: 34037320 bytes
4
- sha256: 026dbe46af30ab84933b280727354c32308c8cdcdb2c77d2fc8501092b0f4c57
3
+ size: 34046564 bytes
4
+ sha256: 3eb609a621681ded3508cdbb5fe6fb0ebea27419febfb58243b56625d041db51
@@ -132,6 +132,12 @@ module Parsanol
132
132
  #
133
133
  def invoke_from_rust(callback_id, context)
134
134
  block = @mutex.synchronize { @callbacks[callback_id]&.dig(:block) }
135
+ if ENV["PARSANOL_INVOKE_TRACE"]
136
+ cont = context[:captures][:cont]
137
+ warn "INVOKE id=#{callback_id} pos=#{context[:pos]} " \
138
+ "block=#{context[:captures][:block].inspect} " \
139
+ "cont=#{cont.class}@#{cont.object_id}"
140
+ end
135
141
  return nil unless block
136
142
 
137
143
  # Build DynamicContext from hash
@@ -142,18 +148,33 @@ module Parsanol
142
148
  )
143
149
 
144
150
  # Call the block. Parslet-canonical blocks take two arguments
145
- # (source, context): pass the restricted context for both so
146
- # either convention works (GH-76). Captures are read-only
147
- # snapshots of the engine state; write-dependent dispatch must
148
- # run on mode: :ruby.
151
+ # (source, context). The source is a REAL Parsanol::Source
152
+ # positioned at the dispatch point: blocks that read source
153
+ # state (bytepos, line_and_column — the lazy-continuation
154
+ # guards do) previously got the context wrapper for both
155
+ # args and raised NoMethodError, which the bridge turned
156
+ # into a silent dispatch failure (rs#165). Consumption
157
+ # side-effects stay local to the call: the resolved fragment
158
+ # is the parse.
149
159
  result = if block.arity == 2
150
- block.call(ctx, ctx)
160
+ dispatch_source = Parsanol::Source.new(context[:input])
161
+ dispatch_source.bytepos = context[:pos]
162
+ block.call(dispatch_source, ctx)
151
163
  else
152
164
  block.call(ctx)
153
165
  end
154
166
 
155
167
  return nil unless result
156
168
 
169
+ if ENV["PARSANOL_FRAG_TRACE"]
170
+ begin
171
+ json = result.to_atom_json
172
+ warn "FRAG id=#{callback_id} json=#{json[0, 120]}"
173
+ rescue StandardError => e
174
+ warn "FRAG id=#{callback_id} RAISE #{e.class}: #{e.message[0, 140]}"
175
+ end
176
+ end
177
+
157
178
  # Capture-write contract (GH-80): return the atom and the
158
179
  # post-call captures hash; the Rust bridge diffs it against
159
180
  # the seeded values and propagates the block's writes
Binary file
@@ -121,6 +121,13 @@ module Parsanol
121
121
  }
122
122
  end
123
123
 
124
+ # Public (rs#166): the VM program cache shares compiled
125
+ # programs across fresh parser instances keyed on this —
126
+ # the same disambiguator the grammar cache uses.
127
+ def public_structure_hash(atom)
128
+ grammar_structure_hash(atom)
129
+ end
130
+
124
131
  private
125
132
 
126
133
  def grammar_cache_key(root_atom)
@@ -74,7 +74,15 @@ module Parsanol
74
74
  # grammar JSON and re-registered it per parse (~8x).
75
75
  # Dynamic artifacts carry ruby-tier atoms their wire
76
76
  # cannot express — they keep the interpreter.
77
- return root_atom(entry_name).parse(input, mode: :native)
77
+ begin
78
+ return root_atom(entry_name).parse(input, mode: :native)
79
+ rescue Parsanol::ParseFailed
80
+ # The atom-tree native path reports the root position; the
81
+ # wire-registration path carries the deepest-failure
82
+ # diagnostics (parsanol-ruby#171). Failures pay the
83
+ # serialization once; successes keep the fast lane.
84
+ return Native.parse(JSON.generate(entry(entry_name).fetch("grammar")), input)
85
+ end
78
86
  end
79
87
 
80
88
  root_atom(entry_name).parse(input)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.77"
4
+ VERSION = "1.3.79"
5
5
  end
data/lib/parsanol/vm.rb CHANGED
@@ -202,6 +202,10 @@ module Parsanol
202
202
  # starts memoized on its very first parse (fresh parser instances
203
203
  # included — the seed is recomputed at every compile), so the
204
204
  # cold-start never pays the doomed unmemoized exploration.
205
+ # rs#166: proneness rides the structure-hash share as a bool —
206
+ # a later identical-structure grammar inherits the seed instead
207
+ # of running its cold start unmemoized because compilation was
208
+ # skipped entirely.
205
209
  if compiler.backtracking_prone
206
210
  (@heavy ||= {}.compare_by_identity)[root] = true
207
211
  trim_cache(@heavy)
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.77
4
+ version: 1.3.79
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.