mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
* tests/calc.at: Change all the AT_CHECK_CALC_LALR and
AT_CHECK_CALC_GLR invocations to use % directives, instead of command line options. * tests/cxx-type.at: Formatting changes.
This commit is contained in:
@@ -323,8 +323,7 @@ main (int argc, const char **argv)
|
||||
# -------------------------------
|
||||
# Produce `calc.y'.
|
||||
m4_define([AT_DATA_CALC_Y],
|
||||
[_AT_DATA_CALC_Y($[1], $[2], $[3],
|
||||
[m4_bpatsubst([$1], [--[^ ]*])])
|
||||
[_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
|
||||
])
|
||||
|
||||
|
||||
@@ -360,7 +359,7 @@ m4_bmatch([$1],
|
||||
# If INPUT starts with a slash, it is used as absolute input file name,
|
||||
# otherwise as contents.
|
||||
#
|
||||
# If BISON-OPTIONS contains `--location', then make sure the ERROR-LOCATION
|
||||
# If BISON-OPTIONS contains `%location', then make sure the ERROR-LOCATION
|
||||
# is correctly output on stderr.
|
||||
#
|
||||
# If BISON-OPTIONS contains `%error-verbose', then make sure the
|
||||
@@ -426,7 +425,7 @@ AT_SETUP([Calculator $1])
|
||||
AT_DATA_CALC_Y([$1])
|
||||
|
||||
# Specify the output files to avoid problems on different file systems.
|
||||
AT_CHECK([bison -o calc.c m4_bpatsubst([$1], [%[^ ]*]) calc.y],
|
||||
AT_CHECK([bison -o calc.c calc.y],
|
||||
[0], [], [])
|
||||
|
||||
AT_COMPILE([calc])
|
||||
@@ -495,22 +494,21 @@ m4_define([AT_CHECK_CALC_LALR],
|
||||
|
||||
AT_CHECK_CALC_LALR()
|
||||
|
||||
AT_CHECK_CALC_LALR([--defines])
|
||||
AT_CHECK_CALC_LALR([%defines])
|
||||
AT_CHECK_CALC_LALR([%locations])
|
||||
AT_CHECK_CALC_LALR([--name-prefix=calc])
|
||||
AT_CHECK_CALC_LALR([--verbose])
|
||||
AT_CHECK_CALC_LALR([--yacc])
|
||||
AT_CHECK_CALC_LALR([%name-prefix="calc"])
|
||||
AT_CHECK_CALC_LALR([%verbose])
|
||||
AT_CHECK_CALC_LALR([%yacc])
|
||||
AT_CHECK_CALC_LALR([%error-verbose])
|
||||
|
||||
AT_CHECK_CALC_LALR([%error-verbose %locations])
|
||||
|
||||
AT_CHECK_CALC_LALR([%error-verbose %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
AT_CHECK_CALC_LALR([%debug])
|
||||
AT_CHECK_CALC_LALR([%error-verbose %debug %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
# FIXME: Not ready yet.
|
||||
# AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
# AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
|
||||
# ----------------------- #
|
||||
@@ -529,18 +527,18 @@ m4_define([AT_CHECK_CALC_GLR],
|
||||
|
||||
AT_CHECK_CALC_GLR()
|
||||
|
||||
AT_CHECK_CALC_GLR([--defines])
|
||||
AT_CHECK_CALC_GLR([%defines])
|
||||
AT_CHECK_CALC_GLR([%locations])
|
||||
AT_CHECK_CALC_GLR([--name-prefix=calc])
|
||||
AT_CHECK_CALC_GLR([--verbose])
|
||||
AT_CHECK_CALC_GLR([--yacc])
|
||||
AT_CHECK_CALC_GLR([%name-prefix="calc"])
|
||||
AT_CHECK_CALC_GLR([%verbose])
|
||||
AT_CHECK_CALC_GLR([%yacc])
|
||||
AT_CHECK_CALC_GLR([%error-verbose])
|
||||
|
||||
AT_CHECK_CALC_GLR([%error-verbose %locations])
|
||||
|
||||
AT_CHECK_CALC_GLR([%error-verbose %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
AT_CHECK_CALC_GLR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
AT_CHECK_CALC_GLR([%debug])
|
||||
AT_CHECK_CALC_GLR([%error-verbose %debug %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
# AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations --defines --name-prefix=calc --verbose --yacc])
|
||||
# AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
|
||||
|
||||
@@ -241,62 +241,56 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
|
||||
_AT_TEST_GLR_CALC([],[%dprec 1],[%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, impure, locations])
|
||||
_AT_TEST_GLR_CALC([%locations],[%dprec 1],[%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
|
||||
_AT_TEST_GLR_CALC([%pure-parser],[%dprec 1],[%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Resolve ambiguity, pure, locations])
|
||||
_AT_TEST_GLR_CALC([%pure-parser
|
||||
%locations],[%dprec 1],[%dprec 2])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_RESOLVED_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
_AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
|
||||
_AT_TEST_GLR_CALC([],[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, impure, locations])
|
||||
_AT_TEST_GLR_CALC([%locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
|
||||
_AT_TEST_GLR_CALC([%pure-parser],[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
AT_SETUP([GLR: Merge conflicting parses, pure, locations])
|
||||
_AT_TEST_GLR_CALC([%pure-parser
|
||||
%locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT,
|
||||
_AT_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
|
||||
_AT_TEST_GLR_CALC([%error-verbose],
|
||||
[%merge <stmtMerge>],[%merge <stmtMerge>])
|
||||
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
|
||||
_AT_AMBIG_GLR_OUTPUT,
|
||||
_AT_VERBOSE_GLR_STDERR)
|
||||
_AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user