This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated Changes file for Module::CoreList
[perl5.git]
/
perly.y
diff --git
a/perly.y
b/perly.y
index
ad7b552
..
5ec5845
100644
(file)
--- a/
perly.y
+++ b/
perly.y
@@
-1,6
+1,7
@@
/* perly.y
*
* Copyright (c) 1991-2002, 2003, 2004, 2005, 2006 Larry Wall
/* 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.
*
* 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?
/*
* '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.
* 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 <i_tkval> FORMAT SUB ANONSUB PACKAGE USE
%token <i_tkval> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
%token <i_tkval> GIVEN WHEN DEFAULT
%token <i_tkval> FORMAT SUB ANONSUB PACKAGE USE
%token <i_tkval> WHILE UNTIL IF UNLESS ELSE ELSIF CONTINUE FOR
%token <i_tkval> GIVEN WHEN DEFAULT
-%token <i_tkval> LOOPEX DOTDOT
+%token <i_tkval> LOOPEX DOTDOT
YADAYADA
%token <i_tkval> FUNC0 FUNC1 FUNC UNIOP LSTOP
%token <i_tkval> RELOP EQOP MULOP ADDOP
%token <i_tkval> DOLSHARP DO HASHBRACK NOAMP
%token <i_tkval> FUNC0 FUNC1 FUNC UNIOP LSTOP
%token <i_tkval> RELOP EQOP MULOP ADDOP
%token <i_tkval> DOLSHARP DO HASHBRACK NOAMP
@@
-106,7
+111,7
@@
%left <i_tkval> ','
%right <i_tkval> ASSIGNOP
%right <i_tkval> '?' ':'
%left <i_tkval> ','
%right <i_tkval> ASSIGNOP
%right <i_tkval> '?' ':'
-%nonassoc DOTDOT
+%nonassoc DOTDOT
YADAYADA
%left <i_tkval> OROR DORDOR
%left <i_tkval> ANDAND
%left <i_tkval> BITOROP
%left <i_tkval> OROR DORDOR
%left <i_tkval> ANDAND
%left <i_tkval> BITOROP
@@
-264,6
+269,8
@@
sideff : error
(OP*)NULL, $3, $1, (OP*)NULL);
TOKEN_GETMAD($2,((LISTOP*)$$)->op_first->op_sibling,'w');
}
(OP*)NULL, $3, $1, (OP*)NULL);
TOKEN_GETMAD($2,((LISTOP*)$$)->op_first->op_sibling,'w');
}
+ | expr WHEN expr
+ { $$ = newWHENOP($3, scope($1)); }
;
/* else and elsif blocks */
;
/* else and elsif blocks */
@@
-275,7
+282,7
@@
else : /* NULL */
}
| ELSIF '(' mexpr ')' mblock else
{ PL_parser->copline = (line_t)IVAL($1);
}
| 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,$$,'(');
PL_hints |= HINT_BLOCK_SCOPE;
TOKEN_GETMAD($1,$$,'I');
TOKEN_GETMAD($2,$$,'(');
@@
-626,14
+633,18
@@
subbody : block { $$ = $1; }
}
;
}
;
-package : PACKAGE WORD ';'
+package : PACKAGE WORD
WORD
';'
{
#ifdef MAD
{
#ifdef MAD
- $$ = package($
2
);
+ $$ = package($
3
);
token_getmad($1,$$,'o');
token_getmad($1,$$,'o');
- token_getmad($3,$$,';');
+ if ($2)
+ package_version($2);
+ token_getmad($4,$$,';');
#else
#else
- package($2);
+ package($3);
+ if ($2)
+ package_version($2);
$$ = (OP*)NULL;
#endif
}
$$ = (OP*)NULL;
#endif
}
@@
-649,7
+660,7
@@
use : USE startsub
token_getmad($7,$$,';');
if (PL_parser->rsfp_filters &&
AvFILLp(PL_parser->rsfp_filters) >= 0)
token_getmad($7,$$,';');
if (PL_parser->rsfp_filters &&
AvFILLp(PL_parser->rsfp_filters) >= 0)
- append_madprops(newMADPROP('!', MAD_
PV, ""
, 0), $$, 0);
+ append_madprops(newMADPROP('!', MAD_
NULL, NULL
, 0), $$, 0);
#else
utilize(IVAL($1), $2, $4, $5, $6);
$$ = (OP*)NULL;
#else
utilize(IVAL($1), $2, $4, $5, $6);
$$ = (OP*)NULL;
@@
-1227,6
+1238,12
@@
term : termbinop
}
| WORD
| listop
}
| WORD
| listop
+ | YADAYADA
+ {
+ $$ = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
+ newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
+ TOKEN_GETMAD($1,$$,'X');
+ }
;
/* "my" declarations, with optional attributes */
;
/* "my" declarations, with optional attributes */