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 +4 -4
- data/lib/parsanol/native/dynamic.rb +10 -5
- data/lib/parsanol/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a53de5b8fbfa3ad854ff50c293afcd253c02921aa86fffb59b8077e74e3a84d
|
|
4
|
+
data.tar.gz: 110f778c6186d0a9695d2251457068a392cfe69306eeb6dda3ef1fbd5dc9ee42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/lib/parsanol/version.rb
CHANGED