Class: RubyLexer::DecoratorToken

Inherits:
SubitemToken show all
Defined in:
lib/rubylexer/token.rb

Overview


Instance Attribute Summary

Attributes inherited from SubitemToken

#char2, #subitem

Attributes inherited from Token

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

Instance Method Summary collapse

Methods inherited from SubitemToken

#to_s

Methods inherited from Token

#error, #has_no_block?, #to_s, #ws_munge

Constructor Details

#initialize(ident, subitem) ⇒ DecoratorToken

Returns a new instance of DecoratorToken.



674
675
676
677
678
679
# File 'lib/rubylexer/token.rb', line 674

def initialize(ident,subitem)
   super '^'+ident,subitem
   @subitem=@subitem.to_s  #why to_s?
   #@char='^'
   @char2='='
end

Instance Method Details

#needs_value?Boolean

alias to_s ident #parent has right implementation of to_s… i think

Returns:

  • (Boolean)


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

def needs_value?()   @subitem.nil?   end

#valueObject



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

def value()     @subitem    end

#value=(v) ⇒ Object



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

def value=(v)   @subitem=v  end