m4_pushdef([AT_LOCATION_IF],
[m4_bmatch([$3], [%locations], [$1], [$2])])
m4_pushdef([AT_PURE_IF],
-[m4_bmatch([$3], [%pure-parser], [$1], [$2])])
+[m4_bmatch([$3], [%define *api\.pure\|%pure-parser],
+ [m4_bmatch([$3], [%define *api\.pure *"false"], [$2], [$1])],
+ [$2])])
m4_pushdef([AT_PURE_AND_LOC_IF],
-[m4_bmatch([$3], [%locations.*%pure-parser\|%pure-parser.*%locations],
- [$1], [$2])])
+[m4_bmatch([$3], [%locations], [AT_PURE_IF($@)], [$2])])
m4_pushdef([AT_GLR_OR_PARAM_IF],
[m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
m4_pushdef([AT_NAME_PREFIX],
[$1])],
[$2])])
-# The interface is pure: either because %pure-parser, or because we
+# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.
m4_pushdef([AT_PURE_LEX_IF],
[AT_PURE_IF([$1],