Class: RubyLexer::IgnoreToken

Inherits:
Token
  • Object
show all
Includes:
StillIgnoreToken
Defined in:
lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb

Overview


Instance Attribute Summary

Attributes inherited from Token

#allow_ooo_offset, #as, #ident, #offset, #tag

Instance Method Summary collapse

Methods inherited from Token

#error, #has_no_block?, #initialize, #to_s

Constructor Details

This class inherits a constructor from RubyLexer::Token

Instance Method Details

#ws_munge(tp) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/rubylexer/tokenprinter.rb', line 67

def ws_munge(tp)
      #tp.latestline+= to_s.scan("\n").size
      tp.lasttok=self
      result=unless tp.inws
        tp.inws=true
        ' '
      else
        ''
      end
      if ?= == @ident.to_s[0]
        result+="\\\n"*@ident.to_s.scan(/\r\n?|\n\r?/).size
      end
      
      return result
end