remap 2.2.37 → 2.2.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remap/compiler.rb +2 -2
- data/lib/remap/notice/error.rb +6 -1
- data/lib/remap/rule/block.rb +7 -3
- data/lib/remap/state/extension.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: 8fdfe8ed64a781f1239e1738a2e71b99acc864e60508353fc7d22c848b128cbb
|
4
|
+
data.tar.gz: 654613c35e8d8294a94f748ca170da5bd19199dc66ba33c8ec055333e1deaf98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56c3113747f8efc8721bf3d2731c0292c4c54e6570969b72f774433be0f7c64874af9fbb448bfe146978cc39d31725cde491e3a682d684e5e28909fa7a3e3ca
|
7
|
+
data.tar.gz: b753d26605bdca1201be84826f4c352b426c4b853c687cc997ba964786827305268c805d6c6e85ee15e284becee4a8deaec9998dda35ff1e3431f919abe903e9
|
data/lib/remap/compiler.rb
CHANGED
@@ -308,12 +308,12 @@ module Remap
|
|
308
308
|
#
|
309
309
|
# @return [Rule::Each]]
|
310
310
|
# @raise [ArgumentError] if no block given
|
311
|
-
def each(&block)
|
311
|
+
def each(backtrace: caller, &block)
|
312
312
|
unless block_given?
|
313
313
|
raise ArgumentError, "#each requires a block"
|
314
314
|
end
|
315
315
|
|
316
|
-
add rule(all, &block)
|
316
|
+
add rule(all, backtrace: backtrace, &block)
|
317
317
|
end
|
318
318
|
|
319
319
|
# Wraps output in type
|
data/lib/remap/notice/error.rb
CHANGED
data/lib/remap/rule/block.rb
CHANGED
@@ -23,11 +23,15 @@ module Remap
|
|
23
23
|
return state.except(:value)
|
24
24
|
end
|
25
25
|
|
26
|
-
rules.
|
27
|
-
rule.call(state) do |failure|
|
26
|
+
rules.reduce(state.except(:value)) do |s1, rule|
|
27
|
+
result = rule.call(state) do |failure|
|
28
28
|
return error[failure]
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
s1.combine(result)
|
32
|
+
rescue Notice::Fatal => e
|
33
|
+
raise e.traced(rule.backtrace)
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|