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
-
.new ⇒ PlainHeredoc
constructor
: () -> void.
Instance Attribute Summary
- #tokens readonly
Instance Method Summary
-
#<<(token)
: (lex_compat_token token) -> void.
-
#to_a
: () -> Array.
Constructor Details
.new ⇒ PlainHeredoc
: () -> void
# File 'lib/prism/lex_compat.rb', line 250
def initialize @tokens = [] end
Instance Attribute Details
#tokens (readonly)
[ GitHub ]# File 'lib/prism/lex_compat.rb', line 247
attr_reader :tokens #: Array[lex_compat_token]
Instance Method Details
#<<(token)
: (lex_compat_token token) -> void
# File 'lib/prism/lex_compat.rb', line 255
def <<(token) tokens << token end
#to_a
: () -> Array
# File 'lib/prism/lex_compat.rb', line 260
def to_a tokens end