Class: MiniRuby::AST::Node

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/miniruby/ast.rb

Overview

Abstract class representing an AST node.

Direct Known Subclasses

ExpressionNode, ProgramNode, StatementNode

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(span: Span::ZERO) ⇒ Node

: (?span: Span) -> void



23
24
25
# File 'lib/miniruby/ast.rb', line 23

def initialize(span: Span::ZERO)
  @span = span
end

Instance Attribute Details

#spanObject

: Span



20
21
22
# File 'lib/miniruby/ast.rb', line 20

def span
  @span
end

Instance Method Details

#==(other) ⇒ Object

: (Object other) -> bool



28
29
30
# File 'lib/miniruby/ast.rb', line 28

def ==(other)
  other.is_a?(self.class)
end

#inspect(indent = 0) ⇒ Object



38
# File 'lib/miniruby/ast.rb', line 38

def inspect(indent = 0); end

#to_s(indent = 0) ⇒ Object



34
# File 'lib/miniruby/ast.rb', line 34

def to_s(indent = 0); end