summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 23:52:35 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1997-11-07 23:52:35 +0000
commitaeea060ce4b653ecf5b0731f1cbfcf468f688acd (patch)
tree071ed1fbe63cb80bbddce550bd8c0b9942527b3f /toke.c
parente77eedc24c0252a902559034f2aa207f216529cc (diff)
downloadperl-aeea060ce4b653ecf5b0731f1cbfcf468f688acd.tar.gz
Reverse integrate Malcolm's chanes into local
repository, then import result back into my view of Malcolm's repository. Builds and passes (most) tests with GNU C++/Solaris and Borland C++, Win32. p4raw-id: //depot/ansiperl@210
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/toke.c b/toke.c
index f1b59003c7..b92edd3285 100644
--- a/toke.c
+++ b/toke.c
@@ -1243,16 +1243,21 @@ yylex(void)
(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". */
@@ -5365,7 +5370,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)