Trailing end-of-lines in %parse-param or %lex-param would result in
invalid C++. This is fixed.
+** Spurious spaces and end-of-lines
+
+ The generated files no longer end (nor start) with empty lines.
+
* Noteworthy changes in release 2.6.1 (2012-07-30) [stable]
Bison no longer executes user-specified M4 code when processing a grammar.
prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$ \
prohibit_always-defined_macros+=?|^tests/regression.at$$ \
prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
- prohibit_empty_lines_at_EOF=^src/parse-gram.[ch]$$ \
prohibit_magic_number_exit=^doc/bison.texi$$ \
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
YYFPRINTF (stderr, "\n");
}
#endif
-]
-
-b4_epilogue
+]b4_epilogue[]dnl
dnl
dnl glr.cc produces its own header.
dnl
]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[
]b4_cpp_guard_close([b4_spec_defines_file])[
-]])])
+]])])dnl
m4_divert_pop(0)
#endif
]m4_popdef([b4_parse_param])dnl
-b4_namespace_close[
-
-]])
+b4_namespace_close])
# Let glr.c believe that the user arguments include the parser itself.
const ]b4_parser_class_name[::token_number_type ]b4_parser_class_name[::yyundef_token_ = ]b4_undef_token_number[;
]b4_namespace_close[
-]b4_epilogue
+]b4_epilogue[]dnl
m4_divert_pop(0)
}
-]b4_epilogue
+]b4_epilogue[]dnl
b4_defines_if(
[@output(b4_spec_defines_file@)@
b4_copyright([Bison interface for Yacc-like parsers in C],
-/* A Bison parser, made by GNU Bison 2.6.1.6-b045. */
+/* A Bison parser, made by GNU Bison 2.6.1.12-3153-dirty. */
/* Bison implementation for Yacc-like parsers in C
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.6.1.6-b045"
+#define YYBISON_VERSION "2.6.1.12-3153-dirty"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
return quotearg_style (escape_quoting_style, buf);
}
}
-
-/* A Bison parser, made by GNU Bison 2.6.1.6-b045. */
+/* A Bison parser, made by GNU Bison 2.6.1.12-3153-dirty. */
/* Bison interface for Yacc-like parsers in C
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]])["
])
+# 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
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],