parsanol 1.3.39 → 1.3.40

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: 997c16ae8f260553f62f89bd59cef5c5d483d363dde5c9aac3ae50f2adbc87dd
4
- data.tar.gz: d11df010ac9badeeb387b2edbe34fde243a1d9198ede4d65ce328f93e644403e
3
+ metadata.gz: 6a53de5b8fbfa3ad854ff50c293afcd253c02921aa86fffb59b8077e74e3a84d
4
+ data.tar.gz: 110f778c6186d0a9695d2251457068a392cfe69306eeb6dda3ef1fbd5dc9ee42
5
5
  SHA512:
6
- metadata.gz: 9a37985079b655cc7b42259d73d831869d79cbe9c326569c19b88c5f37cfd1537f0d133cd2dec172e8b3b962bf55d98cb6dcb2b71a7c8dd8b6c29d1f147feee9
7
- data.tar.gz: 8a46c0695fedc5dc07318b3cd01e68a1ebb2c9b2a350ef5646430cd0cfa08a3e1123b56b56c706f5dc31385712b315b3d8c1ad70fb6adfa036ef8b7d0c555cc5
6
+ metadata.gz: b3ca94716aa64aed4ec2cc7e8012611ce15d942a9025f5afe2464fda8fdb9f51fe5953d10a77a62d57b9a97bef01f51d69c038e302ccfaf6a46df30fae642335
7
+ data.tar.gz: 1bb9a882a0f60d2ac729cc7bb30cd7e06141c1074be3c85e8dabb0a23a75fe8c97ee2982d84ac18f8972e1127a8d1252b6e54dac668fa1965381fcebdbe53377
@@ -141,16 +141,21 @@ module Parsanol
141
141
  context[:captures].transform_keys(&:to_sym),
142
142
  )
143
143
 
144
- # Call the block
145
- result = block.call(ctx)
144
+ # 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.
149
+ result = if block.arity == 2
150
+ block.call(ctx, ctx)
151
+ else
152
+ block.call(ctx)
153
+ end
146
154
 
147
155
  return nil unless result
148
156
 
149
157
  # Return the result (should be a parslet/atom)
150
158
  result
151
- rescue StandardError => e
152
- warn "[Parsanol::Native::Dynamic] Invoke error: #{e.message}"
153
- nil
154
159
  end
155
160
  end
156
161
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.39"
4
+ VERSION = "1.3.40"
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.39
4
+ version: 1.3.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.