parsanol 1.3.38 → 1.3.39

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: 8160526df9d517b13742be64b4507b1d5ce7b036045ac28427bea31b0c1b95ab
4
- data.tar.gz: dc5287c93e31034c8421274be3c383db30d0d81a896f948e30edc96fb5d7be3e
3
+ metadata.gz: 997c16ae8f260553f62f89bd59cef5c5d483d363dde5c9aac3ae50f2adbc87dd
4
+ data.tar.gz: d11df010ac9badeeb387b2edbe34fde243a1d9198ede4d65ce328f93e644403e
5
5
  SHA512:
6
- metadata.gz: 382334b59ceb6e08c8615cbd36895d8c9c3bf5f2f7f94767b0ff3d552734d1659d85ce7e3840aac23cd756504708857cc2ca82cab15cceb855ee88954021420f
7
- data.tar.gz: 68ca0460ab220b9ded30c07d1d08a2e2f368b2173d655deaef82e13ffd91564c6a0f37bb92b3c4c145fd506dfb5f3a61dbfcf2fa4fbfcf0eea45d83fd6cb0c06
6
+ metadata.gz: 9a37985079b655cc7b42259d73d831869d79cbe9c326569c19b88c5f37cfd1537f0d133cd2dec172e8b3b962bf55d98cb6dcb2b71a7c8dd8b6c29d1f147feee9
7
+ data.tar.gz: 8a46c0695fedc5dc07318b3cd01e68a1ebb2c9b2a350ef5646430cd0cfa08a3e1123b56b56c706f5dc31385712b315b3d8c1ad70fb6adfa036ef8b7d0c555cc5
@@ -127,14 +127,18 @@ module Parsanol
127
127
  # @param block [Proc] transformation block
128
128
  # @return [Object] block result
129
129
  #
130
+ # Public seam for rule execution: called for every matched rule
131
+ # with the captured bindings. Subclasses override this to
132
+ # post-process each rule result (e.g. source-line injection);
133
+ # the pipeline always routes through it (GH-74).
134
+ #
135
+ # @param bindings [Hash] matched pattern bindings
136
+ # @param block [Proc] the transformation block
137
+ # @return [Object] block result
130
138
  def call_on_match(bindings, block)
131
139
  return nil unless block
132
140
 
133
- if block.arity == 1
134
- block.call(bindings)
135
- else
136
- Context.new(bindings).instance_eval(&block)
137
- end
141
+ execute_block(block, bindings)
138
142
  end
139
143
 
140
144
  private
@@ -181,7 +185,7 @@ module Parsanol
181
185
  bindings = pattern.match(node, ctx)
182
186
  next unless bindings
183
187
 
184
- return execute_block(block, bindings)
188
+ return call_on_match(bindings, block)
185
189
  end
186
190
 
187
191
  # No rule matched
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parsanol
4
- VERSION = "1.3.38"
4
+ VERSION = "1.3.39"
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.38
4
+ version: 1.3.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.