-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A previous commit put the number of lines in a here-doc in a separ- ate parser field, which was added on to the line number at the next CopLINE_inc (actually COPLINE_INC_WITH_HERELINES, now used through- out toke.c). Code interpolated inside the here-doc was picking up that value, throwing line numbers off. Before that, they were already off by one. This commit fixes both. I removed the CLINE from S_scan_heredoc and stopped using TERM (which uses CLINE) for here-docs. CLINE sets PL_copline, which is used to pass a specific line number to newSTATEOP, which may or may not be the same number as CopLINE(PL_curcop). newSTATEOP grabs that number and sets PL_copline to -1 (aka NOLINE). I assume this was used to make the statement containing the <<foo marker have the right line number. But it didn’t fully work out, as subsequent statements on the same line had the wrong number. That I fixed a few commits ago when I introduced herelines, making CopLINE(PL_curcop) have the right line number for that line. So the CLINE is not actually necessary anymore. It was causing a problem also with the first statement inside the heredoc (in ${...}), which would ‘steal’ the line number of the <<foo marker. This also means that <FH> and <.*> no longer do CLINE, but it is not necessary, as they cannot span multiple lines.
- Loading branch information
Father Chrysostomos
committed
Aug 28, 2012
1 parent
4b1709c
commit 78a635d
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters