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 Token
#allow_ooo_offset, #as, #ident, #offset, #tag
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(ident, line, offset = nil) ⇒ FileAndLineToken
constructor
A new instance of FileAndLineToken.
-
#subitem ⇒ Object
needed?.
-
#to_s ⇒ Object
def char; ‘#’ end.
- #ws_munge(tp) ⇒ Object
Methods inherited from Token
Constructor Details
#initialize(ident, line, offset = nil) ⇒ FileAndLineToken
Returns a new instance of FileAndLineToken.
622 623 624 625 626 627 |
# File 'lib/rubylexer/token.rb', line 622 def initialize(ident,line,offset=nil) super ident,offset #@char='#' @line=line end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
620 621 622 |
# File 'lib/rubylexer/token.rb', line 620 def line @line end |
Instance Method Details
#file ⇒ Object
635 |
# File 'lib/rubylexer/token.rb', line 635 def file() @ident end |
#subitem ⇒ Object
needed?
636 |
# File 'lib/rubylexer/token.rb', line 636 def subitem() @line end |
#to_s ⇒ Object
def char; ‘#’ end
631 632 633 |
# File 'lib/rubylexer/token.rb', line 631 def to_s() ['#', @ident, ':', @line].to_s 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 |