123456789_123456789_123456789_123456789_123456789_

Class: Prism::LexCompat::Heredoc::PlainHeredoc

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/prism/lex_compat.rb

Overview

Heredocs that are no dash or tilde heredocs are just a list of tokens. We need to keep them around so that we can insert them in the correct order back into the token stream and set the state of the last token to the state that the heredoc was opened in.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newPlainHeredoc

[ GitHub ]

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

def initialize
  @tokens = []
end

Instance Attribute Details

#tokens (readonly)

[ GitHub ]

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

attr_reader :tokens

Instance Method Details

#<<(token)

[ GitHub ]

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

def <<(token)
  tokens << token
end

#to_a

[ GitHub ]

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

def to_a
  tokens
end