projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5a71f3
)
fix line renumbering bug in C<eval qq[#line 10 "X"\nwarn]>
author
Gurusamy Sarathy
<gsar@cpan.org>
Fri, 28 Apr 2000 18:17:07 +0000
(18:17 +0000)
committer
Gurusamy Sarathy
<gsar@cpan.org>
Fri, 28 Apr 2000 18:17:07 +0000
(18:17 +0000)
p4raw-id: //depot/perl@5999
t/pragma/warn/toke
patch
|
blob
|
history
toke.c
patch
|
blob
|
history
diff --git
a/t/pragma/warn/toke
b/t/pragma/warn/toke
index
f001ff7
..
8db8027
100644
(file)
--- 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
(file)
--- 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++;