parsanol 1.3.124-arm-linux → 1.3.126-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: 21ca385359c1b4ae077a428395141e481cd3b3c043ba31219e4c62f922aa0a34
4
- data.tar.gz: 6c98020dba568700d3edbd031e49236d45762f96b1fff3f285b89bfcbed9b55c
3
+ metadata.gz: b875944f9e4504b567fcf811a42831cf31c1804945a681c9ce87342e468f7fc7
4
+ data.tar.gz: 2f1708d2394539c82e9d9d2b5a3c0a56135112165583361480370fa58d43c0c2
5
5
  SHA512:
6
- metadata.gz: 0dc25924bbf9cc5f9c04ee887722b99af2b0b70eca0e52bbc9436f885d134168211c6dc5670f246e28584d53433da0b14a6e77604bdc216a6cbd14bc41d18164
7
- data.tar.gz: 8a3d9a0ca46171b618424baf1147f4263252f9060cdbf21cad65a97cc3c88a6864a0127505b94a727509157006c06eaa48bfd7df9443c498558b1adb0f313fd4
6
+ metadata.gz: 157335ceb6abe3e2c568c4ce7d76f12f591a68459f5fb9d75c99de6a37dd4caa5d95ae83d48d10748328c2a3d3e9ab26a91253e6711f8fea6c6d07ee3df5212b
7
+ data.tar.gz: 8fd8137a8797d4d3c13359a517ae7d34797dfd4561052f292946bd499c274a93c4350231adb5954a3089b8fb700b126cb5533068562d5521c00e4891c1ed0671
@@ -632,8 +632,8 @@ module Parsanol
632
632
  markers[literal] = node.a.to_sym if literal && !literal.strip.empty?
633
633
  collect.call(@document.rules[node.a]) if @document.rules.key?(node.a)
634
634
  when :alt, :seq then node.a.each { |b| collect.call(b) }
635
- when :rep, :opt, :cap then collect.call(node.a)
636
- when :pred then collect.call(node.b)
635
+ when :rep, :opt then collect.call(node.a)
636
+ when :cap, :pred then collect.call(node.b)
637
637
  end
638
638
  end
639
639
  collect.call(@document.skip_declaration)
@@ -652,7 +652,11 @@ module Parsanol
652
652
  case n.kind
653
653
  when :lit then literal = n.a
654
654
  when :seq, :alt then n.a.each { |c| walk.call(c) unless literal }
655
- when :rep, :opt, :cap, :pred then walk.call(n.a || n.b) unless literal
655
+ # :cap stores the capture NAME in `a` (a plain String) and the
656
+ # captured node in `b`; :pred stores its flag in `a`. Walking
657
+ # `a` on either crashes — descend through `b`.
658
+ when :rep, :opt then walk.call(n.a) unless literal
659
+ when :cap, :pred then walk.call(n.b) unless literal
656
660
  end
657
661
  end
658
662
  walk.call(node)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.124"
4
+ VERSION = "1.3.126"
5
5
  end
data/lib/parsanol/vm.rb CHANGED
@@ -990,8 +990,12 @@ module Parsanol
990
990
  @memoize = memoize
991
991
  end
992
992
 
993
- # The RE match's [char width, byte advance]: single-class
994
- # patterns match one character; multi-character patterns (%i
993
+ # The RE match's [span length, byte advance], both in BYTES: the
994
+ # interpreter's packed value spans are byte-based (STR packs the
995
+ # literal's byte length; ANY and the RUN ops pack the char's
996
+ # UTF-8 byte width; materialize byteslices the span), so the RE
997
+ # span must count bytes too. Single-class patterns match one
998
+ # character (its byte width); multi-character patterns (%i
995
999
  # literals reach RE with no byte table) consume their full
996
1000
  # length (ruby#357: advancing one character skipped the
997
1001
  # pattern's remainder and let the parse re-match inside it).
@@ -1002,12 +1006,17 @@ module Parsanol
1002
1006
  [w, w]
1003
1007
  else
1004
1008
  len = scanner.skip(pattern)
1005
- [input.byteslice(pos, len).length, len]
1009
+ [len, len]
1006
1010
  end
1007
1011
  end
1008
1012
 
1009
- # An RE instruction's match at pos: [matched?, char width, byte
1010
- # advance]. Single-class patterns match one character;
1013
+ # An RE instruction's match at pos: [matched?, span length, byte
1014
+ # advance], both lengths in BYTES (see #re_match_width: the
1015
+ # interpreter's spans are byte-based; a character count here
1016
+ # truncated every slice containing a multibyte character —
1017
+ # ruby#407: "Class[éin]" lost é's second continuation byte
1018
+ # because the span stored the run's char count and materialize
1019
+ # bytesliced it). Single-class patterns match one character;
1011
1020
  # multi-character patterns (%i literals reach RE with no byte
1012
1021
  # table) consume their FULL length (ruby#357: advancing one
1013
1022
  # character skipped the pattern's remainder and let the parse
@@ -1030,7 +1039,7 @@ module Parsanol
1030
1039
  [true, w, w]
1031
1040
  else
1032
1041
  len = scanner.skip(pattern)
1033
- [true, input.byteslice(pos, len).length, len]
1042
+ [true, len, len]
1034
1043
  end
1035
1044
  end
1036
1045
 
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.124
4
+ version: 1.3.126
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.