summaryrefslogtreecommitdiff
path: root/tests/named-refs.at
Commit message (Collapse)AuthorAgeFilesLines
* diagnostics: modernize the display of submessagesVictor Morales Cayuela2020-02-151-81/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since Bison 2.7, output was indented four spaces for explanatory statements. For example: input.y:2.7-13: error: %type redeclaration for exp input.y:1.7-11: previous declaration Since the introduction of caret-diagnostics, it became less clear. Remove the indentation and display submessages as in GCC: input.y:2.7-13: error: %type redeclaration for exp 2 | %type <float> exp | ^~~~~~~ input.y:1.7-11: note: previous declaration 1 | %type <int> exp | ^~~~~ * src/complain.h (SUB_INDENT): Remove. (warnings): Add "note" to the enum. * src/complain.h, src/complain.c (complain_indent): Replace by... (subcomplain): this. Adjust all dependencies. * tests/actions.at, tests/diagnostics.at, tests/glr-regression.at, * tests/input.at, tests/named-refs.at, tests/regression.at: Adjust expectations.
* package: bump copyrights to 2020Akim Demaille2020-01-051-1/+1
| | | | Run 'make update-copyright'.
* tests: refactor the handling of PerlAkim Demaille2019-10-131-1/+1
| | | | | | | | | | | | | | Let's make a difference between places where Perl is required for the test (AT_PERL_REQUIRE), and the places where it's used to run the test, but it's not not to run the test (AT_PERL_CHECK). * tests/local.at (AT_REQUIRE): New. (AT_PERL_CHECK, AT_PERL_REQUIRE): New. Use them where appropriate. * tests/local.mk ($(TESTSUITE)): Beware not to start the line with '-pi' if Perl is empty, as Make understands this as "it's ok to fail". Which it is not.
* tests: be really robust to Perl missingAkim Demaille2019-10-111-1/+1
| | | | | | | | | | | My previous tests (with ./configure PERL=false) have been fooled by configure, that managed to find perl anyway. This time, I ran this on a Fedora in Docker, without Perl. * tests/calc.at, tests/diagnostics.at, tests/headers.at, * tests/input.at, tests/local.at, tests/named-refs.at, * tests/output.at, tests/regression.at, tests/skeletons.at, * tests/synclines.at, tests/torture.at: Don't require Perl.
* diagnostics: copy GCC9's formatAkim Demaille2019-04-231-100/+100
| | | | | | | | | | | | | | | | | | | | | | | Currently, when we quote the source file, we indent it with one space, and preserve tabulations, so there is a discrepancy and the visual rendering is bad. One way out is to indent with a tab instead of a space, but then this space can be used for more information. This is what GCC9 does. Let's play copy cats. See https://lists.gnu.org/archive/html/bison-patches/2019-04/msg00025.html https://developers.redhat.com/blog/2019/03/08/usability-improvements-in-gcc-9/ https://gcc.gnu.org/onlinedocs/gccint/Guidelines-for-Diagnostics.html#Guidelines-for-Diagnostics * src/location.c (location_caret): Prefix quoted lines with the line number and a pipe, fitting 8 columns. * tests/actions.at, tests/c++.at, tests/conflicts.at, * tests/diagnostics.at, tests/input.at, tests/java.at, * tests/named-refs.at, tests/reduce.at, tests/regression.at, * tests/sets.at: Adjust expectations. Partly by "./build-aux/update-test tests/testsuite.dir/*/testsuite.log" repeatedly, and partly by hand.
* tests: simplify AT_PARSER_CHECK usageAkim Demaille2019-02-211-1/+1
| | | | | | | | | Currently the caller must specify the ./ prefix to its command. Let's avoid that: it will be nicer to read, make it easier to have a version that works for Java and C/C++. * tests/local.at (AT_PARSER_CHECK): Prefix the command with ./. Adjust callers.
* tests: dispatch per lang on AT_DATA_GRAMMARAkim Demaille2019-02-211-0/+18
| | | | | | | | | * tests/java.at: Do that. * tests/conflicts.at: Simplify. * tests/actions.at, tests/c++.at, tests/input.at, tests/local.at, * tests/named-refs.at: Use AT_BISON_OPTION_PUSHDEFS/AT_BISON_OPTION_POPDEFS.
* diagnostics: prefer ^~~~ to ^^^^ to underline codeAkim Demaille2019-01-141-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | That's what both GCC and Clang do, and it is indeed much nicer to read. From: foo.y:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated] %error-verbose ^^^^^^^^^^^^^^ foo.y:4.1-20: warning: deprecated directive, use '%define api.prefix {foo}' [-Wdeprecated] %name-prefix = "foo" ^^^^^^^^^^^^^^^^^^^^ to: foo.y:1.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated] %error-verbose ^~~~~~~~~~~~~~ foo.y:4.1-20: warning: deprecated directive, use '%define api.prefix {foo}' [-Wdeprecated] %name-prefix = "foo" ^~~~~~~~~~~~~~~~~~~~ * src/location.c (location_caret): Use ^~~~. Adjust tests expectations.
* package: bump copyrights to 2019Akim Demaille2019-01-051-1/+1
|
* style: clean testsAkim Demaille2019-01-051-2/+2
| | | | * tests/named-refs.at: here.
* Update copyright yearsAkim Demaille2018-05-121-1/+1
| | | | Run `make update-copyright`.
* build: re-enable compiler warnings, and fix themAkim Demaille2015-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | There are warnings (-Wextra) in generated C++ code: ltlparse.cc: In member function 'ltlyy::parser::symbol_number_type ltlyy::parser::by_state::type_get() const': ltlparse.cc:452:33: warning: enumeral and non-enumeral type in conditional expression return state == empty_state ? empty_symbol : yystos_[state]; Reported by Alexandre Duret-Lutz. It turns out that -Wall and -Wextra were disabled because of a stupid typo. * configure.ac: Fix the stupid typo. * data/lalr1.cc, src/AnnotationList.c, src/InadequacyList.c, * src/ielr.c, src/print.c, src/scan-code.l, src/symlist.c, * src/symlist.h, src/symtab.c, src/tables.c, tests/actions.at, * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at, * tests/named-refs.at, tests/torture.at: Fix warnings, mostly issues about variables used only with assertions, which are disabled with -DNDEBUG.
* package: bump to 2015Akim Demaille2015-01-041-1/+1
| | | | | | Which also requires: * gnulib: Update.
* package: bump to 2014Akim Demaille2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * AUTHORS, ChangeLog-2012, Makefile.am, NEWS, PACKAGING, README, * README-alpha, README-hacking, THANKS, TODO, bootstrap.conf, * build-aux/darwin11.4.0.valgrind, build-aux/local.mk, * build-aux/update-b4-copyright, * build-aux/update-package-copyright-year, cfg.mk, configure.ac, * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4, * data/c-like.m4, data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc, * data/java-skel.m4, data/java.m4, data/lalr1.cc, data/lalr1.java, * data/local.mk, data/location.cc, data/stack.hh, data/variant.hh, * data/xslt/bison.xsl, data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint, * djgpp/README.in, djgpp/config.bat, djgpp/config.sed, * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat, * djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h, * djgpp/testsuite.sed, doc/bison.texi, doc/local.mk, doc/refcard.tex, * etc/README, etc/bench.pl.in, etc/local.mk, * examples/calc++/calc++.test, examples/calc++/local.mk, * examples/extexi, examples/local.mk, examples/mfcalc/local.mk, * examples/mfcalc/mfcalc.test, examples/rpcalc/local.mk, * examples/rpcalc/rpcalc.test, examples/test, examples/variant.yy, * lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c, * lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h, * lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c, * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c, * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h, * lib/local.mk, lib/main.c, lib/timevar.c, lib/timevar.def, * lib/timevar.h, lib/vbitset.c, lib/vbitset.h, lib/yyerror.c, * m4/bison-i18n.m4, m4/c-working.m4, m4/cxx.m4, m4/flex.m4, * m4/timevar.m4, src/AnnotationList.c, src/AnnotationList.h, * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c, src/LR0.h, * src/Sbitset.c, src/Sbitset.h, src/assoc.c, src/assoc.h, * src/closure.c, src/closure.h, src/complain.c, src/complain.h, * src/conflicts.c, src/conflicts.h, src/derives.c, src/derives.h, * src/files.c, src/files.h, src/flex-scanner.h, src/getargs.c, * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c, * src/graphviz.h, src/ielr.c, src/ielr.h, src/lalr.c, src/lalr.h, * src/local.mk, src/location.c, src/location.h, src/main.c, * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c, * src/named-ref.h, src/nullable.c, src/nullable.h, src/output.c, * src/output.h, src/parse-gram.c, src/parse-gram.y, src/print-xml.c, * src/print-xml.h, src/print.c, src/print.h, src/print_graph.c, * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c, * src/reduce.h, src/relation.c, src/relation.h, src/scan-code.h, * src/scan-code.l, src/scan-gram.h, src/scan-gram.l, src/scan-skel.h, * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c, * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h, * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h, * tests/actions.at, tests/atlocal.in, tests/bison.in, tests/c++.at, * tests/calc.at, tests/conflicts.at, tests/cxx-type.at, * tests/existing.at, tests/glr-regression.at, tests/headers.at, * tests/input.at, tests/java.at, tests/javapush.at, tests/local.at, * tests/local.mk, tests/named-refs.at, tests/output.at, tests/push.at, * tests/reduce.at, tests/regression.at, tests/sets.at, * tests/skeletons.at, tests/synclines.at, tests/testsuite.at, * tests/torture.at, tests/types.at: here.
* c: no longer require stdio.h when locations are enabledAkim Demaille2013-01-251-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes (in 2.7) introduced a dependency on both FILE and fprintf, which are "available" only in %debug mode. This was to define yy_location_print_, which is used only in %debug mode by the parser, but massively used by the test suite to output the locations in yyerror. Break this dependency: the test suite should define its own routines to display the locations. Eventually Bison will provide the user with a means to display locations, but not yet. * data/c.m4 (b4_yy_location_print_define): Use YYFPRINTF instead of fprintf directly. * data/yacc.c (b4_yy_location_print_define): Invoke it only in %debug mode, so that stdio.h is included (needed for FILE*), and YYFPRINTF is defined. * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DEFINE): Declare and define location_print and LOCATION_PRINT. * tests/actions.at, tests/existing.at, tests/glr-regression.at, * tests/input.at, tests/named-refs.at, tests/regression.at: Adjust to use them. Fix the expected line numbers (as the prologue's length has changed).
* tests: minor refactoringAkim Demaille2013-01-211-2/+1
| | | | * tests/named-refs.at: Use AT_FULL_COMPILE where applicable.
* maint: update copyright yearsAkim Demaille2013-01-121-1/+1
| | | | | Suggested by Stefano Lattarini. Run "make update-copyright".
* carets: show them in more testsTheophile Ranquet2013-01-111-1/+23
| | | | * tests/input.at, tests/named-refs.at: Here.
* Merge remote-tracking branch 'origin/maint'Theophile Ranquet2012-12-061-0/+121
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/maint: misc: pacify the Tiny C Compiler cpp: make the check of Flex version portable misc: require getline c++: support wide strings for file names doc: document carets tests: enhance existing tests with carets errors: show carets getargs: add support for --flags/-f Conflicts: doc/bison.texi m4/.gitignore src/complain.c src/flex-scanner.h src/getargs.c src/getargs.h src/gram.c src/main.c tests/headers.at
| * tests: enhance existing tests with caretsTheophile Ranquet2012-12-051-0/+121
| | | | | | | | | | | | | | | | | | | | * tests/actions.at: Unset value. * tests/conflicts.at: Rule useless due to conflicts. * tests/input.at: Missing terminator, unexpected end of file, command line redefinition of variable. * tests/named-refs.at: Many errors. * tests/reduce.at: Useless nonterminals and rules. * tests/regression.at: Large token.
* | Merge remote-tracking branch 'origin/maint'Akim Demaille2012-11-261-20/+15
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/maint: yacc.c: always initialize yylloc scanner: issue a single error for groups of invalid characters tests: formatting changes doc: one of the fixes for an ambiguous grammar was ambiguous too doc: fix the dangling else with precedence directives doc: prefer "token" to TOKEN doc: formatting changes scanner: use explicit "ignore" statements Conflicts: src/scan-gram.l
| * scanner: issue a single error for groups of invalid charactersAkim Demaille2012-11-231-9/+4
| | | | | | | | | | * src/scan-gram.l: Scan groups of invalid characters together. * tests/input.at, tests/named-refs.at: Adjust.
| * tests: formatting changesAkim Demaille2012-11-231-15/+15
| | | | | | | | * tests/named-refs.at: Here.
* | Merge remote-tracking branch 'origin/maint'Akim Demaille2012-11-061-1/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/maint: (24 commits) tests: calc: modernize the use of locations tests: remove useless location initializations lalr1.cc: always initialize yylval. tests: check that C and C++ objects can be linked together. yacc.c: also disable -Wuninitialized. glr.cc, yacc.c: initialize yylloc properly yacc.c, glr.c: a better YY_LOCATION_PRINT yacc.c: simplify initialization doc: formatting changes c++: fix position operator signatures tests: remove useless location initialization. tests: fix locations in C tests: handle %parse-param in the generated yyerror tests: simplifications grammars: fix display of nul character in error message tests: sort tests: cosmetic changes comment changes autoconf: update gnulib: update ... Conflicts: data/lalr1.cc gnulib src/scan-gram.l submodules/autoconf tests/calc.at
| * Merge branch 'branch-2.6' into maintAkim Demaille2012-11-061-1/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/branch-2.6: (24 commits) tests: calc: modernize the use of locations tests: remove useless location initializations lalr1.cc: always initialize yylval. tests: check that C and C++ objects can be linked together. yacc.c: also disable -Wuninitialized. glr.cc, yacc.c: initialize yylloc properly yacc.c, glr.c: a better YY_LOCATION_PRINT yacc.c: simplify initialization doc: formatting changes c++: fix position operator signatures tests: remove useless location initialization. tests: fix locations in C tests: handle %parse-param in the generated yyerror tests: simplifications grammars: fix display of nul character in error message tests: sort tests: cosmetic changes comment changes autoconf: update gnulib: update ... Conflicts: NEWS gnulib tests/named-refs.at tests/regression.at
| | * grammars: fix display of nul character in error messageAkim Demaille2012-11-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Marc Mendiola. http://lists.gnu.org/archive/html/help-bison/2012-10/msg00017.html * gnulib: Update to get quote_mem. * src/scan-gram.l: Use it. * tests/input.at (Invalid inputs): Additional checks. * tests/named-refs.at: Likewise.
* | | warnings: remove spurious suffixes on contextTheophile Ranquet2012-10-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rectify a bug that introduced suffixes out of place. * src/complainc.c (complains): Handle all three special warning bits. * src/scan-code.l (show_sub_message): Remove useless argument. * tests/named-refs.at: Adjust. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
* | | Merge branch 'maint'Akim Demaille2012-09-261-47/+47
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: warnings: introduce -Wdeprecated in the usage info errors: prefix the output with "error: " errors: indent "invalid value for %define" context errors: indent "%define var" redefinition context errors: indent "symbol redeclaration" context errors: indent "result type clash" error context Conflicts: src/complain.c src/muscle-tab.c src/reader.c src/symtab.c tests/conflicts.at tests/input.at tests/named-refs.at tests/output.at tests/skeletons.at
| * | errors: prefix the output with "error: "Theophile Ranquet2012-09-261-47/+47
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | This improves readability. This is also what gcc does. * NEWS: Document this change. * src/complain.c (complain_at): Prefix all errors with "error: ". (complain_at_indent, warn_at_indent): Do not prefix the context information of errors, which are basically just indented errors. * tests/conflicts.at, tests/glr-regression.at, tests/input.at, tests/named-refs.at, tests/output.at, tests/push.at, tests/regression.at, tests/skeletons.at: Apply this change. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
* | warnings: display warnings categoriesVictor Santet2012-06-291-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | * src/complain.c (error_message): Call 'warnings_print_categories'. * src/gram.c (grammar_rules_useless_report): Display itself warning category. * tests/actions.at, tests/conflicts.at, tests/existing.at, tests/input.at, tests/named-refs.at, tests/output.at, tests/reduce.at, tests/regression.at, tests/skeletons.at: Adjust. * NEWS: Document this. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
* | Merge remote-tracking branch 'origin/maint'Akim Demaille2012-06-261-4/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/maint: tests: do not output m4 set up. tests: use the generic yyerror function. tests: use assert instead of plain abort. tests: improve the generic yylex implementation. tests: generalize the compilation macros. tests: fix confusion between api.prefix and name-prefix. maint: gitignores. yacc: work around the ylwrap limitation. Conflicts: NEWS tests/local.at
| * tests: use assert instead of plain abort.Akim Demaille2012-06-261-4/+2
| | | | | | | | | | | | | | | | * tests/actions.at, tests/calc.at, tests/conflicts.at, * tests/cxx-type.at, tests/glr-regression.at, tests/input.at, * tests/named-refs.at, tests/regression.at, tests/torture.at, * tests/local.at: Prefer assert to abort.
* | Merge remote-tracking branch 'origin/maint'Akim Demaille2012-06-191-13/+11
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/maint: maint: formatting changes. tests: support api.prefix. tests: pacify font-lock-mode. tests: remove test covered elsewhere. tests: factor the declaration/definition of yyerror and yylex. regen. tests: portability issues. tests: call the parser from another compilation unit. glr.c, yacc.c: declare yydebug in the header. skeletons: use header guards. tests: improve AT_FULL_COMPILE. tests: reorder. tests: strengthen the test on generated headers inclusion yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it. yacc.c: factor. Conflicts: NEWS data/glr.c data/yacc.c src/parse-gram.c src/parse-gram.h tests/conflicts.at tests/regression.at
| * tests: factor the declaration/definition of yyerror and yylex.Akim Demaille2012-06-171-13/+11
| | | | | | | | | | | | | | | | | | | | | | * tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DECLARE_EXTERN) (AT_YYERROR_DEFINE, AT_YYLEX_DECLARE, AT_YYLEX_DECLARE_EXTERN) (AT_YYLEX_DEFINE): New. Must be used inside AT_BISON_OPTION_PUSHDEFS/POPDEFS pair. * tests/actions.at, tests/conflicts.at, tests/glr-regression.at, * tests/headers.at, tests/input.at, tests/named-refs.at, * tests/regression.at, tests/skeletons.at, tests/synclines.at, * tests/torture.at: Use them.
| * tests: fix regressions.Akim Demaille2012-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | Exit status 63 is documented for version-mismatch. * bootstrap.conf (gnulib_modules): Remove sysexits. * src/system.h (EX_MISMATCH): Define. * src/parse-gram.y (version_check): Use it instead of EX_CONFIG. Missing includes. * tests/calc.at, tests/named-refs.at: Include assert.h. (cherry picked from commit 459a57a90ff6fc8209498b7d5bc6e33d5e633f23)
| * maint: avoid "magic number exit".Akim Demaille2012-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * cfg.mk (local-checks-to-skip): No longer skip it. * bootstrap.conf (gnulib_modules): Add sysexits. * doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y, * src/system.h, tests/calc.at, tests/named-refs.at: Use assert where appropriate instead of "if (...) exit". Use symbolic exit status elsewhere. Conflicts: doc/bison.texinfo src/parse-gram.y
| * quote consistently and make tests pass with new quoting from gnulibJim Meyering2012-01-231-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updating to gnulib pulled in new quote and quotarg modules, by which quoting is now done like 'this' rather than `this'. That change induces many "make check" test failures. This change adapts code and tests so that "make check" passes once again. * src/scan-code.l: Quote like 'this', not like `this'. * src/scan-gram.l: Likewise. * src/symtab.c: Likewise. * tests/actions.at: Adjust tests to match. * tests/input.at: Likewise. * tests/named-refs.at: Likewise. * tests/output.at: Likewise. * tests/regression.at: Likewise. * lib/.gitignore: Regenerate. * m4/.gitignore: Likewise. (cherry picked from commit ae93e4e4b8e78396a7707de3dcdd47aca7a46dec) Conflicts: src/scan-code.l src/scan-gram.l src/symtab.c tests/output.at
| * maint: run "make update-copyright".Akim Demaille2012-01-131-1/+1
| |
| * named references: fix double free.Akim Demaille2011-03-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `rhs[name]: "a" | "b"', do not free "name" twice. Reported by Tys Lefering. <http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html> * src/named-ref.h, src/named-ref.c (named_ref_copy): New. * src/parse-gram.y (current_lhs): Rename as... (current_lhs_symbol): this. (current_lhs): New function. Use it to free the current lhs named reference. * src/reader.c: Bind lhs to a copy of the current named reference. * src/symlist.c: Rely on free (0) being valid. * tests/named-refs.at: Test this.
| * tests: style changes.Akim Demaille2011-03-091-79/+51
| | | | | | | | | | * tests/named-refs.at (Redundant words in LHS brackets) (Unresolved references): here.
| * Do not allow identifiers that start with a dash.Joel E. Denny2011-02-051-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up our previous fixes for a bug whereby Bison discarded `.field' in `$-1.field'. The previous fixes were less restrictive about where a dash could appear in an identifier, but the restrictions were hard to explain. That bug was reported and this final fix was originally suggested by Paul Hilfinger. This also fixes a remaining bug reported by Paul Eggert whereby Bison parses `%token ID -123' as `%token ID - 123' and handles `-' as an identifier. Now, `-' cannot be an identifier. Discussed in threads beginning at <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00000.html>, <http://lists.gnu.org/archive/html/bug-bison/2011-01/msg00004.html>. * NEWS (2.5): Update entry describing the dash extension to grammar symbol names. Also, move that entry before the named references entry because the latter mentions the former. * doc/bison.texinfo (Symbol): Update documentation for symbol names. As suggested by Paul Eggert, mention the effect of periods and dashes on named references. (Decl Summary): Update documentation for unquoted %define values, which, as a side effect, can no longer start with dashes either. * src/scan-code.l (id): Implement. * src/scan-gram.l (id): Implement. * tests/actions.at (Exotic Dollars): Extend test group to exercise bug reported by Paul Hilfinger. * tests/input.at (Symbols): Update test group, and extend to exercise bug reported by Paul Eggert. * tests/named-refs.at (Stray symbols in brackets): Update test group. ($ or @ followed by . or -): Likewise. * tests/regression.at (Invalid inputs): Likewise. (cherry picked from commit 82f3355eaf8d5988391021262dc9acfa6485c098)
| * Improve error messages for `$' or `@' followed by `.' or `-'.Joel E. Denny2011-01-091-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, for this special case of an invalid reference, the usual "symbol not found in production:" was printed. However, because the symbol name was parsed as the empty string, that message was followed immediately by a newline instead of a symbol name. In reality, this is a syntax error, so the reference is invalid regardless of the symbols actually appearing in the production. Discussed at <http://lists.gnu.org/archive/html/bison-patches/2011-01/msg00012.html>. * src/scan-code.l (parse_ref): Report the above case as a syntax error. Other than that, continue to handle this case like any other invalid reference that Bison manages to parse because "possibly meant" messages can still be helpful to the user. * tests/named-refs.at ($ or @ followed by . or -): New test group. (cherry picked from commit 5c9efc755e61e47011a71b022ad232e28af67bd0)
| * maint: run "make update-copyright".Joel E. Denny2011-01-021-1/+1
| |
| * Do not use date ranges in copyright notices.Paul Eggert2010-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices * HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha: * TODO, bootstrap, bootstrap.conf: * build-aux/update-b4-copyright, cfg.mk, configure.ac: * data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4: * data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc: * data/java-skel.m4, data/java.m4, data/lalr1.cc: * data/lalr1.java, data/location.cc: * data/xslt/bison.xsl: * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl: * data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint: * djgpp/README.in, djgpp/config.bat, djgpp/config.sed: * djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat: * djgpp/subpipe.c, djgpp/subpipe.h: * djgpp/testsuite.sed, doc/bison.texinfo: * doc/refcard.tex, etc/README, etc/bench.pl.in: * examples/calc++/Makefile.am, examples/extexi: * lib/abitset.c, lib/abitset.h: * lib/bbitset.h, lib/bitset.c, lib/bitset.h: * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c: * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h: * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c: * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h: * lib/libiberty.h, lib/main.c, lib/timevar.c: * lib/timevar.def, lib/timevar.h, lib/vbitset.c: * lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4: * m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4: * src/AnnotationList.c, src/AnnotationList.h: * src/InadequacyList.c, src/InadequacyList.h, src/LR0.c: * src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c: * src/assoc.h, src/closure.c, src/closure.h, src/complain.c: * src/complain.h, src/conflicts.c, src/conflicts.h: * src/derives.c, src/derives.h, src/files.c, src/files.h: * src/flex-scanner.h, src/getargs.c, src/getargs.h: * src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c: * src/ielr.h, src/lalr.c, src/lalr.h: * src/location.c, src/location.h, src/main.c: * src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c: * src/named-ref.h, src/nullable.c, src/nullable.h: * src/output.c, src/output.h, src/parse-gram.y: * src/print-xml.c, src/print-xml.h, src/print.c, src/print.h: * src/print_graph.c, src/print_graph.h, src/reader.c: * src/reader.h, src/reduce.c, src/reduce.h, src/relation.c: * src/relation.h, src/scan-code.h, src/scan-code.l: * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h: * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c: * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h: * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h: * tests/actions.at, tests/atlocal.in, tests/c++.at: * tests/calc.at, tests/conflicts.at, tests/cxx-type.at: * tests/existing.at, tests/glr-regression.at: * tests/headers.at, tests/input.at, tests/java.at: * tests/local.at, tests/named-refs.at: * tests/output.at, tests/push.at, tests/reduce.at: * tests/regression.at, tests/sets.at, tests/skeletons.at: * tests/synclines.at, tests/testsuite.at, tests/torture.at: * data/Makefile.am, data/location.cc, doc/Makefile.am, src/Makefile.am: * tests/Makefile.am, lib/Makefile.am, examples/Makefile.am: * etc/Makefile.am: Don't use date ranges in copyright notices. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
| * maint: run "make update-copyright"Joel E. Denny2010-01-041-1/+1
| |
| * Keep sub-messages aligned. Fix strings for translation.Alex Rozenman2009-09-191-51/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/location.h: (location_print): Add return value. * src/location.c: (location_print): Return number of printed characters. * src/complain.h: Two new functions (complain_at_indent, warn_at_indent). * src/complain.cpp: Implement the alignment mechanism. Add new static variable (indent_ptr). Use and update it (error_message, complain_at_indent, warn_at_indent). * src/scan-code.l: Fix strings for translations. Use new *_indent functions (parse_ref, show_sub_messages). * tests/named-ref.at: Adjust testcases. * NEWS (2.5): Add an announcement about named references.
| * Provide an additional sub-message for clarity.Alex Rozenman2009-09-121-20/+50
| | | | | | | | | | | | | | | | | | Add "symbol not found in production" error message when an "invalid reference" is detected in named references resolution. * src/scan-code.l: Update "invalid reference" case. * tests/named-ref.at: Adjust test-cases.
| * Use "Unresolved reference" error message when no symbols were foundAlex Rozenman2009-09-051-4/+81
| | | | | | | | | | | | | | | | | | in a symbolic reference resolution. Remove .expr and -expr from the shown reference when the reference is unresolved. * src/scan-code.l: Change the error message, adjust location columns, rename variable "exact_mode" to "explicit_bracketing". * tests/named-ref.at: Adjust existing tests and add a new one.
| * Convert "misleading reference" messages to warnings.Alex Rozenman2009-08-081-8/+8
| | | | | | | | | | | | * src/scan-code.l: New function 'show_sub_messages', more factoring. * tests/named-ref.at: Adjust tests.
| * Style changes and factoring.Alex Rozenman2009-07-041-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/named-ref.h: Add comments. * src/parse-gram.y: Readability and style changes. * src/reader.c: Factoring: assign_named_ref function. * src/scan-code.l: Factoring and style changes. Rename parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib. Use "unsigned" type for variant index. Improve readablity. * src/scan-gram.l: Change error messages and add comments. * src/symlist.h: symbol_list_null: New function decl. * src/symlist.c: symbol_list_null: Implement here. * tests/named-refs.at: Adjust for new error messages.