summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-06 23:35:15 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:44:58 -0700
commit73f3e22850d9df38d36bbb15f00ded7dcce63f27 (patch)
tree116c39f147455858e09a704f7d39e6400c33c848 /perly.y
parent4ab466d9a0c010c94b6aec7b9569c75ded3acfb4 (diff)
downloadperl-73f3e22850d9df38d36bbb15f00ded7dcce63f27.tar.gz
Look up state subs in the pad
This commit does just enough to get things compiling. The padcv op is still unimplemented (in fact, converting the padany to a padcv is still not done), so you can’t actually run the code yet. Bareword lookup in yylex now produces PRIVATEREF tokens for state subs, so the grammar has been adjusted to accept a ‘subname’ in sub calls (PRIVATEREF or WORD) where previously only a WORD was permitted.
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/perly.y b/perly.y
index 72065cf638..0b94075386 100644
--- a/perly.y
+++ b/perly.y
@@ -1108,7 +1108,7 @@ termdo : DO term %prec UNIOP /* do $filename */
{ $$ = newUNOP(OP_NULL, OPf_SPECIAL, op_scope($2));
TOKEN_GETMAD($1,$$,'D');
}
- | DO WORD '(' ')' /* do somesub() */
+ | DO subname '(' ')' /* do somesub() */
{ $$ = newUNOP(OP_ENTERSUB,
OPf_SPECIAL|OPf_STACKED,
op_prepend_elem(OP_LIST,
@@ -1120,7 +1120,7 @@ termdo : DO term %prec UNIOP /* do $filename */
TOKEN_GETMAD($3,$$,'(');
TOKEN_GETMAD($4,$$,')');
}
- | DO WORD '(' expr ')' /* do somesub(@args) */
+ | DO subname '(' expr ')' /* do somesub(@args) */
{ $$ = newUNOP(OP_ENTERSUB,
OPf_SPECIAL|OPf_STACKED,
op_append_elem(OP_LIST,
@@ -1238,7 +1238,7 @@ term : termbinop
token_getmad($4,op,')');
})
}
- | NOAMP WORD optlistexpr /* foo(@args) */
+ | NOAMP subname optlistexpr /* foo(@args) */
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
op_append_elem(OP_LIST, $3, scalar($2)));
TOKEN_GETMAD($1,$$,'o');