From: Gurusamy Sarathy Date: Fri, 28 Apr 2000 18:17:07 +0000 (+0000) Subject: fix line renumbering bug in C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df0deb90068dea6e06bd6632928a2926975901ce;p=p5sagit%2Fp5-mst-13.2.git fix line renumbering bug in C p4raw-id: //depot/perl@5999 --- diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index f001ff7..8db8027 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -437,13 +437,14 @@ Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. # toke.c use warnings ; eval <<'EOE'; +# line 30 "foo" +warn "yelp"; { -#line 30 "foo" $_ = " \x{123} " ; } EOE EXPECT - +yelp at foo line 30. ######## # toke.c my $a = rand + 4 ; diff --git a/toke.c b/toke.c index 5c1b945..737c9ae 100644 --- a/toke.c +++ b/toke.c @@ -2656,6 +2656,11 @@ Perl_yylex(pTHX) case '#': case '\n': if (PL_lex_state != LEX_NORMAL || (PL_in_eval && !PL_rsfp)) { + if (*s == '#' && s == PL_linestart && PL_in_eval && !PL_rsfp) { + /* handle eval qq[#line 1 "foo"\n ...] */ + CopLINE_dec(PL_curcop); + incline(s); + } d = PL_bufend; while (s < d && *s != '\n') s++;