X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/bcabcc50f85300b3fbf720ece84c2fd14bd909ed..ce0e211a90da72f1344099dc2e538e0b466a3641:/perly.y diff --git a/perly.y b/perly.y index ad7b552..aad4dd7 100644 --- a/perly.y +++ b/perly.y @@ -1,6 +1,7 @@ /* perly.y * * Copyright (c) 1991-2002, 2003, 2004, 2005, 2006 Larry Wall + * Copyright (c) 2007, 2008 by Larry Wall and others * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -9,8 +10,12 @@ /* * 'I see,' laughed Strider. 'I look foul and feel fair. Is that it? - * All that is gold does not glitter, not all those who wander are lost.' + * All that is gold does not glitter, not all those who wander are lost.' * + * [p.171 of _The Lord of the Rings_, I/x: "Strider"] + */ + +/* * This file holds the grammar for the Perl language. If edited, you need * to run regen_perly.pl, which re-creates the files perly.h, perly.tab * and perly.act which are derived from this. @@ -72,7 +77,7 @@ %token FORMAT SUB ANONSUB PACKAGE USE %token WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR %token GIVEN WHEN DEFAULT -%token LOOPEX DOTDOT +%token LOOPEX DOTDOT YADAYADA %token FUNC0 FUNC1 FUNC UNIOP LSTOP %token RELOP EQOP MULOP ADDOP %token DOLSHARP DO HASHBRACK NOAMP @@ -106,7 +111,7 @@ %left ',' %right ASSIGNOP %right '?' ':' -%nonassoc DOTDOT +%nonassoc DOTDOT YADAYADA %left OROR DORDOR %left ANDAND %left BITOROP @@ -275,7 +280,7 @@ else : /* NULL */ } | ELSIF '(' mexpr ')' mblock else { PL_parser->copline = (line_t)IVAL($1); - $$ = newCONDOP(0, $3, scope($5), $6); + $$ = newCONDOP(0, newSTATEOP(OPf_SPECIAL,NULL,$3), scope($5), $6); PL_hints |= HINT_BLOCK_SCOPE; TOKEN_GETMAD($1,$$,'I'); TOKEN_GETMAD($2,$$,'('); @@ -1227,6 +1232,11 @@ term : termbinop } | WORD | listop + | YADAYADA + { + $$ = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0), + newSVOP(OP_CONST, 0, newSVpvs("Unimplemented"))); + } ; /* "my" declarations, with optional attributes */