no-lines: avoid leaving an empty line instead of the syncline

Currently, with --no-lines, instead of "#line file line\n", we emit
"\n".  Let's emit nothing.

* data/skeletons/bison.m4 (b4_syncline): Emit at end-of-line when enabled.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.cc,
* data/skeletons/lalr1.cc, src/output.c: Use dnl after b4_syncline to
avoid spurious empty lines.

* tests/synclines.at (Sync Lines): Make sure that --no-lines is like
grep -v #line.
* tests/calc.at: Make sure that a rich grammar file behaves properly
with %no-lines.
This commit is contained in:
Akim Demaille
2019-04-01 18:23:20 +02:00
parent 9832fdd6ef
commit 0f193d2d21
11 changed files with 71 additions and 37 deletions

View File

@@ -111,9 +111,9 @@ b4_dollar_pushdef([yysym.value],
[],
[yysym.location])dnl
_b4_symbol_case([$1])[]dnl
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])dnl
b4_symbol([$1], [$2])
b4_syncline([@oline@], [@ofile@])
b4_syncline([@oline@], [@ofile@])dnl
break;
m4_popdef([b4_symbol_value])[]dnl
@@ -412,9 +412,9 @@ b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
]b4_disclaimer[
]b4_cpp_guard_open([b4_spec_header_file])[
]b4_shared_declarations(hh)[
]b4_cpp_guard_close([b4_spec_header_file])
b4_output_end
])
]b4_cpp_guard_close([b4_spec_header_file])[
]b4_output_end[
]])
b4_output_begin([b4_parser_file_name])[