Class: RubyLexer::HereBodyToken

Inherits:
IgnoreToken show all
Defined in:
lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb

Overview

experimental

Direct Known Subclasses

OutlinedHereBodyToken

Instance Attribute Summary collapse

Attributes inherited from Token

#allow_ooo_offset, #as, #ident, #offset, #tag

Instance Method Summary collapse

Methods inherited from Token

#dump, #error, #has_no_block?, #inspect, #orig_inspect

Constructor Details

#initialize(headtok, linecount) ⇒ HereBodyToken

Returns a new instance of HereBodyToken.



716
717
718
719
720
721
# File 'lib/rubylexer/token.rb', line 716

def initialize(headtok,linecount)
  assert HerePlaceholderToken===headtok
  @ident,@offset=headtok.string,headtok.string.offset
  @headtok=headtok
  @linecount=linecount
end

Instance Attribute Details

#closeObject

attr_accessor :ender



715
716
717
# File 'lib/rubylexer/token.rb', line 715

def close
  @close
end

#headtokObject (readonly)

Returns the value of attribute headtok.



739
740
741
# File 'lib/rubylexer/token.rb', line 739

def headtok
  @headtok
end

#linecountObject (readonly)

num lines here body spans (including terminator)



740
741
742
# File 'lib/rubylexer/token.rb', line 740

def linecount
  @linecount
end

#openObject

attr_accessor :ender



715
716
717
# File 'lib/rubylexer/token.rb', line 715

def open
  @open
end

Instance Method Details

#endline=(line) ⇒ Object



727
728
729
# File 'lib/rubylexer/token.rb', line 727

def endline= line
  @ident.line= line
end

#lineObject Also known as: endline



723
724
725
# File 'lib/rubylexer/token.rb', line 723

def line
  @ident.line
end

#startlineObject



731
732
733
# File 'lib/rubylexer/token.rb', line 731

def startline
  line-@linecount+1
end

#to_sObject



735
736
737
# File 'lib/rubylexer/token.rb', line 735

def to_s
  @ident.to_s
end

#ws_munge(tp) ⇒ Object



82
83
84
# File 'lib/rubylexer/tokenprinter.rb', line 82

def ws_munge(tp) #experimental
  nil
end