public Method

RubyToken.Token(token, value = nil)

There's no documentation for this item.

Source Code

# File rdoc/parsers/parse_rb.rb, line 112
def Token(token, value = nil)
  tk = nil
  case token
  when String, Symbol
    source = token.kind_of?(String) ? TkReading2Token : TkSymbol2Token
    if (tk = source[token]).nil?
      IRB.fail TkReading2TokenNoKey, token
    end
    tk = Token(tk[0], value) 
  else 
    tk = if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
           token.new(@prev_line_no, @prev_char_no)
         else
           token.new(@prev_line_no, @prev_char_no, value)
         end
  end
  tk
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.