* parse.y (assoc_list): remove expanded hash literal (no splat).

* lib/webrick/httpstatus.rb (WEBrick::HTTPStatus::EOFError): adapt
  to new syntax.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-06-29 06:27:49 +00:00
parent 453f64fa47
commit 71f8ca8bc4
4 changed files with 55 additions and 60 deletions

View File

@ -1,3 +1,10 @@
Fri Jun 29 14:51:24 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (assoc_list): remove expanded hash literal (no splat).
* lib/webrick/httpstatus.rb (WEBrick::HTTPStatus::EOFError): adapt
to new syntax.
Fri Jun 29 14:48:18 2007 Koichi Sasada <ko1@atdot.net> Fri Jun 29 14:48:18 2007 Koichi Sasada <ko1@atdot.net>
* tool/insns2vm.rb, lib/vm/instruction.rb: move process body * tool/insns2vm.rb, lib/vm/instruction.rb: move process body

View File

@ -23,46 +23,46 @@ module WEBrick
class EOFError < StandardError; end class EOFError < StandardError; end
StatusMessage = { StatusMessage = {
100, 'Continue', 100 => 'Continue',
101, 'Switching Protocols', 101 => 'Switching Protocols',
200, 'OK', 200 => 'OK',
201, 'Created', 201 => 'Created',
202, 'Accepted', 202 => 'Accepted',
203, 'Non-Authoritative Information', 203 => 'Non-Authoritative Information',
204, 'No Content', 204 => 'No Content',
205, 'Reset Content', 205 => 'Reset Content',
206, 'Partial Content', 206 => 'Partial Content',
300, 'Multiple Choices', 300 => 'Multiple Choices',
301, 'Moved Permanently', 301 => 'Moved Permanently',
302, 'Found', 302 => 'Found',
303, 'See Other', 303 => 'See Other',
304, 'Not Modified', 304 => 'Not Modified',
305, 'Use Proxy', 305 => 'Use Proxy',
307, 'Temporary Redirect', 307 => 'Temporary Redirect',
400, 'Bad Request', 400 => 'Bad Request',
401, 'Unauthorized', 401 => 'Unauthorized',
402, 'Payment Required', 402 => 'Payment Required',
403, 'Forbidden', 403 => 'Forbidden',
404, 'Not Found', 404 => 'Not Found',
405, 'Method Not Allowed', 405 => 'Method Not Allowed',
406, 'Not Acceptable', 406 => 'Not Acceptable',
407, 'Proxy Authentication Required', 407 => 'Proxy Authentication Required',
408, 'Request Timeout', 408 => 'Request Timeout',
409, 'Conflict', 409 => 'Conflict',
410, 'Gone', 410 => 'Gone',
411, 'Length Required', 411 => 'Length Required',
412, 'Precondition Failed', 412 => 'Precondition Failed',
413, 'Request Entity Too Large', 413 => 'Request Entity Too Large',
414, 'Request-URI Too Large', 414 => 'Request-URI Too Large',
415, 'Unsupported Media Type', 415 => 'Unsupported Media Type',
416, 'Request Range Not Satisfiable', 416 => 'Request Range Not Satisfiable',
417, 'Expectation Failed', 417 => 'Expectation Failed',
500, 'Internal Server Error', 500 => 'Internal Server Error',
501, 'Not Implemented', 501 => 'Not Implemented',
502, 'Bad Gateway', 502 => 'Bad Gateway',
503, 'Service Unavailable', 503 => 'Service Unavailable',
504, 'Gateway Timeout', 504 => 'Gateway Timeout',
505, 'HTTP Version Not Supported' 505 => 'HTTP Version Not Supported'
} }
CodeToError = {} CodeToError = {}

11
parse.y
View File

@ -4326,17 +4326,6 @@ assoc_list : none
$$ = dispatch1(assoclist_from_args, $1); $$ = dispatch1(assoclist_from_args, $1);
%*/ %*/
} }
| args trailer
{
/*%%%*/
if (nd_type($1) == NODE_ARRAY && $1->nd_alen%2 != 0) {
yyerror("odd number list for Hash");
}
$$ = $1;
/*%
$$ = dispatch1(assoclist_from_args, $1);
%*/
}
; ;
assocs : assoc assocs : assoc

View File

@ -750,12 +750,11 @@ test_ok($x == [1,2,3,1,2,3])
test_check "hash" test_check "hash"
$x = {1=>2, 2=>4, 3=>6} $x = {1=>2, 2=>4, 3=>6}
$y = {1, 2, 2, 4, 3, 6}
test_ok($x[1] == 2) test_ok($x[1] == 2)
test_ok(begin test_ok(begin
for k,v in $y for k,v in $x
raise if k*2 != v raise if k*2 != v
end end
true true
@ -769,19 +768,19 @@ test_ok($x.has_value?(4))
test_ok($x.values_at(2,3) == [4,6]) test_ok($x.values_at(2,3) == [4,6])
test_ok($x == {1=>2, 2=>4, 3=>6}) test_ok($x == {1=>2, 2=>4, 3=>6})
$z = $y.keys.sort.join(":") $z = $x.keys.sort.join(":")
test_ok($z == "1:2:3") test_ok($z == "1:2:3")
$z = $y.values.sort.join(":") $z = $x.values.sort.join(":")
test_ok($z == "2:4:6") test_ok($z == "2:4:6")
test_ok($x == $y) test_ok($x == $x)
$y.shift $x.shift
test_ok($y.length == 2) test_ok($x.length == 2)
$z = [1,2] $z = [1,2]
$y[$z] = 256 $x[$z] = 256
test_ok($y[$z] == 256) test_ok($x[$z] == 256)
$x = Hash.new(0) $x = Hash.new(0)
$x[1] = 1 $x[1] = 1