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:
Akim Demaille
2019-02-10 15:06:46 +01:00
parent ad7d8af6d1
commit 30f61b0549
2 changed files with 7 additions and 7 deletions

View File

@@ -59,12 +59,8 @@ EXTRA_DIST += %D%/extracted.stamp
dist-hook: examples-unline
.PHONY: examples-unline
examples-unline:
for e in $(extracted); \
do \
e=$(distdir)/$$e; \
sed -e '/#line/d' $$e >$$e.tmp; \
mv -f $$e.tmp $$e; \
done
cd $(distdir) && \
perl -pi -0777 -e 's/#line.*\n//g;s{^ /\*\*/\n}{}mg' $(extracted)
## ---------- ##