123456789_123456789_123456789_123456789_123456789_

Module: Prism::LexCompat::Heredoc

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Defined in: lib/prism/lex_compat.rb

Overview

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.

Class Method Summary

  • .build(opening)

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

Class Method Details

.build(opening)

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

[ GitHub ]

  
# File 'lib/prism/lex_compat.rb', line 583

def self.build(opening)
  case opening.value[2]
  when "~"
    DedentingHeredoc.new
  when "-"
    DashHeredoc.new(opening.value[3] != "'")
  else
    PlainHeredoc.new
  end
end