parsanol 1.3.99-arm-linux → 1.3.100-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: '0449928649d5a003cea029230dccdb8d4a1cf5e15a3115d713396f256e5a4cbf'
4
- data.tar.gz: 6f78bd36cb506e26a808d16d0e82cab33d1d4af239ff2850247b9ff29925e51a
3
+ metadata.gz: b89e681adaa5fac7a4145ea6001417cb764a1970f80723bffedafaf6332143b0
4
+ data.tar.gz: 9d651ebffc31cdeb3105ed71758ad2f25add9add525f46f5cc1fd74e92baddc3
5
5
  SHA512:
6
- metadata.gz: dc51f046f4d0e11b562f8dc35d37eed3476cb6d6bc77f0692d5363b87a8707444f04f4416a1dfef85db1a6e3dbb551f3477145831e2daa1cf21159646c086ef6
7
- data.tar.gz: 02bcffde2c4565099de61ffc31de674f24c244bbb1ac2bb5820ae5c4636d780f775ce092f57c64c2d8a47706a275899e7ea4358ffe26a93ee6b204a7b9609859
6
+ metadata.gz: cd4ab064d5b6a4d47cb1d70955b0351dd1c254adb4dca64bff7886b66687c02b78a4260248bca8a89c5271fb04b1b592ddc17a994824593de0c23807299747fd
7
+ data.tar.gz: f876a042b577c4fd3b7408fd62c86fc5b7d33541db18d91996d0d02c6197e1fa66d6561cd2c670a120d7a2b6816ad8d2a4ea5a28fb4fd15fc91e2b7f7e922670
@@ -236,9 +236,15 @@ module Parsanol
236
236
  end
237
237
 
238
238
  # Reports detailed error by reparsing with reporter.
239
+ #
240
+ # The default reporter is Deepest (parsanol-ruby#265): the native
241
+ # engine's failure diagnostics report the furthest failure, and a
242
+ # consumer's file:line:col degrades to "line 1 char 1" when the
243
+ # interpreter raises the outermost sequence instead. Explicit
244
+ # reporters (Tree for full cause trees) are honored unchanged.
239
245
  def report_detailed_error(input, consume_all, reporter, _initial_error)
240
246
  input.bytepos = 0
241
- error_reporter = reporter || Parsanol::ErrorReporter::Tree.new
247
+ error_reporter = reporter || Parsanol::ErrorReporter::Deepest.new
242
248
  success, cause = run_with_context(input, error_reporter, consume_all)
243
249
 
244
250
  # Second parse should also fail
@@ -98,12 +98,16 @@ module Parsanol
98
98
  # @return [Array<Integer, Parsanol::Cause>] [depth, deepest_leaf]
99
99
  #
100
100
  def find_deepest_leaf(node, rank = 0)
101
+ return [rank, node] if node.nil?
102
+
101
103
  best_node = node
102
104
  best_rank = rank
103
105
 
104
106
  kids = node.children
105
107
  if kids && !kids.empty?
106
108
  kids.each do |kid|
109
+ next if kid.nil?
110
+
107
111
  kid_rank, kid_node = find_deepest_leaf(kid, rank + 1)
108
112
 
109
113
  if kid_rank > best_rank
@@ -282,8 +282,10 @@ module Parsanol
282
282
  if parsanol_grammar
283
283
  # No native diagnostics (e.g. incomplete-input errors): one
284
284
  # interpreter pass with the reporter attached — a success
285
- # recovers the tree, a failure raises the cause tree.
286
- reporter = Parsanol::ErrorReporter::Tree.new
285
+ # recovers the tree, a failure raises the cause tree. Deepest
286
+ # keeps the fallback's diagnostics at parity with the direct
287
+ # interpreter path (parsanol-ruby#265).
288
+ reporter = Parsanol::ErrorReporter::Deepest.new
287
289
  source = Parsanol::Source.new(input)
288
290
  success, value = grammar.run_with_context(source, reporter, true)
289
291
  return grammar.finalize_result(value) if success
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.99"
4
+ VERSION = "1.3.100"
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.99
4
+ version: 1.3.100
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.