summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-01-25 09:15:46 +0100
committerAkim Demaille <akim.demaille@gmail.com>2020-01-26 13:29:19 +0100
commit0917f4dc7603d9f41e362c9b0bac806b5b5e8b0d (patch)
treede171489808f64075bcf90a37c863d02ba20fdbb /tests
parent0f792833c27cac71d64ed1fa9d7a209480da26f4 (diff)
downloadbison-0917f4dc7603d9f41e362c9b0bac806b5b5e8b0d.tar.gz
tests: check custom error messages and push parsers
* tests/local.at (AT_LAC_IF): New. * tests/calc.at: And also check the suppot for LAC.
Diffstat (limited to 'tests')
-rw-r--r--tests/calc.at8
-rw-r--r--tests/local.at3
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/calc.at b/tests/calc.at
index 81b783c4..074bd90a 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -726,7 +726,9 @@ _AT_CHECK_CALC_ERROR([$1], [1], [error],
_AT_CHECK_CALC_ERROR([$1], [1], [1 = 2 = 3],
[[final: 0 0 1]],
[30],
- [[1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])]])
+ [AT_LAC_IF(
+ [[1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])]],
+ [[1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])]])])
_AT_CHECK_CALC_ERROR([$1], [1],
[
+1],
@@ -844,6 +846,8 @@ AT_CHECK_CALC_LALR([%no-lines %define api.pure %define parse.error verbose %debu
AT_CHECK_CALC_LALR([%define parse.error custom])
AT_CHECK_CALC_LALR([%define parse.error custom %locations %define api.prefix {calc}])
AT_CHECK_CALC_LALR([%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs}])
+AT_CHECK_CALC_LALR([%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} %define api.push-pull both %define api.pure full])
+AT_CHECK_CALC_LALR([%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} %define api.push-pull both %define api.pure full %define parse.lac full])
# ----------------------- #
# Simple GLR Calculator. #
@@ -925,6 +929,8 @@ AT_CHECK_CALC_LALR1_CC([%defines %locations %define api.location.file "my-locati
AT_CHECK_CALC_LALR1_CC([%no-lines %defines %locations %define api.location.file "my-location.hh"])
+AT_CHECK_CALC_LALR1_CC([%locations %define parse.lac full %define parse.error verbose])
+
# --------------------------- #
# Simple GLR C++ Calculator. #
diff --git a/tests/local.at b/tests/local.at
index 9c32bc4b..8fc9a1d6 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -235,6 +235,8 @@ m4_pushdef([AT_GLR_CC_IF],
# Using yacc.c?
m4_pushdef([AT_YACC_IF],
[m4_bmatch([$3], [%language\|%glr-parser\|%skeleton], [$2], [$1])])
+m4_pushdef([AT_LAC_IF],
+[m4_bmatch([$3], [%define parse.lac full], [$1], [$2])])
m4_pushdef([AT_LEXPARAM_IF],
[m4_bmatch([$3], [%lex-param], [$1], [$2])])
m4_pushdef([AT_LOCATION_IF],
@@ -409,6 +411,7 @@ m4_popdef([AT_PUSH_IF])
m4_popdef([AT_PURE_IF])
m4_popdef([AT_PARAM_IF])
m4_popdef([AT_LEXPARAM_IF])
+m4_popdef([AT_LAC_IF])
m4_popdef([AT_YACC_IF])
m4_popdef([AT_GLR_IF])
m4_popdef([AT_CXX_IF])