yacc: remove trailing end of line at end of file

There are still spurious spaces at the end of some lines.  But this is
addressed in the master branch, and I am reluctant to try to backport
this.

* data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: here.
* tests/calc.at (AT_CHECK_SPACES): New.
Use it.
Be sure not to introduce trailing empty lines in the *.y files.
* NEWS: Doc it.
* cfg.mk (syntax-check): Remove the exception.
This commit is contained in:
Akim Demaille
2012-08-02 12:01:54 +02:00
parent 62a58c14bd
commit dcd5344dcd
9 changed files with 29 additions and 17 deletions

View File

@@ -386,11 +386,9 @@ AT_YYERROR_SEES_LOC_IF([
fprintf (stderr, ": ");])
fprintf (stderr, "%s\n", s);
}])[
]AT_DEFINES_IF([],
[AT_CALC_LEX
AT_CALC_MAIN])[
]])
AT_CALC_MAIN])])
AT_DEFINES_IF([AT_DATA_SOURCE([[calc-lex.c]AT_SKEL_CC_IF([[c]])],
[[#include "calc.h]AT_SKEL_CC_IF([[h]])["
@@ -500,6 +498,20 @@ AT_CHECK([cat stderr], 0, [expout])
])
# AT_CHECK_SPACES([FILE])
# -----------------------
# Make sure we did not introduce bad spaces. Checked here because all
# the skeletons are (or should be) exercized here.
m4_define([AT_CHECK_SPACES],
[# No initial empty lines.
AT_CHECK([sed -ne '/./q;=;p;' $1])
# No trailing spaces.
# FIXME: For 2.7: AT_CHECK([sed -ne '/[ ]$/{=;p;}' $1])
# No final empty lines.
AT_CHECK([sed -ne '${/^$/{=;p;};}' $1])
])
# AT_CHECK_CALC([BISON-OPTIONS])
# ------------------------------
# Start a testing chunk which compiles `calc' grammar with
@@ -514,6 +526,8 @@ AT_BISON_OPTION_PUSHDEFS([$1])
AT_DATA_CALC_Y([$1])
AT_FULL_COMPILE([calc], AT_DEFINES_IF([[lex], [main]]))
AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([cc], [c])])
AT_DEFINES_IF([AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([hh], [h])])])
# Test the priorities.
_AT_CHECK_CALC([$1],