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
gv.c, gv_fetchpvn_flags: Comments for when the glob already exists.
[perl5.git]
/
perly.y
diff --git
a/perly.y
b/perly.y
index
463e3da
..
0f98f59
100644
(file)
--- a/
perly.y
+++ b/
perly.y
@@
-276,15
+276,17
@@
fullstmt: barestmt
labfullstmt: LABEL barestmt
{
labfullstmt: LABEL barestmt
{
- $$ = newSTATEOP(SvUTF8(((SVOP*)$1)->op_sv),
- savepv(SvPVX(((SVOP*)$1)->op_sv)), $2);
+ $$ = newSTATEOP(SVf_UTF8
+ * PVAL($1)[strlen(PVAL($1))+1],
+ PVAL($1), $2);
TOKEN_GETMAD($1,
$2 ? cLISTOPx($$)->op_first : $$, 'L');
}
| LABEL labfullstmt
{
TOKEN_GETMAD($1,
$2 ? cLISTOPx($$)->op_first : $$, 'L');
}
| LABEL labfullstmt
{
- $$ = newSTATEOP(SvUTF8(((SVOP*)$1)->op_sv),
- savepv(SvPVX(((SVOP*)$1)->op_sv)), $2);
+ $$ = newSTATEOP(SVf_UTF8
+ * PVAL($1)[strlen(PVAL($1))+1],
+ PVAL($1), $2);
TOKEN_GETMAD($1, cLISTOPx($$)->op_first, 'L');
}
;
TOKEN_GETMAD($1, cLISTOPx($$)->op_first, 'L');
}
;
@@
-997,7
+999,7
@@
termbinop: term ASSIGNOP term /* $x = $y */
op = (UNOP*)op->op_first; /* get to flip */
op = (UNOP*)op->op_first; /* get to range */
token_getmad($2,(OP*)op,'o');
op = (UNOP*)op->op_first; /* get to flip */
op = (UNOP*)op->op_first; /* get to range */
token_getmad($2,(OP*)op,'o');
- })
+ })
;
}
| term ANDAND term /* $x && $y */
{ $$ = newLOGOP(OP_AND, 0, $1, $3);
}
| term ANDAND term /* $x && $y */
{ $$ = newLOGOP(OP_AND, 0, $1, $3);
@@
-1217,12
+1219,12
@@
term : termbinop
{ $$ = $1; }
| amper /* &foo; */
{ $$ = newUNOP(OP_ENTERSUB, 0, scalar($1)); }
{ $$ = $1; }
| amper /* &foo; */
{ $$ = newUNOP(OP_ENTERSUB, 0, scalar($1)); }
- | amper '(' ')' /* &foo() */
+ | amper '(' ')' /* &foo()
or foo()
*/
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar($1));
TOKEN_GETMAD($2,$$,'(');
TOKEN_GETMAD($3,$$,')');
}
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar($1));
TOKEN_GETMAD($2,$$,'(');
TOKEN_GETMAD($3,$$,')');
}
- | amper '(' expr ')'
/* &
foo(@args) */
+ | amper '(' expr ')'
/* &foo(@args) or
foo(@args) */
{
$$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $3, scalar($1)));
{
$$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $3, scalar($1)));
@@
-1233,9
+1235,9
@@
term : termbinop
}
token_getmad($2,op,'(');
token_getmad($4,op,')');
}
token_getmad($2,op,'(');
token_getmad($4,op,')');
- })
+ })
;
}
}
- | NOAMP subname optlistexpr
/* foo(@arg
s) */
+ | NOAMP subname optlistexpr
/* foo @args (no paren
s) */
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $3, scalar($2)));
TOKEN_GETMAD($1,$$,'o');
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $3, scalar($2)));
TOKEN_GETMAD($1,$$,'o');
@@
-1347,7
+1349,7
@@
myattrterm: MY myterm myattrlist
token_getmad($1,$$,'d');
append_madprops($3->op_madprop, $$, 'a');
$3->op_madprop = 0;
token_getmad($1,$$,'d');
append_madprops($3->op_madprop, $$, 'a');
$3->op_madprop = 0;
- )
+ )
;
}
| MY myterm
{ $$ = localize($2,IVAL($1));
}
| MY myterm
{ $$ = localize($2,IVAL($1));