Class: YARP::LexCompat::Heredoc::PlainHeredoc

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializePlainHeredoc

Returns a new instance of PlainHeredoc.



274
275
276
# File 'lib/yarp/lex_compat.rb', line 274

def initialize
  @tokens = []
end

Instance Attribute Details

#tokensObject (readonly)

Returns the value of attribute tokens.



272
273
274
# File 'lib/yarp/lex_compat.rb', line 272

def tokens
  @tokens
end

Instance Method Details

#<<(token) ⇒ Object



278
279
280
# File 'lib/yarp/lex_compat.rb', line 278

def <<(token)
  tokens << token
end

#to_aObject



282
283
284
# File 'lib/yarp/lex_compat.rb', line 282

def to_a
  tokens
end