Class: RubyLexer::HereBodyToken
- Inherits:
-
IgnoreToken
- Object
- Token
- IgnoreToken
- RubyLexer::HereBodyToken
- Defined in:
- lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb
Overview
experimental
Direct Known Subclasses
Instance Attribute Summary collapse
-
#close ⇒ Object
attr_accessor :ender.
-
#headtok ⇒ Object
readonly
Returns the value of attribute headtok.
-
#linecount ⇒ Object
readonly
num lines here body spans (including terminator).
-
#open ⇒ Object
attr_accessor :ender.
Attributes inherited from Token
#allow_ooo_offset, #as, #ident, #offset, #tag
Instance Method Summary collapse
- #endline=(line) ⇒ Object
-
#initialize(headtok, linecount) ⇒ HereBodyToken
constructor
A new instance of HereBodyToken.
- #line ⇒ Object (also: #endline)
- #startline ⇒ Object
- #to_s ⇒ Object
- #ws_munge(tp) ⇒ Object
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
#close ⇒ Object
attr_accessor :ender
715 716 717 |
# File 'lib/rubylexer/token.rb', line 715 def close @close end |
#headtok ⇒ Object (readonly)
Returns the value of attribute headtok.
739 740 741 |
# File 'lib/rubylexer/token.rb', line 739 def headtok @headtok end |
#linecount ⇒ Object (readonly)
num lines here body spans (including terminator)
740 741 742 |
# File 'lib/rubylexer/token.rb', line 740 def linecount @linecount end |
#open ⇒ Object
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 |
#line ⇒ Object Also known as: endline
723 724 725 |
# File 'lib/rubylexer/token.rb', line 723 def line @ident.line end |
#startline ⇒ Object
731 732 733 |
# File 'lib/rubylexer/token.rb', line 731 def startline line-@linecount+1 end |
#to_s ⇒ Object
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 |