From 9e32add8e6e9ba278655142e1aa0a85773f18cc7 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 3 Nov 2002 12:16:25 +0000 Subject: [PATCH] * 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. --- ChangeLog | 13 ++++++++++--- tests/calc.at | 36 +++++++++++++++++------------------- tests/cxx-type.at | 30 ++++++++++++------------------ 3 files changed, 39 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24ccaf1..7c5dee4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,15 @@ +2002-11-03 Akim Demaille + + * 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. + 2002-11-03 Paul Eggert * src/scan-gram.l: Revamp to fix POSIX incompatibilities, to count columns correctly, and to check for invalid inputs. - + Use mbsnwidth to count columns correctly. Account for tabs, too. Include mbswidth.h. (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS. @@ -24,12 +31,12 @@ Use {splice} wherever C allows backslash-newline. YY_STEP after space, newline, vertical-tab. ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT). - + (letter, id): Don't assume ASCII; e.g., spell out a-z. ({int}, handle_action_dollar, handle_action_at): Check for integer overflow. - + (YY_STEP): Omit trailing semicolon, so that it's more like C. (): Allow \0 and \00 diff --git a/tests/calc.at b/tests/calc.at index c8ef428..d239ddd 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -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]) diff --git a/tests/cxx-type.at b/tests/cxx-type.at index 25abfd5..9562b13 100644 --- a/tests/cxx-type.at +++ b/tests/cxx-type.at @@ -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 ],[%merge ]) 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 ],[%merge ]) 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 ],[%merge ]) 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 ],[%merge ]) 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 ],[%merge ]) 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 -- 2.7.4