Skip to content

Commit

Permalink
Merge pull request #130 from eregon/fix-ruby2_keywords-usage
Browse files Browse the repository at this point in the history
Fix usage of ruby2_keywords, only use it for blocks which delegate
  • Loading branch information
jkowens committed Jul 19, 2022
2 parents 21a0b3e + 7fa9a00 commit 37135cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mustermann/lib/mustermann/ast/expander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ module AST
class Expander < Translator
raises ExpandError

translate Array do |*args|
translate(Array, &-> (*args) do
inject(t.pattern) do |pattern, element|
t.add_to(pattern, t(element, *args))
end
end
end.ruby2_keywords)

translate :capture do |**options|
t.for_capture(node, **options)
Expand Down
1 change: 0 additions & 1 deletion mustermann/lib/mustermann/ast/translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def self.translate(*types, &block)
Class.new(const_get(:NodeTranslator)) do
register(*types)
define_method(:translate, &block)
ruby2_keywords :translate
end
end

Expand Down

0 comments on commit 37135cc

Please sign in to comment.