Class: RubyNext::Language::Rewriters::InPattern

Inherits:
PatternMatching show all
Defined in:
lib/ruby-next/language/rewriters/3.0/in_pattern.rb

Overview

Separate pattern matching rewriter for Ruby 2.7 to transpile only ‘in` patterns

Constant Summary collapse

NAME =
"pattern-matching-in"
SYNTAX_PROBE =
"1 in 2"
MIN_SUPPORTED_VERSION =
Gem::Version.new("3.0.0")

Constants inherited from PatternMatching

PatternMatching::ALTERNATION_MARKER, PatternMatching::CURRENT_HASH_KEY, PatternMatching::MATCHEE, PatternMatching::MATCHEE_ARR, PatternMatching::MATCHEE_HASH

Instance Attribute Summary

Attributes inherited from Base

#locals

Instance Method Summary collapse

Methods inherited from PatternMatching

#on_match_pattern, #on_match_pattern_p

Methods inherited from Base

ast?, #initialize, #s

Methods inherited from Abstract

ast?, #initialize, text?, unsupported_syntax?, unsupported_version?

Constructor Details

This class inherits a constructor from RubyNext::Language::Rewriters::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubyNext::Language::Rewriters::PatternMatching

Instance Method Details

#on_case_match(node) ⇒ Object

Make case-match no-op



16
17
18
# File 'lib/ruby-next/language/rewriters/3.0/in_pattern.rb', line 16

def on_case_match(node)
  process_regular_node(node)
end