# AT_SETUP_STRIP(TITLE)
# ---------------------
-# Abbreviate the TITLE to be passed to AT_SETUP.
+# Abbreviate the TITLE to be passed to AT_SETUP. Remove new-lines
+# that completely break AT_SETUP.
m4_define([AT_SETUP_STRIP],
[m4_bpatsubsts([$1],
[%\(language\|skeleton\) "?\([^\" ]*\)"?],
[\2],
- [%define "?\([-A-Za-z0-9_.]+\)"? \("\([^\" ]+\)"\|\([-A-Za-z0-9_.]+\)\)],
- [\1=\3\4],
+ [%define "?\([-A-Za-z0-9_.]+\)"? \("[^\"]+"\|[-A-Za-z0-9_.]+\)],
+ [\1=\2],
[%define "?\([-A-Za-z0-9_.]+\)"?],
- [\1])dnl
+ [\1],
+ [ *
++ *], [ ])dnl
])
[m4_bregexp([$3], [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) "\([^""]*\)"], [\3])],
[yy])])
m4_pushdef([AT_TOKEN_CTOR_IF],
-[m4_bmatch([$3], [%define api.token.constructor], [$1], [$2])])
+[m4_bmatch([$3], [%define api\.token\.constructor], [$1], [$2])])
m4_pushdef([AT_TOKEN_PREFIX],
-[m4_bmatch([$3], [%define api.token.prefix ".*"],
- [m4_bregexp([$3], [%define api.token.prefix "\(.*\)"], [\1])])])
+[m4_bmatch([$3], [%define api\.token\.prefix ".*"],
+ [m4_bregexp([$3], [%define api\.token\.prefix "\(.*\)"], [\1])])])
+m4_pushdef([AT_VARIANT_IF],
+[m4_bmatch([$3], [%define api\.value\.type "?variant"?], [$1], [$2])])
m4_pushdef([AT_API_prefix],
[m4_bmatch([$3], [%define api\.prefix ".*"],
[m4_bregexp([$3], [%define api\.prefix "\([^""]*\)"], [\1])],
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
[AT_LOCATION_IF([AT_PURE_IF([m4_bmatch([$3],
m4_quote(m4_join([\|],
- [%define api.pure "?full"?],
+ [%define api\.pure "?full"?],
[%glr-parser],
[%parse-param],
[%skeleton "?glr.c"?])),
m4_popdef([AT_YYERROR_ARG_LOC_IF])
m4_popdef([AT_API_PREFIX])
m4_popdef([AT_API_prefix])
+m4_popdef([AT_VARIANT_IF])
m4_popdef([AT_TOKEN_PREFIX])
m4_popdef([AT_TOKEN_CTOR_IF])
m4_popdef([AT_NAME_PREFIX])
[java],
[AT_BISON_CHECK([-o $1.java $1.y])
AT_LANG_COMPILE([$1],
- m4_join([ ],
- [$1.java],
- m4_ifval($2, [[$1-$2.java]]),
+ m4_join([ ],
+ [$1.java],
+ m4_ifval($2, [[$1-$2.java]]),
m4_ifval($3, [[$1-$3.java]])))],
[c++],
[AT_BISON_CHECK([-o $1.cc $1.y])
AT_LANG_COMPILE([$1],
- m4_join([ ],
- [$1.cc],
- m4_ifval($2, [[$1-$2.cc]]),
+ m4_join([ ],
+ [$1.cc],
+ m4_ifval($2, [[$1-$2.cc]]),
m4_ifval($3, [[$1-$3.cc]])))],
[c],
[AT_BISON_CHECK([-o $1.c $1.y])
AT_LANG_COMPILE([$1],
- m4_join([ ],
- [$1.c],
- m4_ifval($2, [[$1-$2.c]]),
+ m4_join([ ],
+ [$1.c],
+ m4_ifval($2, [[$1-$2.c]]),
m4_ifval($3, [[$1-$3.c]])))])
])
m4_if(m4_index(m4_quote($3), [no-xml]), -1,
[AT_BISON_CHECK],
- [AT_BISON_CHECK_NO_XML])([[--report=all --defines -o input.c input.y]],
+ [AT_BISON_CHECK_NO_XML])([[-Wall --report=all --defines -o input.c input.y]],
[0], [], m4_dquote($7))
m4_if(m4_index(m4_quote($3), [last-state]), -1,
# There is no "" around `wc` since some indent the result.
m4_bmatch([$4], [%define lr.type canonical-lr],
[if test 32767 -lt `wc -l < input.c`; then
- CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
- CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
+ CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
+ CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
fi])
AT_COMPILE([[input]])