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

: () -> void

[ GitHub ]

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

def initialize
  @tokens = []
end

Instance Attribute Details

#tokens (readonly)

[ GitHub ]

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

attr_reader :tokens #: Array[lex_compat_token]

Instance Method Details

#<<(token)

: (lex_compat_token token) -> void

[ GitHub ]

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

def <<(token)
  tokens << token
end

#to_a

: () -> Array

[ GitHub ]

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

def to_a
  tokens
end