Class: RubyLexer::FileAndLineToken

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

Overview


Instance Attribute Summary collapse

Attributes inherited from IgnoreToken

#linecount

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, #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

#lineObject

Returns the value of attribute line.



745
746
747
# File 'lib/rubylexer/token.rb', line 745

def line
  @line
end

Instance Method Details

#endlineObject



763
# File 'lib/rubylexer/token.rb', line 763

def endline; @line end

#fileObject



760
# File 'lib/rubylexer/token.rb', line 760

def file()   @ident   end

#startlineObject



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

#subitemObject

needed?



761
# File 'lib/rubylexer/token.rb', line 761

def subitem()   @line   end

#to_sObject

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