diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-14 04:16:51 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-14 04:16:51 +0000 |
commit | f472eb5c07ed95306a11c98250bda17aae994339 (patch) | |
tree | ec0f98c535a7112418134f68146d78b4344ec604 /toke.c | |
parent | 192587c2153e5b0fa4ed545cdd3fa7fef8fc0d8b (diff) | |
download | perl-f472eb5c07ed95306a11c98250bda17aae994339.tar.gz |
nailed "our" declarations, and better warnings on duplicate
"our" declarations
p4raw-id: //depot/perl@4801
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -2015,15 +2015,19 @@ Perl_yylex(pTHX) } #endif /* USE_THREADS */ if ((tmp = pad_findmy(PL_tokenbuf)) != NOT_IN_PAD) { + SV *namesv = AvARRAY(PL_comppad_name)[tmp]; /* might be an "our" variable" */ - if (SvFLAGS(AvARRAY(PL_comppad_name)[tmp]) & SVpad_OUR) { + if (SvFLAGS(namesv) & SVpad_OUR) { /* build ops for a bareword */ - yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(PL_tokenbuf+1, 0)); + SV *sym = newSVpv(HvNAME(GvSTASH(namesv)),0); + sv_catpvn(sym, "::", 2); + sv_catpv(sym, PL_tokenbuf+1); + yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym); yylval.opval->op_private = OPpCONST_ENTERED; - gv_fetchpv(PL_tokenbuf+1, + gv_fetchpv(SvPVX(sym), (PL_in_eval - ? (GV_ADDMULTI | GV_ADDINEVAL | GV_ADDOUR) - : GV_ADDOUR + ? (GV_ADDMULTI | GV_ADDINEVAL) + : TRUE ), ((PL_tokenbuf[0] == '$') ? SVt_PV : (PL_tokenbuf[0] == '@') ? SVt_PVAV |