bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tests: check custom error messages and push parsers


From: Akim Demaille
Subject: tests: check custom error messages and push parsers
Date: Mon, 27 Jan 2020 06:32:00 +0100

commit 0917f4dc7603d9f41e362c9b0bac806b5b5e8b0d
Author: Akim Demaille <address@hidden>
Date:   Sat Jan 25 09:15:46 2020 +0100

    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.

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])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]