public Method

RubyToken.Token(token, value = nil)

There's no documentation for this item.

Source Code

# File irb/ruby-token.rb, line 84
def Token(token, value = nil)
  case token
  when String
    if (tk = TkReading2Token[token]).nil?
      IRB.fail TkReading2TokenNoKey, token
    end
    tk = Token(tk[0], value) 
    if tk.kind_of?(TkOp)
      tk.name = token
    end
    return tk
  when Symbol
    if (tk = TkSymbol2Token[token]).nil?
      IRB.fail TkSymbol2TokenNoKey, token
    end
    return Token(tk[0], value) 
  else 
    if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
      token.new(@prev_seek, @prev_line_no, @prev_char_no)
    else
      token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
    end
  end
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.