diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-01 00:18:52 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-01 00:18:52 +0000 |
commit | af702f0e61214b54e323d12ffeaff4e64bee707c (patch) | |
tree | 2c9b5734fbd3c421d2d20c9e6877c8d10957e47c /toke.c | |
parent | f890e7c81bc0e52bedc3dcefbcd144d0750c257d (diff) | |
parent | a863c7d16499251f020c5d26d232aa865fa0b197 (diff) | |
download | perl-af702f0e61214b54e323d12ffeaff4e64bee707c.tar.gz |
Integrate mainline @ 18:15 CST 31 Oct 1997
p4raw-id: //depot/ansiperl@199
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 46 |
1 files changed, 28 insertions, 18 deletions
@@ -1225,27 +1225,37 @@ yylex(void) return PRIVATEREF; } - if (!strchr(tokenbuf,':') - && (tmp = pad_findmy(tokenbuf)) != NOT_IN_PAD) { - if (last_lop_op == OP_SORT && - tokenbuf[0] == '$' && - (tokenbuf[1] == 'a' || tokenbuf[1] == 'b') - && !tokenbuf[2]) - { - for (d = in_eval ? oldoldbufptr : linestart; - d < bufend && *d != '\n'; - d++) + if (!strchr(tokenbuf,':')) { +#ifdef USE_THREADS + /* Check for single character per-thread magicals */ + if (tokenbuf[0] == '$' && tokenbuf[2] == '\0' + && (tmp = find_thread_magical(&tokenbuf[1])) != NOT_IN_PAD) { + yylval.opval = newOP(OP_SPECIFIC, 0); + yylval.opval->op_targ = tmp; + return PRIVATEREF; + } +#endif /* USE_THREADS */ + if ((tmp = pad_findmy(tokenbuf)) != NOT_IN_PAD) { + if (last_lop_op == OP_SORT && + tokenbuf[0] == '$' && + (tokenbuf[1] == 'a' || tokenbuf[1] == 'b') + && !tokenbuf[2]) { - if (strnEQ(d,"<=>",3) || strnEQ(d,"cmp",3)) { - croak("Can't use \"my %s\" in sort comparison", - tokenbuf); + for (d = in_eval ? oldoldbufptr : linestart; + d < bufend && *d != '\n'; + d++) + { + if (strnEQ(d,"<=>",3) || strnEQ(d,"cmp",3)) { + croak("Can't use \"my %s\" in sort comparison", + tokenbuf); + } } } - } - yylval.opval = newOP(OP_PADANY, 0); - yylval.opval->op_targ = tmp; - return PRIVATEREF; + yylval.opval = newOP(OP_PADANY, 0); + yylval.opval->op_targ = tmp; + return PRIVATEREF; + } } /* Force them to make up their mind on "@foo". */ @@ -5352,7 +5362,7 @@ yyerror(char *s) if (in_eval & 2) warn("%_", msg); else if (in_eval) - sv_catsv(GvSV(errgv), msg); + sv_catsv(errsv, msg); else PerlIO_write(PerlIO_stderr(), SvPVX(msg), SvCUR(msg)); if (++error_count >= 10) |