mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
examples: fix annoying off-by-one errors
* examples/extexi: Since we issue #lines only at the beginning of @example, leave empty line when removing content (such as @comment lines), otherwise the lines that follow have incorrect source line location. This leaves ugly empty lines, but they are removed when you tidy the output for the end user: sequences of \n are mapped to at most two sucessive \n.
This commit is contained in:
@@ -60,7 +60,11 @@ sub normalize($)
|
||||
{
|
||||
local ($_) = @_;
|
||||
|
||||
s/^\@(c |comment|dots|end (ignore|group)|ignore|group).*\n//mg;
|
||||
# If we just remove this lines, then the compiler's tracking of
|
||||
# #lines is broken. Leave lines that that accepted by all our tools
|
||||
# (including flex, hence the leading space), and that will be easy
|
||||
# to remove (see the Make examples-unline recipe).
|
||||
s{^\@(c |comment|dots|end (ignore|group)|ignore|group).*}{ /**/}mg;
|
||||
s/\@value\{VERSION\}/$ENV{VERSION}/g;
|
||||
s/^\@(error|result)\{\}//mg;
|
||||
s/\@([{}@])/$1/g;
|
||||
|
||||
Reference in New Issue
Block a user