parsanol 1.3.77-x86_64-linux → 1.3.78-x86_64-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: 447730cad3b1b3da67c3d22cc33010ad09dbc99930342892618c4fee56155416
4
- data.tar.gz: c971c795bddd44ed05f62546f41199afe8ad4949d60e9537bde89cf4f4d60e1d
3
+ metadata.gz: c5118c15fe8ff1e136b25f311295045b226103a4fb67a5915495b642a802779f
4
+ data.tar.gz: 935a7523d4f7768f34e99cdcb480ecd7a3955fa04f82ad72bdf08dda7ab2a771
5
5
  SHA512:
6
- metadata.gz: '094c4034f83a67d7711c1c239dd255fccdcbd4a3dfccd890b920ffb837874f98704ab75c99821a861c8a727585a82a4ee2ca93d6a68ddcff916558c98e6c1c45'
7
- data.tar.gz: e19696eefbdc18a34dee295a49d1a27408a8e7d805f0f40e1224740ee45e544dbafb24efa23aadc15f370b240f50a8d0eebd867e3201eafc2b546167f6124c75
6
+ metadata.gz: 16ef607cbf5f4b936043284262a38867216932406ba579eb5e6c7346c1893940619846987a4a6acbf87bb5c886f87c177aa6674e30d5397f81d1bf5a8e4286ed
7
+ data.tar.gz: c8ff1ed736acf5e359fd8316d29a7a998c539cdd4736689448e17bad480e28c422b7e099b90ead1644c4a8990b521e19bd0d8323a52e89a3435805c9fb79156b
@@ -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: 40658816 bytes
4
- sha256: 23b6dbd12738239daf1246021fea0c5959972fb8a944cd4b37c92488f6160090
3
+ size: 40666976 bytes
4
+ sha256: 213bb30b401b6e58fb6f7286ded0f92b73182eaa5e99344a7713ed0a7c288661
@@ -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: 40888784 bytes
4
- sha256: 1db5bdb547167de1ae1f2dd24aca9628b148e3c6b88d518f6ea631fdc4d718d6
3
+ size: 40896968 bytes
4
+ sha256: 35e2f9e59adde04248b1ddbb50096775f590839a1617acec64605dcd85c14716
@@ -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: 40887760 bytes
4
- sha256: fa3a2a5f35278ed80fb1a88a48a009d0f384dd81e396185f6002319a1f5845e7
3
+ size: 40895936 bytes
4
+ sha256: 833fa5c61ef0fa9d66e20cbc389315c7ecca873a3bebfc910b094330120321ce
@@ -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: 40897704 bytes
4
- sha256: 96d2e838ba0b28dc4a6c5d02b5a59cab02df8d961c50001c2665cca2aff69a2b
3
+ size: 40905856 bytes
4
+ sha256: 914514c6295293826cb45df921a3ae2fb5b104dc2200eeabba064a334cce7083
@@ -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
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: data/lib/parsanol/native/libparsanol.so
3
- size: 36552584 bytes
4
- sha256: b111ff29e918fc712ffb2a619d4c11aab3c86bc1576e9a0692810c999d878708
3
+ size: 36573688 bytes
4
+ sha256: 71b36349b2fd39cb3936ffa5c1044c33efd3d92f7f2c38851149d08b2b742799
@@ -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)
@@ -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.78"
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.78
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Ribose Inc.