parsanol 1.3.63 → 1.3.64

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: f7ad59a2f852639eec49d8aaf0cfce4be63d8e13a20941b7db8f325244445e47
4
- data.tar.gz: b4f7021d4c4dd9f30df4eddf64b2109da9005291b4d39edadd5075e54c6600c0
3
+ metadata.gz: 3d3b9a74be500e1e1874c246d72614966e39ee7766731726a23d77e7b88b8f33
4
+ data.tar.gz: 79d0492db122146e4bfca2ce17de4017b02d94385f8b9f6db540e7ea69ee6d02
5
5
  SHA512:
6
- metadata.gz: d5fe08eb23fa452e06432cb8b72cb101b257b854fb33ae71455fd8c2a0d81356704f66fd11af330392783aa6c6a5b4730df1884718459c5d4acfe3abc74b8b48
7
- data.tar.gz: b2d8251fc66c8d47085bf6338457975b6f29e707a173c8e107d5755137bd850ead86c6d130b6410b29e4155e87ae4c67cac3739278f0ddd4a7826fc94ffba53e
6
+ metadata.gz: e7cf8b9f912837052ab62bcf35332de5b4715f0a9f43e8b9ffc8e5cb3cf5ce16a0d830c0841ad326855cad5eb8c8de8e3e9e28cdbf264f441fd40db71f78bef5
7
+ data.tar.gz: 00755e792eb152ced1b9d3e38f783d1f9637cc13add763b609e8e4edaaff1dd4dafa426bf162e11e956bad14d86ad75b6eb07bd42d0015f32f48e043e72e594c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.63"
4
+ VERSION = "1.3.64"
5
5
  end
data/lib/parsanol/vm.rb CHANGED
@@ -536,11 +536,19 @@ module Parsanol
536
536
  if tables.all? && pairwise_disjoint?(tables)
537
537
  dispatch_idx = emit(BYTE_DISPATCH, nil, nil, nil)
538
538
  starts = []
539
+ # A dispatched branch that matched must not fall through into
540
+ # the next branch's code: the tables are lead-byte disjoint,
541
+ # but the remaining input can still satisfy a later branch's
542
+ # terminals (pubid: " - " — the '-' branch ran the ' ' branch's
543
+ # STR on the byte after the dash). Jump every branch but the
544
+ # last past the dispatch.
545
+ jumps = []
539
546
  idx = 0
540
547
  while idx < count
541
548
  starts << flat(@ops.size)
542
549
  return nil unless compile_atom(alts[idx], consume_all)
543
550
 
551
+ jumps << emit(JMP, nil, nil, nil) unless idx == count - 1
544
552
  idx += 1
545
553
  end
546
554
  table = Array.new(256, -1)
@@ -555,6 +563,7 @@ module Parsanol
555
563
  bi2
556
564
  end
557
565
  patch(dispatch_idx, 1, table)
566
+ jumps.each { |j| patch(j, 1, flat(@ops.size)) }
558
567
  return self
559
568
  end
560
569
 
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.63
4
+ version: 1.3.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.