class SyntaxTree::EndContent
some other content that is not executed by the program
__END__
puts DATA.read
the DATA constant.
scripts to keep content after the main ruby code that can be read through
EndContent represents the use of __END__ syntax, which allows individual
def ===(other)
def ===(other) other.is_a?(EndContent) && value === other.value end
def accept(visitor)
def accept(visitor) visitor.visit___end__(self) end
def child_nodes
def child_nodes [] end
def copy(value: nil, location: nil)
def copy(value: nil, location: nil) node = EndContent.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end
def format(q)
def format(q) q.text("__END__") q.breakable_force first = true value.each_line(chomp: true) do |line| if first first = false else q.breakable_return end q.text(line) end q.breakable_return if value.end_with?("\n") end
def initialize(value:, location:)
def initialize(value:, location:) @value = value @location = location @comments = [] end