* 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:
Akim Demaille
2002-11-03 12:16:25 +00:00
parent 1a43c452ea
commit 9e32add8e6
3 changed files with 39 additions and 40 deletions

View File

@@ -1,8 +1,15 @@
2002-11-03 Akim Demaille <akim@epita.fr>
* 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 <eggert@twinsun.com> 2002-11-03 Paul Eggert <eggert@twinsun.com>
* src/scan-gram.l: Revamp to fix POSIX incompatibilities, * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
to count columns correctly, and to check for invalid inputs. to count columns correctly, and to check for invalid inputs.
Use mbsnwidth to count columns correctly. Account for tabs, too. Use mbsnwidth to count columns correctly. Account for tabs, too.
Include mbswidth.h. Include mbswidth.h.
(YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS. (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
@@ -24,12 +31,12 @@
Use {splice} wherever C allows backslash-newline. Use {splice} wherever C allows backslash-newline.
YY_STEP after space, newline, vertical-tab. YY_STEP after space, newline, vertical-tab.
("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT). ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
(letter, id): Don't assume ASCII; e.g., spell out a-z. (letter, id): Don't assume ASCII; e.g., spell out a-z.
({int}, handle_action_dollar, handle_action_at): Check for integer ({int}, handle_action_dollar, handle_action_at): Check for integer
overflow. overflow.
(YY_STEP): Omit trailing semicolon, so that it's more like C. (YY_STEP): Omit trailing semicolon, so that it's more like C.
(<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00

View File

@@ -323,8 +323,7 @@ main (int argc, const char **argv)
# ------------------------------- # -------------------------------
# Produce `calc.y'. # Produce `calc.y'.
m4_define([AT_DATA_CALC_Y], m4_define([AT_DATA_CALC_Y],
[_AT_DATA_CALC_Y($[1], $[2], $[3], [_AT_DATA_CALC_Y($[1], $[2], $[3], [$1])
[m4_bpatsubst([$1], [--[^ ]*])])
]) ])
@@ -360,7 +359,7 @@ m4_bmatch([$1],
# If INPUT starts with a slash, it is used as absolute input file name, # If INPUT starts with a slash, it is used as absolute input file name,
# otherwise as contents. # 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. # is correctly output on stderr.
# #
# If BISON-OPTIONS contains `%error-verbose', then make sure the # If BISON-OPTIONS contains `%error-verbose', then make sure the
@@ -426,7 +425,7 @@ AT_SETUP([Calculator $1])
AT_DATA_CALC_Y([$1]) AT_DATA_CALC_Y([$1])
# Specify the output files to avoid problems on different file systems. # 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], [], []) [0], [], [])
AT_COMPILE([calc]) AT_COMPILE([calc])
@@ -495,22 +494,21 @@ m4_define([AT_CHECK_CALC_LALR],
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([%locations])
AT_CHECK_CALC_LALR([--name-prefix=calc]) AT_CHECK_CALC_LALR([%name-prefix="calc"])
AT_CHECK_CALC_LALR([--verbose]) AT_CHECK_CALC_LALR([%verbose])
AT_CHECK_CALC_LALR([--yacc]) AT_CHECK_CALC_LALR([%yacc])
AT_CHECK_CALC_LALR([%error-verbose]) AT_CHECK_CALC_LALR([%error-verbose])
AT_CHECK_CALC_LALR([%error-verbose %locations]) 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([%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()
AT_CHECK_CALC_GLR([--defines]) AT_CHECK_CALC_GLR([%defines])
AT_CHECK_CALC_GLR([%locations]) AT_CHECK_CALC_GLR([%locations])
AT_CHECK_CALC_GLR([--name-prefix=calc]) AT_CHECK_CALC_GLR([%name-prefix="calc"])
AT_CHECK_CALC_GLR([--verbose]) AT_CHECK_CALC_GLR([%verbose])
AT_CHECK_CALC_GLR([--yacc]) AT_CHECK_CALC_GLR([%yacc])
AT_CHECK_CALC_GLR([%error-verbose]) AT_CHECK_CALC_GLR([%error-verbose])
AT_CHECK_CALC_GLR([%error-verbose %locations]) 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([%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])

View File

@@ -241,62 +241,56 @@ m4_define([_AT_VERBOSE_GLR_STDERR],
AT_SETUP([GLR: Resolve ambiguity, impure, no locations]) AT_SETUP([GLR: Resolve ambiguity, impure, no locations])
_AT_TEST_GLR_CALC([],[%dprec 1],[%dprec 2]) _AT_TEST_GLR_CALC([],[%dprec 1],[%dprec 2])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_GLR_STDERR) _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Resolve ambiguity, impure, locations]) AT_SETUP([GLR: Resolve ambiguity, impure, locations])
_AT_TEST_GLR_CALC([%locations],[%dprec 1],[%dprec 2]) _AT_TEST_GLR_CALC([%locations],[%dprec 1],[%dprec 2])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_GLR_STDERR) _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Resolve ambiguity, pure, no locations]) AT_SETUP([GLR: Resolve ambiguity, pure, no locations])
_AT_TEST_GLR_CALC([%pure-parser],[%dprec 1],[%dprec 2]) _AT_TEST_GLR_CALC([%pure-parser],[%dprec 1],[%dprec 2])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, _AT_RESOLVED_GLR_OUTPUT, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_GLR_STDERR) _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Resolve ambiguity, pure, locations]) AT_SETUP([GLR: Resolve ambiguity, pure, locations])
_AT_TEST_GLR_CALC([%pure-parser _AT_TEST_GLR_CALC([%pure-parser
%locations],[%dprec 1],[%dprec 2]) %locations],[%dprec 1],[%dprec 2])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_RESOLVED_GLR_OUTPUT, _AT_RESOLVED_GLR_OUTPUT, _AT_GLR_STDERR)
_AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Merge conflicting parses, impure, no locations]) AT_SETUP([GLR: Merge conflicting parses, impure, no locations])
_AT_TEST_GLR_CALC([],[%merge <stmtMerge>],[%merge <stmtMerge>]) _AT_TEST_GLR_CALC([],[%merge <stmtMerge>],[%merge <stmtMerge>])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_AMBIG_GLR_OUTPUT, _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
_AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Merge conflicting parses, impure, locations]) AT_SETUP([GLR: Merge conflicting parses, impure, locations])
_AT_TEST_GLR_CALC([%locations],[%merge <stmtMerge>],[%merge <stmtMerge>]) _AT_TEST_GLR_CALC([%locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_AMBIG_GLR_OUTPUT, _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
_AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Merge conflicting parses, pure, no locations]) AT_SETUP([GLR: Merge conflicting parses, pure, no locations])
_AT_TEST_GLR_CALC([%pure-parser],[%merge <stmtMerge>],[%merge <stmtMerge>]) _AT_TEST_GLR_CALC([%pure-parser],[%merge <stmtMerge>],[%merge <stmtMerge>])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_AMBIG_GLR_OUTPUT, _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
_AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Merge conflicting parses, pure, locations]) AT_SETUP([GLR: Merge conflicting parses, pure, locations])
_AT_TEST_GLR_CALC([%pure-parser _AT_TEST_GLR_CALC([%pure-parser
%locations],[%merge <stmtMerge>],[%merge <stmtMerge>]) %locations],[%merge <stmtMerge>],[%merge <stmtMerge>])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_AMBIG_GLR_OUTPUT, _AT_AMBIG_GLR_OUTPUT, _AT_GLR_STDERR)
_AT_GLR_STDERR)
AT_CLEANUP AT_CLEANUP
AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations]) AT_SETUP([GLR: Verbose messages, resolve ambiguity, impure, no locations])
_AT_TEST_GLR_CALC([%error-verbose], _AT_TEST_GLR_CALC([%error-verbose],
[%merge <stmtMerge>],[%merge <stmtMerge>]) [%merge <stmtMerge>],[%merge <stmtMerge>])
AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0, AT_PARSER_CHECK([[./types test-input | sed 's/ *$//']], 0,
_AT_AMBIG_GLR_OUTPUT, _AT_AMBIG_GLR_OUTPUT, _AT_VERBOSE_GLR_STDERR)
_AT_VERBOSE_GLR_STDERR)
AT_CLEANUP AT_CLEANUP