parsanol 1.3.23-aarch64-linux → 1.3.24-aarch64-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: fc75979b185527911cf91f017c326e76b6d046e4e8eae07d5d4a65a1d2c0d287
4
- data.tar.gz: ae34ac786d6537ca5fbd9ac621454a4ddb5b2c2078a24795938c532561696e16
3
+ metadata.gz: 2f038c51ed331779b63554ba4083a0f17da40793a9de920a3cd3863043663832
4
+ data.tar.gz: f7b5fead79649c315c1e17dba80fd66fa64082e3ad6fe79132fd39f0d0b4d191
5
5
  SHA512:
6
- metadata.gz: 7e19eb7305940707e73b01ba063e23e2aa8bdf488162a44d793915d63d2503846d036407ae0a8d367e8e5f60d5b4d8ddac133516ef6bffa80c1e56b6fcd34abc
7
- data.tar.gz: f53f311529672a40c34eafd4af9419293e4ba954f366055f8e82b7c55829077ee5b52c7f968ea7a2409b7869bff3305b6be622ac5c12281dbbf6caddc1b1ab0b
6
+ metadata.gz: 7cde1e50a8d1297a16b446080480d5c3a2d55e5c6822b0d35175125667e18d2c457a5a9002825447163a41297b2911730b17fbd3c056a5bacde48f3b3af92ac7
7
+ data.tar.gz: ceb21562438fd770b9bd11d343320f28f891838f3b6160bfb5245b1d30a57e748bcb81fc94530649739527252a475919517cc71ecfdf3a11c8779b43a6a75f58
Binary file
Binary file
Binary file
Binary file
@@ -246,6 +246,21 @@ module Parsanol
246
246
  raise_native_parse_error(e, grammar_json, input)
247
247
  end
248
248
 
249
+ # Prefix-mode parse (partial match allowed): the grammar registers
250
+ # by handle exactly like #parse; the Rust side returns
251
+ # [value, end_pos] with trailing input unconsumed.
252
+ def parse_prefix(grammar, input)
253
+ handle = Parser.grammar_handle(grammar)
254
+
255
+ begin
256
+ value, end_pos = _parse_handle_prefix(handle, input)
257
+ [value, end_pos]
258
+ rescue ArgumentError
259
+ Parser.invalidate_handle(handle)
260
+ _parse_handle_prefix(Parser.grammar_handle(grammar), input)
261
+ end
262
+ end
263
+
249
264
  # Grammar-atom path: registers once and parses by Rust-side handle,
250
265
  # so steady-state calls marshal no JSON and copy no input string.
251
266
  def parse_atom_grammar(grammar, input)
@@ -123,8 +123,7 @@ module Parsanol
123
123
  # forwarding options via super produces; :mode must be honored
124
124
  # wherever it appears, or those callers silently get the native path.
125
125
  mode = opts.delete(:mode) ||
126
- (if Parsanol::Native.available? && !opts.key?(:prefix) &&
127
- !opts.key?(:reporter)
126
+ (if Parsanol::Native.available? && !opts.key?(:reporter)
128
127
  :native
129
128
  else
130
129
  :ruby
@@ -219,6 +218,11 @@ module Parsanol
219
218
  #
220
219
  def parse_native(input, opts)
221
220
  if Parsanol::Native.available?
221
+ if opts.key?(:prefix) && opts[:prefix]
222
+ value, _end_pos = Parsanol::Native.parse_prefix(root, input)
223
+ return value
224
+ end
225
+
222
226
  Parsanol::Native.parse(root, input)
223
227
  else
224
228
  Parsanol::Atoms::Base.instance_method(:parse).bind_call(self, input,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.23"
4
+ VERSION = "1.3.24"
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.23
4
+ version: 1.3.24
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.