diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-26 17:51:37 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-27 23:23:59 -0700 |
commit | 83944c0156f447aea25d07bd3a03bc58fa93f849 (patch) | |
tree | 24a3d5d5d3641940c3af79b31e84ff8d1dcc7afe /parser.h | |
parent | 61dad979a56eaefa315dbe8b01c52f0cb2723105 (diff) | |
download | perl-83944c0156f447aea25d07bd3a03bc58fa93f849.tar.gz |
[perl #114070] Fix lines nums after <<foo
The line numbers for operators after a here-doc marker on the same
line were off by the length of the here-doc.
This is because the here-doc parser would artificially increase the
line number as it went, because it was stealing lines out of the
input stream.
Instead, we can record the number of lines in the here-doc, and add it
to the line number the next time we need to increment it.
This also fixes the line numbers after s//<<END/e to the end of the
file, which were off because the line number adjusted by the <<END was
localised to the s///.
Since herelines is visible to inner lexing scopes, the outer lexing
scope can see changes made by the inner one.
The lack of localisation does cause problems with line numbers inside
quote-like operators (but they were off by one already), which will be
addressed in subsequent commits.
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -108,6 +108,7 @@ typedef struct yy_parser { COP *saved_curcop; /* the previous PL_curcop */ char tokenbuf[256]; + line_t herelines; /* number of lines in here-doc */ U8 lex_fakeeof; /* precedence at which to fake EOF */ U8 lex_flags; PERL_BITFIELD16 in_pod:1; /* lexer is within a =pod section */ |