Class: RubyLexer::EscNlToken

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

Overview


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

Constructor Details

#initialize(ident, offset, filename = nil, linenum = nil) ⇒ EscNlToken

Returns a new instance of EscNlToken.



679
680
681
682
683
684
# File 'lib/rubylexer/token.rb', line 679

def initialize(ident,offset,filename=nil,linenum=nil)
   super(ident,offset)
   #@char='\\'
   @filename=filename
   @linenum=linenum
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



686
687
688
# File 'lib/rubylexer/token.rb', line 686

def filename
  @filename
end

#linenumObject

Returns the value of attribute linenum.



686
687
688
# File 'lib/rubylexer/token.rb', line 686

def linenum
  @linenum
end

Instance Method Details

#endlineObject



693
694
695
# File 'lib/rubylexer/token.rb', line 693

def endline
  @linenum
end

#linecountObject



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

def linecount; 1 end

#startlineObject



690
691
692
# File 'lib/rubylexer/token.rb', line 690

def startline
  @linenum-1
end

#startline=(bogus) ⇒ Object



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

def startline= bogus; end

#ws_munge(tp) ⇒ Object



49
50
51
52
# File 'lib/rubylexer/tokenprinter.rb', line 49

def ws_munge(tp)
   tp.lasttok=self
   return " \\\n"
end