Class: RubyLexer::RubyCode
Instance Attribute Summary collapse
-
#linenum ⇒ Object
readonly
Returns the value of attribute linenum.
Attributes inherited from Token
#allow_ooo_offset, #as, #endline, #ident, #offset, #startline, #tag
Instance Method Summary collapse
- #[](*args) ⇒ Object
-
#initialize(tokens, filename, linenum) ⇒ RubyCode
constructor
A new instance of RubyCode.
- #to_s ⇒ Object
Methods inherited from Token
#dump, #error, #has_no_block?, #inspect, #linecount, #orig_inspect, #ws_munge
Constructor Details
#initialize(tokens, filename, linenum) ⇒ RubyCode
Returns a new instance of RubyCode.
28 29 30 31 32 |
# File 'lib/rubylexer/rubycode.rb', line 28 def initialize(tokens,filename,linenum) super(tokens) @filename=filename @linenum=linenum end |
Instance Attribute Details
#linenum ⇒ Object (readonly)
Returns the value of attribute linenum.
34 35 36 |
# File 'lib/rubylexer/rubycode.rb', line 34 def linenum @linenum end |
Instance Method Details
#[](*args) ⇒ Object
36 37 38 |
# File 'lib/rubylexer/rubycode.rb', line 36 def [](*args) exec? ident.huh end |
#to_s ⇒ Object
40 41 42 43 44 45 |
# File 'lib/rubylexer/rubycode.rb', line 40 def to_s() result=[] keepwsprinter=KeepWsTokenPrinter.new('',@linenum) ident.each{|tok| result << keepwsprinter.sprint(tok) } return result.join end |