From: Rafael Garcia-Suarez Date: Wed, 22 Jul 2009 09:20:35 +0000 (+0200) Subject: Remove !!! and ??? operators X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=678ae90b5bfdcb408a7a5c2767d230d736624a6c;p=p5sagit%2Fp5-mst-13.2.git Remove !!! and ??? operators Those were adding non backwards compatible syntax, unlike "...", as pointed out in bug #67646. --- diff --git a/pod/perlop.pod b/pod/perlop.pod index e677430..23f62e0 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -813,14 +813,11 @@ between keys and values in hashes, and other paired elements in lists. %hash = ( $key => $value ); login( $username => $password ); -=head2 Yada Yada Operators -X<...> X<... operator> X X X X -X +=head2 Yada Yada Operator +X<...> X<... operator> X -The yada yada operators are placeholders for code. They parse without error, -but when executed either throw an exception or a warning. - -The C<...> operator takes no arguments. When executed, it throws an exception +The yada yada operator (noted C<...>) is a placeholder for code. +It parses without error, but when executed it throws an exception with the text C: sub foo { ... } @@ -828,23 +825,7 @@ with the text C: Unimplemented at line . -The C operator is similar, but it takes one argument, a string to use as -the text of the exception: - - sub bar { !!! "Don't call me, Ishmael!" } - bar(); - - Don't call me, Ishmael! at line . - -The C operator also takes one argument, but it emits a warning instead of -throwing an exception: - - sub baz { ??? "Who are you? What do you want?" } - baz(); - say "Why are you here?"; - - Who are you? What do you want? at line . - Why are you here? +It takes no argument. =head2 List Operators (Rightward) X X diff --git a/t/op/yadayada.t b/t/op/yadayada.t index deca46c..f82aa72 100644 --- a/t/op/yadayada.t +++ b/t/op/yadayada.t @@ -8,38 +8,10 @@ BEGIN { use strict; -plan 5; +plan 1; my $err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n"; eval { ... }; is $@, $err; - -$err = "foo at $0 line " . ( __LINE__ + 2 ) . ".\n"; - -eval { !!! "foo" }; - -is $@, $err; - -$err = "Died at $0 line " . ( __LINE__ + 2 ) . ".\n"; - -eval { !!! }; - -is $@, $err; - -my $warning; - -local $SIG{__WARN__} = sub { $warning = shift }; - -$err = "bar at $0 line " . ( __LINE__ + 2 ) . ".\n"; - -eval { ??? "bar" }; - -is $warning, $err; - -$err = "Warning: something's wrong at $0 line " . ( __LINE__ + 2 ) . ".\n"; - -eval { ??? }; - -is $warning, $err; diff --git a/toke.c b/toke.c index a15dca6..885027e 100644 --- a/toke.c +++ b/toke.c @@ -4805,10 +4805,6 @@ Perl_yylex(pTHX) pl_yylval.ival = 0; OPERATOR(ASSIGNOP); case '!': - if (PL_expect == XSTATE && s[1] == '!' && s[2] == '!') { - s += 3; - LOP(OP_DIE,XTERM); - } s++; { const char tmp = *s++; @@ -5060,10 +5056,6 @@ Perl_yylex(pTHX) AOPERATOR(DORDOR); } case '?': /* may either be conditional or pattern */ - if (PL_expect == XSTATE && s[1] == '?' && s[2] == '?') { - s += 3; - LOP(OP_WARN,XTERM); - } if (PL_expect == XOPERATOR) { char tmp = *s++; if(tmp == '?') {