(no subject)

[email protected]$G$9!#e(B

http://pc8.2ch.net/test/read.cgi/tech/1154077799/176-177 e$B$G=P$Fe(B
e$B$$$?OC$G$9$,!";09`1i;;;R$N%3%m%s$N8e$m$K$O2~9T$rCV$1$^$9$,!"A0e(B
e$B$K$O5v$5$l$^$;$s!#e(Bperle$B$G$O$I$A$i$be(BOKe$B$N$h$&$G$9!#e(B

$ ruby -c -e 'p 1 == 3 ?
7
:
8

-e:2: syntax error, unexpected ‘\n’

$ perl -e '$="\n";print 1 == 3 ?
7
:
8

8

e$B$3$l$ODL$7$F$bLdBj$J$$$h$&$J5$$,$9$k$N$G$9$,!#e(B

  • parse.y (arg): allow newlines before ternary colon.

Index: parse.y

RCS file: /cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.449
diff -p -U 2 -r1.449 parse.y
— parse.y 12 Jul 2006 11:10:21 -0000 1.449
+++ parse.y 6 Aug 2006 03:28:10 -0000
@@ -2095,11 +2095,11 @@ arg : lhs ‘=’ arg
%*/
}

  •   | arg '?' arg ':' arg
    
  •   | arg '?' arg opt_nl ':' arg
          {
          /*%%%*/
    
  •   	$$ = NEW_IF(cond($1), $3, $5);
    
  •   	$$ = NEW_IF(cond($1), $3, $6);
      	fixpos($$, $1);
          /*%
    
  •   	$$ = dispatch3(ifop, $1, $3, $5);
    
  •   	$$ = dispatch3(ifop, $1, $3, $6);
          %*/
          }

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

In message “Re: [ruby-dev:29189]”
on Sun, 6 Aug 2006 12:42:28 +0900, [email protected] writes:

|http://pc8.2ch.net/test/read.cgi/tech/1154077799/176-177 e$B$G=P$Fe(B
|e$B$$$?OC$G$9$,!";09`1i;;;R$N%3%m%s$N8e$m$K$O2~9T$rCV$1$^$9$,!"A0e(B
|e$B$K$O5v$5$l$^$;$s!#e(Bperle$B$G$O$I$A$i$be(BOKe$B$N$h$&$G$9!#e(B

Perle$B$O2~9T$O40A4L5;k$H$$$&%9%?%s%9e(B([email protected]$+$i%;%_%3%m%sI,?\e(B)e$B$J$Ne(B
e$B$G$"$s$^$j;29M$K$J$i$J$$$H;W$$$^$9!#e(BPythone$B$K$O;09`1i;;;R$,$Je(B
e$B$$$7!#e(B

e$B$G!"B>$r;29M$K$9$k$N$O$d$a$F!"5v$9$+5v$5$J$$$+$G$9$,!“e(BRubye$BA4e(B
e$BHL$G$O1i;;;R5-9f$N8e$m$N2~9T$OL5;k$9$k798~$,$”$j$^$9$,!“5-9fe(B
e$B$NA0$N2~9T$rL5;k$9$k$H$3$m$OB>$K$”$j$^$;$s!#e(B

e$B$H$O$$$(!“5v$7$FLdBj$,$”$k$o$1$G$O$J$7!"5v$7$F$b$+$^$o$J$$$He(B
e$B$$$&$N$b$R$H$D$N9M$(J}$G$9!#$I$&;W$$$^$9$+!)e(B

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

In message “Re: [ruby-dev:29206] newlines before ternary colon”
on Tue, 8 Aug 2006 00:04:07 +0900, [email protected] writes:

|At Mon, 7 Aug 2006 11:37:52 +0900,
|Yukihiro M. wrote in [ruby-dev:29192]:
|> e$B$G!"B>$r;29M$K$9$k$N$O$d$a$F!“5v$9$+5v$5$J$$$+$G$9$,!“e(BRubye$BA4e(B
|> e$BHL$G$O1i;;;R5-9f$N8e$m$N2~9T$OL5;k$9$k798~$,$”$j$^$9$,!“5-9fe(B
|> e$B$NA0$N2~9T$rL5;k$9$k$H$3$m$OB>$K$”$j$^$;$s!#e(B
|
|e$BL5;k$9$k$H$3$m$H$$$&$N$O!”$=$3$G<0$,=*$o$C$F$7$^$&$H%(%i!<$K$Je(B
|e$B$k$H$3$m$G$9$h$M!#;09`1i;;;R$N>l9g$b!"e(B?e$B$N8e$Oe(B:e$B$,$J$$$H%(%i!<$Ke(B
|e$B$J$k$o$1$G$9$+$i!"F1$8$h$&$K9M$($F$b$$$$$h$&$J5$$,$7$^$9!#e(B

e$B$^$"!"$=$&$G$9$h$M!#e(B1.9e$B$K%3%_%C%H$7$F$/[email protected]$5$$!#e(B1.8e$B$O$I$&$7$he(B
e$B$&$+$J!#e(B

[email protected]$G$9!#e(B

At Mon, 7 Aug 2006 11:37:52 +0900,
Yukihiro M. wrote in [ruby-dev:29192]:

e$B$G!"B>$r;29M$K$9$k$N$O$d$a$F!"5v$9$+5v$5$J$$$+$G$9$,!“e(BRubye$BA4e(B
e$BHL$G$O1i;;;R5-9f$N8e$m$N2~9T$OL5;k$9$k798~$,$”$j$^$9$,!“5-9fe(B
e$B$NA0$N2~9T$rL5;k$9$k$H$3$m$OB>$K$”$j$^$;$s!#e(B

e$BL5;k$9$k$H$3$m$H$$$&$N$O!"$=$3$G<0$,=*$o$C$F$7$^$&$H%(%i!<$K$Je(B
e$B$k$H$3$m$G$9$h$M!#;09`1i;;;R$N>l9g$b!"e(B?e$B$N8e$Oe(B:e$B$,$J$$$H%(%i!<$Ke(B
e$B$J$k$o$1$G$9$+$i!"F1$8$h$&$K9M$($F$b$$$$$h$&$J5$$,$7$^$9!#e(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