Class: RubyNext::Language::Rewriters::Base

Inherits:
Abstract
  • Object
show all
Defined in:
lib/ruby-next/language/rewriters/base.rb

Defined Under Namespace

Classes: LocalsTracker

Constant Summary

Constants inherited from Abstract

Abstract::MIN_SUPPORTED_VERSION, Abstract::NAME, Abstract::SYNTAX_PROBE

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract

text?, transform, unsupported_syntax?, unsupported_version?

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



74
75
76
77
# File 'lib/ruby-next/language/rewriters/base.rb', line 74

def initialize(*args)
  @locals = LocalsTracker.new
  super
end

Instance Attribute Details

#localsObject (readonly)

Returns the value of attribute locals.



68
69
70
# File 'lib/ruby-next/language/rewriters/base.rb', line 68

def locals
  @locals
end

Class Method Details

.ast?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/ruby-next/language/rewriters/base.rb', line 70

def self.ast?
  true
end

Instance Method Details

#s(type, *children) ⇒ Object



79
80
81
# File 'lib/ruby-next/language/rewriters/base.rb', line 79

def s(type, *children)
  ::Parser::AST::Node.new(type, children)
end