module YARP::LexCompat::Heredoc

A heredoc in this case is a list of tokens that belong to the body of the heredoc that should be appended onto the list of tokens when the heredoc closes.

Public Class Methods

build(opening) click to toggle source

Here we will split between the two types of heredocs and return the object that will store their tokens.

# File yarp/lex_compat.rb, line 540
def self.build(opening)
  case opening.value[2]
  when "~"
    DedentingHeredoc.new
  when "-"
    DashHeredoc.new(opening.value[3] != "'")
  else
    PlainHeredoc.new
  end
end