Class: RubyNext::Language::Rewriters::Base
- Inherits:
-
Abstract
- Object
- Parser::TreeRewriter
- Abstract
- RubyNext::Language::Rewriters::Base
- Defined in:
- lib/ruby-next/language/rewriters/base.rb
Direct Known Subclasses
AnonymousBlock, AnonymousRestArgs, ArgsForward, Dir, EndlessMethod, EndlessRange, ItParam, NumberedParams, NumericLiterals, OnelinePatternParensless, PatternMatching, RefinementImportMethods, RequiredKwargs, RescueWithinBlock, SafeNavigation, ShorthandHash, SquigglyHeredoc
Defined Under Namespace
Classes: LocalsTracker
Constant Summary
Constants inherited from Abstract
Abstract::MIN_SUPPORTED_VERSION, Abstract::NAME, Abstract::SYNTAX_PROBE
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
A new instance of Base.
- #s(type, *children) ⇒ Object
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
#locals ⇒ Object (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
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 |