summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1997-11-11 00:26:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>1997-11-11 00:26:09 +0000
commit6e7b23362bbae8d13123bf406d494975427fd06f (patch)
tree416e4b4f80936166e79b7eaba94d4a053074f184 /toke.c
parent49dc05e34e370524b8b4de5368e27314830b2308 (diff)
downloadperl-6e7b23362bbae8d13123bf406d494975427fd06f.tar.gz
"weak" lock keyword (hardcoded initial implementation) now works.
if not defined(&Thread::join) and defined(&__PACKAGE__::lock), 'lock' is recognized as a sub, a regular keyword otherwise. Could be generalized by storing a flag for every op in OP struct, and turning the flag off when Thread.xs loads. p4raw-id: //depot/win32/perl@225
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index df5e0eb7fb..07a1656372 100644
--- a/toke.c
+++ b/toke.c
@@ -2603,7 +2603,13 @@ yylex()
(gv = *gvp) != (GV*)&sv_undef &&
GvCVu(gv) && GvIMPORTED_CV(gv))))
{
- tmp = 0;
+ tmp = 0; /* overridden by importation */
+ }
+ else if (gv && !gvp
+ && -tmp==KEY_lock /* XXX generalizable kludge */
+ && !gv_fetchpv("Thread::join",FALSE,SVt_PVCV))
+ {
+ tmp = 0; /* any sub overrides "weak" keyword */
}
else {
tmp = -tmp; gv = Nullgv; gvp = 0;