Class: YARP::LexCompat::Heredoc::PlainHeredoc
- Inherits:
-
Object
- Object
- YARP::LexCompat::Heredoc::PlainHeredoc
- Defined in:
- lib/yarp/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.
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
- #<<(token) ⇒ Object
-
#initialize ⇒ PlainHeredoc
constructor
A new instance of PlainHeredoc.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ PlainHeredoc
Returns a new instance of PlainHeredoc.
266 267 268 |
# File 'lib/yarp/lex_compat.rb', line 266 def initialize @tokens = [] end |
Instance Attribute Details
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
264 265 266 |
# File 'lib/yarp/lex_compat.rb', line 264 def tokens @tokens end |
Instance Method Details
#<<(token) ⇒ Object
270 271 272 |
# File 'lib/yarp/lex_compat.rb', line 270 def <<(token) tokens << token end |
#to_a ⇒ Object
274 275 276 |
# File 'lib/yarp/lex_compat.rb', line 274 def to_a tokens end |