* parse.y (arg_ambiguous): hopefully better message.
* lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
808e9289e6
commit
f550e69efc
@ -1,3 +1,9 @@
|
|||||||
|
Tue Apr 22 09:20:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (arg_ambiguous): hopefully better message.
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary
|
||||||
|
|
||||||
Tue Apr 22 06:06:22 2003 Tanaka Akira <akr@m17n.org>
|
Tue Apr 22 06:06:22 2003 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* lib/resolv.rb (Resolv::DNS::Resource#hash): use XOR to accumulate
|
* lib/resolv.rb (Resolv::DNS::Resource#hash): use XOR to accumulate
|
||||||
|
28
lib/cgi.rb
28
lib/cgi.rb
@ -941,27 +941,23 @@ convert string charset, and set language to "ja".
|
|||||||
end
|
end
|
||||||
private :initialize_query
|
private :initialize_query
|
||||||
|
|
||||||
def [](key)
|
class Value < String
|
||||||
value, = @params[key]
|
def [](key)
|
||||||
unless value.nil?
|
|
||||||
value = value.dup
|
|
||||||
def value.to_ary
|
|
||||||
[self]
|
|
||||||
end
|
|
||||||
def value.[](key)
|
|
||||||
$stderr.puts <<END
|
$stderr.puts <<END
|
||||||
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
||||||
END
|
END
|
||||||
self
|
self
|
||||||
end
|
|
||||||
def value.first
|
|
||||||
$stderr.puts <<END
|
|
||||||
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
|
||||||
END
|
|
||||||
self
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
value
|
def first
|
||||||
|
$stderr.puts <<END
|
||||||
|
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
||||||
|
END
|
||||||
|
self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def [](key)
|
||||||
|
Value.new(@params[key][0])
|
||||||
end
|
end
|
||||||
|
|
||||||
def keys(*args)
|
def keys(*args)
|
||||||
|
@ -67,7 +67,9 @@ class Rational < Numeric
|
|||||||
def Rational.new!(num, den = 1)
|
def Rational.new!(num, den = 1)
|
||||||
new(num, den)
|
new(num, den)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :new
|
||||||
|
|
||||||
def initialize(num, den)
|
def initialize(num, den)
|
||||||
if den < 0
|
if den < 0
|
||||||
num = -num
|
num = -num
|
||||||
|
2
parse.y
2
parse.y
@ -3269,7 +3269,7 @@ here_document(here)
|
|||||||
static void
|
static void
|
||||||
arg_ambiguous()
|
arg_ambiguous()
|
||||||
{
|
{
|
||||||
rb_warning("ambiguous first argument; make sure");
|
rb_warning("ambiguous first argument; put parentheses or even spaces");
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
|
#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user