diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-22 11:20:35 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-22 11:47:57 +0200 |
commit | 678ae90b5bfdcb408a7a5c2767d230d736624a6c (patch) | |
tree | dc6782e9ebf59c86c12095de348cae83397e5ed4 | |
parent | 16f708c9bc0dc48713b200031295a40bed83bbfc (diff) | |
download | perl-678ae90b5bfdcb408a7a5c2767d230d736624a6c.tar.gz |
Remove !!! and ??? operators
Those were adding non backwards compatible syntax, unlike "...",
as pointed out in bug #67646.
-rw-r--r-- | pod/perlop.pod | 29 | ||||
-rw-r--r-- | t/op/yadayada.t | 30 | ||||
-rw-r--r-- | toke.c | 8 |
3 files changed, 6 insertions, 61 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod index e6774303ee..23f62e09ab 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<!!! operator> X<???> X<??? operator> -X<yada yada operator> +=head2 Yada Yada Operator +X<...> X<... operator> X<yada yada operator> -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<Unimplemented>: sub foo { ... } @@ -828,23 +825,7 @@ with the text C<Unimplemented>: Unimplemented at <file> line <line number>. -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 <file> line <line number>. - -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 <file> line <line number>. - Why are you here? +It takes no argument. =head2 List Operators (Rightward) X<operator, list, rightward> X<list operator> diff --git a/t/op/yadayada.t b/t/op/yadayada.t index deca46c789..f82aa72537 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; @@ -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 == '?') { |