Bisarre comma

Issue #3456 has been updated by Koichi Sasada.

長期的な展望としては,この件はどうなるべきでしょうか.

Bug #3456: bisarre comma
http://redmine.ruby-lang.org/issues/3456

Author: Shyouhei U.
Status: Assigned
Priority: Normal
Assignee: Yukihiro M.
Category: core
Target version: 1.9.x
ruby -v: ruby 1.9.3dev (2010-06-19 trunk 28363) [x86_64-linux]

=begin
ひょっとして意図的なのかもしれませんが、以下のような謎の , が1.9系でSyntax OKになるのはなんででしょう?

% ruby -wcve ‘x y , ;’
ruby 1.8.8dev (2010-06-15 revision 27061) [x86_64-linux]
-e:1: syntax error, unexpected ‘;’
% ruby -wcve ‘x y , ;’
ruby 1.9.3dev (2010-06-19 trunk 28363) [x86_64-linux]
Syntax OK
=end

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43717] [Ruby 1.9 - Bug #3456] bisarre comma”
on Sat, 11 Jun 2011 15:06:24 +0900, Koichi Sasada
[email protected] writes:

|$BD94|E*$JE8K>$H$7$F$O!$$3$N7o$O$I$&$J$k$Y$-$G$7$g$&$+!%(B

$B$3$N$^$^$J$s$8$c$J$$!)(B $BG[Ns$H$+$GMWAG$NKvHx$K%+%s%^$,CV$1$k(B
$B$N$N1dD9$H$7$FJ8K!$rJQ99$7$?5$$,$9$k!#$D$^$j!"(BDSL$BE*$K=q$/$H(B
$B$-$KG[Ns$d%O%C%7%e$OKvHx$K%+%s%^$,CV$1$k$N$K!"%a%=%C%I8F$S=P(B
$B$7$K$OCV$1$J$$$N$O5$J,$,NI$/[email protected]$C$?$h$&$J!#(B

$B%a!<%k$K$8$+$KH?1~$7$?$^$D$b$H$5$s$OFI$s$G$J$$$H;W$&$N$G%3%a%s%H(B#5$B$r:F7G(B
$B$9$k$H!"(B

$B26$,$3$l$O%P%[email protected]$H;W$&$N$O!“3g8L$N$”$k$J$7$G0UL#$,JQ$o$k$H$$$&$N$,6’[email protected](B
$B$H$$$&;W$&$+$i$G$9!#$J$<(B
i(j,)
k l
$B$,(BOK$B$G(B
i j,
k l
$B$,(BNG$B$J$N$+!"$"$-$i$+$K:.Mp$N$b$H$G$9!#$5$i$K$$$&$H(B
i j, do end
k l
$B$b8=>u(BOK$B$G$9!#$b$O$d$o$1$o$+$i$s!#(B

$B$3$N9TKv$K(B,$B$r5v$=$&$H$7$?JQ99$O(Brevert$B$7$?$[$&$,$h$$$H;W$$$^$9!#(B

$B$3$l$O(B#5$B$K$O=q$$$F$"$j$^$;$s$,!“DI5-$9$k$H!”(B

i j, do end
i j, { }
i j, -> { }

$B$O$9$Y$F9gK!$G!"$+$D!"$9$Y$F0[$J$k2r<a$G$9!#0UL#$,J,$+$j$^$;$s!#(B

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43755] Re: [Ruby 1.9 - Bug #3456] bisarre
comma”
on Sun, 12 Jun 2011 00:17:05 +0900, Urabe S.
[email protected] writes:

|$B26$,$3$l$O%P%[email protected]$H;W$&$N$O!“3g8L$N$”$k$J$7$G0UL#$,JQ$o$k$H$$$&$N$,6’[email protected](B
|$B$H$$$&;W$&$+$i$G$9!#$J$<(B
| i(j,)
| k l
|$B$,(BOK$B$G(B
| i j,
| k l
|$B$,(BNG$B$J$N$+!"$"$-$i$+$K:.Mp$N$b$H$G$9!#(B

$B!V1i;;;R(B($B$3$N>l9g$O%3%s%^(B)$B$,9TKv$K$"$k;~$K$O7QB3!W$H$$$&%k!<(B
$B%k$H$NAH$_9g$o$;$GH/@8$7$F$$$k8=>]$G$9$M!#$3$N%k!<%k$rCN$C$F(B
$B$5$($$$l$P$=$s$J$K:.Mp$7$J$$$H;W$&$J$"!#(B

|$B$5$i$K$$$&$H(B
| i j, do end
| k l
|$B$b8=>u(BOK$B$G$9!#$b$O$d$o$1$o$+$i$s!#(B

$B$3$l$bF1MM$G$9$M!#9TKv$K%3%s%^$,Mh$F$J$$$+$i!#(B

|$B$3$l$O(B#5$B$K$O=q$$$F$"$j$^$;$s$,!“DI5-$9$k$H!”(B
|
| i j, do end
| i j, { }
| i j, -> { }
|
|$B$O$9$Y$F9gK!$G!"$+$D!"$9$Y$F0[$J$k2r<a$G$9!#0UL#$,J,$+$j$^$;$s!#(B

$BA4It0c$&[email protected]$+$i!#0[$J$k2r<a$G$"$kJ}$,EvA3$G$O!#(B

|$B$3$N9TKv$K(B,$B$r5v$=$&$H$7$?JQ99$O(Brevert$B$7$?$[$&$,$h$$$H;W$$$^$9!#(B

[email protected]$o$l$F$^$9$,!"$O$C$-$j$H$O=q$$$F$J$$$,$[$N$a(B
[email protected]$H;W$&!"(B

$B3g8L$N$J$$%a%=%C%I8F$S=P$7$N0z?t%j%9%H$NKvHx$K%3%s%^$NB8:_(B
$B$r5v$9$H!"$*$=$i$/$O0U?^$7$F$$$J$$9T7QB3$,5/$-$F$7$^$$!"%f!<(B
$B%6!<$,6C$/(B

[email protected][email protected]$1$K$OF10U$7$^$9!#[email protected]$K$O5$$,$D$$$F$^$;(B
$B$s$G$7$?$7!#>e$K$"$k!V:.Mp$N$b$H!W$H$+!V$o$1$o$+$i$s!W$H$+(B
$B!V0UL#$,J,$+$j$^$;$s!W$H$$$&$N$O!"$D$^$j!"[email protected]$$$?$+$C(B
$B$?$N$+$J$"!#(B

$B$G!“F10U$7$?$N$G!”>/$J$/$H$b!V3g8L$N$J$$%a%=%C%I8F$S=P$7KvHx(B
$B$N%3%s%^$O5v$5$J$$!W$H$$$&JQ99$O9T$$$^$7$g$&!#:#!"(Byacc$B$N%k!<(B
$B%k$r8+$?$i!"(Brevert$B$9$k$N$O(B4$B9T:[email protected][email protected]$1$I!“3g8L$N$”$k>l9g(B
[email protected]$15v$9$H$J$k$H$b$&$A$g$C$HJ#;($K$J$k$J$"!#$^$"!"%k!<%k$R$H(B
$B$DA}[email protected][email protected]$1$I!#(B

                            $B$^$D$b$H(B $B$f$-$R$m(B /:|)

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43759] Re: [Ruby 1.9 - Bug #3456] bisarre
comma”
on Sun, 12 Jun 2011 03:14:43 +0900, Urabe S.
[email protected] writes:

|$B$^$"$3$l$b<B$O(Bredmine$B$N%m%0$K$O=q$$$F$"$C$?$o$1$G$9$,!"(B
|
|* $BKNIt$OEvA3(Byacc$B$H(Bruby
-y$B$rFI$s$G$+$iH/[email protected]$7$F$$j!"8=>[email protected]$r5a$a$F$$(B
|$B$k$o$1$G$O$J$$!#8=>u$,$
[email protected]$C$F$$$k!#(B
|*
$BKNIt$O3g8L$,$J$$>l9g$N$_(B($B!V9TKv$N(B,[email protected]$7$F$$$^$9$M(B?)$B$rLdBj$K$7$F$*(B
|$B$j!"$+$D!“3g8L$,$”$k>l9g$N5sF0JQ99$O$($s$I$&$5$s$+$i(Breject$B$5$l$F$$$k$N(B
|$B$G!“8=:OCBj$K$J$C$F$$$k$N$O3g8L$J$7$N>l9g$N$!#(B
|
|[email protected]$r:FEY?=$7>e$2!”$7$+$7:G=E[email protected]$K;[email protected]$1$?$h$&$G$J$K(B
|$B$h$j$G$9!#$d$O$j$3$l$O6C$-$^$9$h$M!#(B

$B$$$d!“8+Mn$H$7$,$”$C$?$N$O;v<B$G?=$7Lu$J$$!#$H$j$"$($:$3$s$J(B
$B%Q%C%A$r=q$$$F8+$^$7$?!#$A$g$C$HM>M5$,$J$$$N$G%F%9%H$G$-$F$^(B
$B$;$s!#KvHx$,(Bassoc$B$,%1!<%9$O$I$&$7$h$&$+$J$"!#(B

diff --git a/parse.y b/parse.y
index 459cd8b…c48036b 100644
— a/parse.y
+++ b/parse.y
@@ -2418,6 +2418,10 @@ opt_paren_args : none

opt_call_args : none
| call_args

  • | args ‘,’
  •    {
    
  •      $$ = $1;
    
  •    }
    
    ;

call_args : command
@@ -2491,10 +2495,6 @@ opt_block_arg : ‘,’ block_arg
{
$$ = $2;
}

  • | ‘,’
  •    {
    
  •  $$ = 0;
    
  •    }
    
    | none
    {
    $$ = 0;

$BKNIt$G$9!#(B

$B$^$"$3$l$b<B$O(Bredmine$B$N%m%0$K$O=q$$$F$"$C$?$o$1$G$9$,!"(B

$BKNIt$O3g8L$,$J$$>l9g$N$_(B($B!V9TKv$N(B,[email protected]$7$F$$$^$9$M(B?)$B$rLdBj$K$7$F$*(B
$B$j!"$+$D!“3g8L$,$”$k>l9g$N5sF0JQ99$O$($s$I$&$5$s$+$i(Breject$B$5$l$F$$$k$N(B
$B$G!"8=:OCBj$K$J$C$F$$$k$N$O3g8L$J$7$N>l9g$N$!#(B

[email protected]$r:FEY?=$7>e$2!"$7$+$7:G=E[email protected]$K;[email protected]$1$?$h$&$G$J$K(B
$B$h$j$G$9!#$d$O$j$3$l$O6C$-$^$9$h$M!#(B

(06/12/2011 03:55 AM), Yukihiro M. wrote:

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43760] Re: [Ruby 1.9 - Bug #3456] bisarre comma”
on Sun, 12 Jun 2011 03:33:57 +0900, Yukihiro M. [email protected]
writes:

|$B$$$d!“8+Mn$H$7$,$”$C$?$N$O;v<B$G?=$7Lu$J$$!#$H$j$"$($:$3$s$J(B
|$B%Q%C%A$r=q$$$F8+$^$7$?!#$A$g$C$HM>M5$,$J$$$N$G%F%9%H$G$-$F$^(B
|$B$;$s!#KvHx$,(Bassoc$B$,%1!<%9$O$I$&$7$h$&$+$J$"!#(B

$BKvHx(Bassoc$B$N8e$m$K$b%+%s%^$r5v$9%Q%C%A!#(B

$B<j85$G3NG’$7$F$_$?46$8$H$7$F$O!"$h$5$=$&$K;W$$$^$9!#>/$J$/$H$b4{B8$N%F%9(B
$B%H$O$3$o$l$F$$$^$;$s$7!";d$NITK~$O2r>C$5$l$F$$$^$9!#(Bassoc$B$r$I$&$9$k$+(B
$B$O!"$3$3$O5v$7$?$[$&$,[email protected]$NLL$G$O$h$$5$$,$7$^$9$,!“FC$K6/$$0U8+$O$”$j(B
$B$^$;$s!#(B

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43760] Re: [Ruby 1.9 - Bug #3456] bisarre
comma”
on Sun, 12 Jun 2011 03:33:57 +0900, Yukihiro M.
[email protected] writes:

|$B$$$d!“8+Mn$H$7$,$”$C$?$N$O;v<B$G?=$7Lu$J$$!#$H$j$"$($:$3$s$J(B
|$B%Q%C%A$r=q$$$F8+$^$7$?!#$A$g$C$HM>M5$,$J$$$N$G%F%9%H$G$-$F$^(B
|$B$;$s!#KvHx$,(Bassoc$B$,%1!<%9$O$I$&$7$h$&$+$J$"!#(B

$BKvHx(Bassoc$B$N8e$m$K$b%+%s%^$r5v$9%Q%C%A!#(B

— a/parse.y
+++ b/parse.y
@@ -2418,6 +2418,18 @@ opt_paren_args : none

opt_call_args : none
| call_args

  • | args ‘,’
  •    {
    
  •      $$ = $1;
    
  •    }
    
  • | args ‘,’ assocs ‘,’
  •    {
    
  •    /*%%%*/
    
  •  $$ = arg_append($1, NEW_HASH($3));
    
  •    /*%
    
  •  $$ = arg_add_assocs($1, $3);
    
  •    %*/
    
  •    }
    
    ;

call_args : command
@@ -2491,10 +2503,6 @@ opt_block_arg : ‘,’ block_arg
{
$$ = $2;
}

  • | ‘,’
  •    {
    
  •  $$ = 0;
    
  •    }
    
    | none
    {
    $$ = 0;

$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message “Re: [ruby-dev:43765] Re: [Ruby 1.9 - Bug #3456] bisarre
comma”
on Sun, 12 Jun 2011 15:05:51 +0900, Urabe S.
[email protected] writes:

|> $BKvHx(Bassoc$B$N8e$m$K$b%+%s%^$r5v$9%Q%C%A!#(B
|
|$B<j85$G3NG’$7$F$_$?46$8$H$7$F$O!"$h$5$=$&$K;W$$$^$9!#>/$J$/$H$b4{B8$N%F%9(B
|$B%H$O$3$o$l$F$$$^$;$s$7!";d$NITK~$O2r>C$5$l$F$$$^$9!#(Bassoc$B$r$I$&$9$k$+(B
|$B$O!"$3$3$O5v$7$?$[$&$,[email protected]$NLL$G$O$h$$5$$,$7$^$9$,!“FC$K6/$$0U8+$O$”$j(B
|$B$^$;$s!#(B

$B3NG’$"$j$,$H$&$4$6$$$^$9!#(Bassoc$B$N8e$m$K$b%+%s%^$r5v$9J}8~$G(B
$B%Q%C%A$r%3%_%C%H$7$h$&$H;W$$$^$9!#(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs