Class: RubyLexer::FileAndLineToken
- Inherits:
-
IgnoreToken
- Object
- Token
- IgnoreToken
- RubyLexer::FileAndLineToken
- Defined in:
- lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb
Overview
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
Attributes inherited from IgnoreToken
Attributes inherited from Token
#allow_ooo_offset, #as, #ident, #offset, #tag
Instance Method Summary collapse
- #endline ⇒ Object
- #file ⇒ Object
-
#initialize(ident, line, offset = nil) ⇒ FileAndLineToken
constructor
A new instance of FileAndLineToken.
- #startline ⇒ Object
- #startline=(bogus) ⇒ Object
-
#subitem ⇒ Object
needed?.
-
#to_s ⇒ Object
def char; ‘#’ end.
- #ws_munge(tp) ⇒ Object
Methods inherited from Token
#dump, #error, #has_no_block?, #inspect, #linecount, #orig_inspect
Constructor Details
#initialize(ident, line, offset = nil) ⇒ FileAndLineToken
Returns a new instance of FileAndLineToken.
747 748 749 750 751 752 |
# File 'lib/rubylexer/token.rb', line 747 def initialize(ident,line,offset=nil) super ident,offset #@char='#' @line=line end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
745 746 747 |
# File 'lib/rubylexer/token.rb', line 745 def line @line end |
Instance Method Details
#endline ⇒ Object
763 |
# File 'lib/rubylexer/token.rb', line 763 def endline; @line end |
#file ⇒ Object
760 |
# File 'lib/rubylexer/token.rb', line 760 def file() @ident end |
#startline ⇒ Object
764 |
# File 'lib/rubylexer/token.rb', line 764 def startline; @line end |
#startline=(bogus) ⇒ Object
766 |
# File 'lib/rubylexer/token.rb', line 766 def startline= bogus; end |
#subitem ⇒ Object
needed?
761 |
# File 'lib/rubylexer/token.rb', line 761 def subitem() @line end |
#to_s ⇒ Object
def char; ‘#’ end
756 757 758 |
# File 'lib/rubylexer/token.rb', line 756 def to_s() %[##@ident:#@line] end |
#ws_munge(tp) ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rubylexer/tokenprinter.rb', line 53 def ws_munge(tp) result='' #faugh, doesn't fix it #result= "\\\n"*(line-tp.lastfal.line) if StringToken===tp.lasttok tp.lasttok=self tp.lastfal=self return result end |