Class: RubyLexer::EscNlToken
- Inherits:
-
IgnoreToken
- Object
- Token
- IgnoreToken
- RubyLexer::EscNlToken
- Defined in:
- lib/rubylexer/token.rb,
lib/rubylexer/tokenprinter.rb
Overview
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#linenum ⇒ Object
Returns the value of attribute linenum.
Attributes inherited from Token
#allow_ooo_offset, #as, #ident, #offset, #tag
Instance Method Summary collapse
- #endline ⇒ Object
-
#initialize(ident, offset, filename = nil, linenum = nil) ⇒ EscNlToken
constructor
A new instance of EscNlToken.
- #linecount ⇒ Object
- #startline ⇒ Object
- #startline=(bogus) ⇒ Object
- #ws_munge(tp) ⇒ Object
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
#filename ⇒ Object
Returns the value of attribute filename.
686 687 688 |
# File 'lib/rubylexer/token.rb', line 686 def filename @filename end |
#linenum ⇒ Object
Returns the value of attribute linenum.
686 687 688 |
# File 'lib/rubylexer/token.rb', line 686 def linenum @linenum end |
Instance Method Details
#endline ⇒ Object
693 694 695 |
# File 'lib/rubylexer/token.rb', line 693 def endline @linenum end |
#linecount ⇒ Object
688 |
# File 'lib/rubylexer/token.rb', line 688 def linecount; 1 end |
#startline ⇒ Object
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 |