Closed taniwha closed 9 months ago
This should have a test case to detect regression in the future. Is that someting you're able to add?
Sure, I'll look into that.
Done. I covered as many places as I could think of, and I verified that it does catch the incorrect lines before the patch.
What do you think about having the lexer be generated from something that e.g. grep -n 's the line numbers so that changing the source is less prone to break the test?
Oh, hmm, I hadn't thought of that. Interesting idea. I'll see what I can come up with, but generation certainly makes sense.
I came up with something that works nicely so long as the two (@LINE@
and __LINE__
) are on the same line.
@westes are there any further issues?
This looks great; thank you!
An indented code block would cause the subsequent all subsequent code block line numbers (including its own) to be out by one.
For example, the following would cause the line number for the
BEGIN
code block to have the line number for thewarning
code block. This would also affect the code in the final section after the second%%
.