зеркало из https://github.com/github/ruby.git
* 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:
Родитель
808e9289e6
Коммит
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>
|
||||
|
||||
* lib/resolv.rb (Resolv::DNS::Resource#hash): use XOR to accumulate
|
||||
|
|
14
lib/cgi.rb
14
lib/cgi.rb
|
@ -941,27 +941,23 @@ convert string charset, and set language to "ja".
|
|||
end
|
||||
private :initialize_query
|
||||
|
||||
class Value < String
|
||||
def [](key)
|
||||
value, = @params[key]
|
||||
unless value.nil?
|
||||
value = value.dup
|
||||
def value.to_ary
|
||||
[self]
|
||||
end
|
||||
def value.[](key)
|
||||
$stderr.puts <<END
|
||||
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
||||
END
|
||||
self
|
||||
end
|
||||
def value.first
|
||||
def first
|
||||
$stderr.puts <<END
|
||||
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
|
||||
END
|
||||
self
|
||||
end
|
||||
end
|
||||
value
|
||||
|
||||
def [](key)
|
||||
Value.new(@params[key][0])
|
||||
end
|
||||
|
||||
def keys(*args)
|
||||
|
|
|
@ -68,6 +68,8 @@ class Rational < Numeric
|
|||
new(num, den)
|
||||
end
|
||||
|
||||
private_class_method :new
|
||||
|
||||
def initialize(num, den)
|
||||
if den < 0
|
||||
num = -num
|
||||
|
|
2
parse.y
2
parse.y
|
@ -3269,7 +3269,7 @@ here_document(here)
|
|||
static void
|
||||
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче