summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* diagnostics: %pure-parser is obsoleteAkim Demaille2019-05-196-10/+30
| | | | | | | | | | | Reported by Uxio Prego. http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00029.html * src/scan-gram.l, src/parse-gram.y (PERCENT_PURE_PARSER) (handle_pure_parser): New. Issue a deprecation/update notice for %pure-parser. * doc/bison.texi (Java Bison Interface): Don't mention %pure-parser. * tests/actions.at, tests/input.at: Adjust.
* diagnostics: clean up convention for colored diagnosticsAkim Demaille2019-05-195-22/+36
| | | | | | | | | | * data/diagnostics.css: Rename as... * data/bison-default.css: this. Add the GPL header. This is the convention followed by Bruno Haible in gettext. Adjust dependencies. * src/complain.c (complain_init_color): Use BISON_STYLE instead of BISON_DIAGNOSTICS_STYLE.
* CI: use a pipeline: first build the tarball, then check itAkim Demaille2019-05-192-29/+104
| | | | | | | | | | | | Build the tarball in one job, check it in many. Unfortunately no real gain in overall duration. With help from Clément Démoulins. * .travis.yml: here. Remove all the tricks that were used to be able to boostrap on old distros. (before_install): Merge into 'script', because before_install applies to all the jobs, and we don't want to run it for the 'compile' job.
* examples: fix srcdir/builddir issuesAkim Demaille2019-05-182-2/+2
| | | | * examples/d/local.mk, examples/java/local.mk: here.
* gnulib: updateAkim Demaille2019-05-181-0/+0
| | | | | | | | | | | | | | | | | | | In preparation for Bison 3.4, revert to the version before this commit: commit 03752516b21091cf3c4beea7e8b9bcad462d50ed Author: John Darrington <john@darrington.wattle.id.au> Date: Sun May 12 00:42:36 2019 +0200 version-etc: Ease translation. * lib/version-etc.c (version_etc_arn, emit_bug_reporting_address): Move URLs and formatting newlines out of translatable string. because it changes the messages for --version, translated in gnulib.po. These changes are not yet available on the translation project, so we would have a regression in the set of translated strings.
* build: do not use $< in plain rulesAkim Demaille2019-05-133-5/+5
| | | | | | | | | | | | It works only in implicit rules (or with GNU Make, but not with Solaris Make). Reported by Bruno Haible. http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00009.html Diagnosed thanks to Kiyoshi Kanazawa. * examples/c/reccalc/local.mk, examples/d/local.mk, * examples/java/local.mk: Don't use $< in non implicit rules.
* maint: post-release administriviaAkim Demaille2019-05-122-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.3.91v3.3.91Akim Demaille2019-05-121-1/+1
| | | | * NEWS: Record release date.
* NEWS: updateAkim Demaille2019-05-121-0/+3
|
* gnulib: updateAkim Demaille2019-05-121-0/+0
|
* style: remove incorrect commentAkim Demaille2019-05-111-1/+1
| | | | | * src/getargs.c: here. It's documented in getargs.h anyway.
* doc: use colors for diagnostics in TeX tooAkim Demaille2019-05-092-3/+38
| | | | | | | | | Thanks to Gavin Smith and Patrice Dumas. http://lists.gnu.org/archive/html/help-texinfo/2019-04/msg00015.html * doc/bison.texi (@colorWarning, @colorError, @colorNotice) (@colorOff): Define for TeX and HTML. (@dwarning, @derror, @dnotice): Use them.
* gnulib: update to fix location tracking in UTF-8 on SolarisAkim Demaille2019-05-081-0/+0
| | | | | | | | This update contains Bruno Haible's fix for the location tracking issue reported by Kiyoshi Kanazawa. https://lists.gnu.org/archive/html/bug-gnulib/2019-05/msg00020.html https://lists.gnu.org/archive/html/bug-bison/2019-04/msg00020.html
* diagnostics: rename --style=debug as --color=debugAkim Demaille2019-05-084-10/+13
| | | | | | | | | It is more consistent with --color=html, --color=test, etc. * src/getargs.h, src/getargs.c (style_debug): Rename as... (color_debug): this. (getargs_colors): Rename --style=debug as --color=debug. Adjust dependencies.
* diagnostics: support --color=htmlAkim Demaille2019-05-081-2/+19
| | | | | | | | | | | Based on a message from Bruno Haible. https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=fe18e92743b7226791a5f28d7c786941a1bf8cc9 This does not generate proper HTML: special characters are not escaped for instance. This is a hidden feature meant for Bison developers, not end users. * src/complain.c (complain_init_color): Support --color=html.
* tests: use %empty instead of commentsAkim Demaille2019-05-083-9/+9
| | | | * tests/c++.at, tests/glr-regression.at: here.
* fixits: sort them before applying themAkim Demaille2019-05-081-1/+6
| | | | | | | | | | An experimental commit introduced a fix-it hint that changes comments such as "/* empty */" into %empty. But in some case, because diagnostics are not necessarily emitted in order, the fixits also come in disorder, which must never happen, as the fixes are installed in one pass. * src/fixits.c (fixits_register): Insert them in order.
* style: use warning_is_enabled instead of duplicating itAkim Demaille2019-05-041-1/+1
| | | | * src/complain.c (deprecated_directive): Here.
* fixits: be sure to preserve the action when adding %emptyAkim Demaille2019-05-032-3/+44
| | | | | | | | Currently we remove the rhs to install %empty instead. * src/reader.c (grammar_rule_check_and_complete): Insert the missing %empty in front of the rhs, not in replacement thereof. * tests/actions.at (Add missing %empty): Check that.
* tests: don't duplicate the portability prologueAkim Demaille2019-05-034-24/+10
| | | | | * tests/actions.at, tests/input.at: Don't repeat the prologue, skip it. * tests/diagnostics.at, tests/local.at: Comment changes.
* style: use consistently *_loc for locationsAkim Demaille2019-05-0315-65/+65
| | | | | | | | | | | Some members are called foo_location, others are foo_loc. Stick to the latter. * src/gram.h, src/location.h, src/location.c, src/output.c, * src/parse-gram.y, src/reader.h, src/reader.c, src/reduce.c, * src/scan-gram.l, src/symlist.h, src/symlist.c, src/symtab.h, * src/symtab.c: Use _loc consistently, not _location.
* style: clarify the use of symbol_lists' locationsAkim Demaille2019-05-034-19/+22
| | | | | | | | | | | | | symbol_list features a 'location' and a 'sym_loc' member. The former is expected to be set only for symbol_lists that denote a symbol (not a type name), and the latter should only denote the location of the symbol/type name. Yet both are set, and the name "location" is too unprecise. * src/symlist.h, src/symlist.c (symbol_list::location): Rename as rhs_loc for clarity. Move it to the "section" of data valid only for rules. * src/reader.c, src/scan-code.l: Adjust.
* maint: update gnulib-po/.gitignoreAkim Demaille2019-05-031-0/+15
|
* tests: don't require a D compilerAkim Demaille2019-04-292-0/+7
| | | | | | | | Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00018.html * tests/atlocal.in (BISON_DC_WORKS): New. * tests/local.at (AT_COMPILE_D): Use it.
* doc: use svg instead of pngAkim Demaille2019-04-292-9/+9
| | | | * doc/bison.texi, doc/local.mk: here.
* doc: use colorsAkim Demaille2019-04-292-64/+81
| | | | | | * doc/bison.texi (dwarning, derror, dnotice): New. Use them in the diagnostics. * doc/local.mk (AM_MAKEINFOFLAGS): Pass customization variables.
* maint: post-release administriviaAkim Demaille2019-04-282-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.3.90v3.3.90Akim Demaille2019-04-281-1/+1
| | | | * NEWS: Record release date.
* package: add missing CLEANFILESAkim Demaille2019-04-285-4/+7
| | | | * examples: here.
* build: don't generate the graph reportsAkim Demaille2019-04-281-1/+1
| | | | | | | | | | Revert "build: also generate the graph reports" (4ec413da32760defe1bf382c048d1d2f67e0b58a). The problem is Automake's ylwrap which does not rename y.dot with the appropriate name. We should completely stop using Automake's support for Yacc, which is not something I will do right now. So step back. * Makefile.am (AM_YFLAGS_WITH_LINES): Don't pass --graph.
* package: don't regen the parser during dist if unneededAkim Demaille2019-04-281-2/+14
| | | | * Makefile.am (gen-synclines): New.
* package: don't ship the sources generated from the parserAkim Demaille2019-04-284-6/+23
| | | | | | | | | | | | | | | | | | | | | | | Because some of our examples use %C%_reccalc_SOURCES = %D%/parse.y Automake ships parse.y and parse.c, and possibly parse.h when it "understands" that there is one. This is not what we want: ship only parser.y. Yet we still want to use Automake to compile the sources from parser.y. The easiest seems to use nodist_%C%_reccalc_SOURCES = %D%/parse.y together with dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md which guarantees that parse.y is indeed shipped. * examples/c/calc/local.mk, examples/c/lexcalc/local.mk, * examples/c/reccalc/local.mk: Always use nodist_*SOURCES for parsers, let the dist_*_DATA rules do their job.
* package: various fixes for syntax-checkAkim Demaille2019-04-287-21/+14
| | | | | | | | | | | | | | | | | * cfg.mk: Disable checks where needed (e.g., we do want to check the behavior with tabs). (sc_at_parser_check): Remove. Unfortunately since a11c144609255bc6e42c2aff83548e91cbd05425 we no longer use the './' prefix to run programs in the current directory. That was so that we could run Java programs like the other, although they are no run with the `./` prefix (see 967a59d2c08a33f24708450561e2f8010b604523). As a consequence this sc check no longer makes sense. However, since now AT_PARSER_CHECK passes the `./` prefix itself, this sc-check was superfluous. * examples/c/reccalc/scan.l: Use memcpy, not strncpy. * src/ielr.c, src/reader.c: Obfuscate "lr(0)" so that the sc-check for "space before paren" does not fire. * tests/diagnostics.at: Avoid space-tab, use tab-tab.
* doc: clarify -fsyntax-errorAkim Demaille2019-04-272-2/+10
| | | | * NEWS, doc/bison.texi: here.
* regenAkim Demaille2019-04-272-21/+41
|
* traces: use colors for the semantic valuesAkim Demaille2019-04-274-6/+27
| | | | | | | | | | | | | This makes reading the trace slightly easier. It would be very nice to highlight the "big steps", especially reductions. But this is a private experiment: do not use it. * data/diagnostics.css (value): New. * src/parse-gram.y: Use no delimiters and no c quotation for strings to facilitate debugging. (tron, troff, TRACE): New. Not very elegant, but until there is support for printf-formats in libtextstyle, it shall be enough.
* diagnostics: give m4 precise locationsAkim Demaille2019-04-274-25/+65
| | | | | | | | | | | Currently we pass only the columns based on the screen-width, which is important for the carets. But we don't pass the bytes-based columns, which is important for the colors. Pass both. * src/muscle-tab.c (muscle_boundary_grow): Also pass the byte-based column. * src/location.c (location_caret): Clarify. (boundary_set_from_string): Adjust to the new format. * tests/diagnostics.at (Tabulations and multibyte characters from M4): New.
* diagnostics: fix locations coming from M4Akim Demaille2019-04-273-12/+39
| | | | | | | | | | Locations issued from M4 need the byte-based column for the diagnostics to work properly. Currently they were unassigned, which typically resulted in partially non-colored diagnostics. * src/location.c (boundary_set_from_string): Fix the parsed location. * src/muscle-tab.c (muscle_percent_define_default): Set the byte values. * tests/diagnostics.at (Locations from M4): New.
* diagnostics: show locations in full when debuggingAkim Demaille2019-04-273-24/+44
| | | | | | | | This is meant for developers, not end users, that's why I attached it to --trace. * src/getargs.h, src/getargs.c (trace_locations): New. * src/location.c (location_print): Use it.
* diagnostics: use flush, not fflushAkim Demaille2019-04-271-2/+2
| | | | * src/complain.c: here.
* build: use gettext-hAkim Demaille2019-04-256-24/+9
| | | | | | | | | | | We were using the gnulib's gettext module with tricks in bootstrap.conf to avoid useless files. Instead, use gnulib's gettext-h module. * .travis.yml: Force Gettext 0.18.3 on Trusty. * bootstrap.conf: Use gettext-h instead of gettext. (excluded_files): Remove. * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.
* NEWS: updateAkim Demaille2019-04-251-31/+56
|
* api.location.type: support it in CAkim Demaille2019-04-257-22/+58
| | | | | | | | | | | | Reported by Balázs Scheidler. * data/skeletons/c.m4 (b4_location_type_define): Use api.location.type if defined. * doc/bison.texi: Document it. * tests/local.at (AT_C_IF, AT_LANG_CASE): New. Support Span in C. * tests/calc.at (Span): Convert it to be usable in C and C++. Check api.location.type with yacc.c and glr.c.
* updates: insert/remove %emptyAkim Demaille2019-04-244-4/+22
| | | | | | * src/reader.c (grammar_rule_check_and_complete): Generate fixits for adding/removing %empty. * tests/actions.at, tests/diagnostics.at, tests/existing.at: Adjust.
* regenAkim Demaille2019-04-242-232/+235
|
* diagnostics: better rule locationsAkim Demaille2019-04-247-46/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "identifier and colon" of a rule is implemented as a single token, but whose location is only that of the identifier (so that messages about the lhs of a rule are accurate). When reducing empty rules, the default location is the single point location on the end of the previous symbol. As a consequence, when Bison parses a grammar, the location of the right-hand side of an empty rule is based on the lhs, *independently of the position of the colon*. And the colon can be way farther, separated by comments, white spaces, including empty lines. As a result, some messages look really bad. For instance: $ cat foo.y %% foo : /* empty */ bar : /* empty */ gives $ bison -Wall foo.y foo.y:2.4: warning: empty rule without %empty [-Wempty-rule] 2 | foo : /* empty */ | ^ foo.y:3.4: warning: empty rule without %empty [-Wempty-rule] 3 | bar | ^ The carets are not at the right column, not even the right line. This commit passes the colon "again" after the "id colon" token, which gives more accurate locations for these messages: $ bison -Wall foo.y foo.y:2.10: warning: empty rule without %empty [-Wempty-rule] 2 | foo : /* empty */ | ^ foo.y:4.2: warning: empty rule without %empty [-Wempty-rule] 4 | : /* empty */ | ^ * src/scan-gram.l (SC_AFTER_IDENTIFIER): Rollback the colon, so that we scan it again afterwards. (INITIAL): Scan colons. * src/parse-gram.y (COLON): New. (rules): Parse the colon after the rule's id_colon (and possible named reference). * tests/actions.at, tests/conflicts.at, tests/diagnostics.at, * tests/existing.at: Adjust.
* fixits: track byte-columns, not character-columnsAkim Demaille2019-04-242-15/+27
| | | | | | | | | | | | | | | | | | | | | Because the fix-its were ready the character-based columns, but were applied on byte-based columns, the result with multibyte characters or tabs could be "interesting". For instance %fixed-output_files %fixed_output-files %fixed-output-files %define api.prefix {foo} %no-default-prec would give %fixed-%fixed-output-files %fixed_output-files %fixed-orefix= "foo" o_default-prec * src/fixits.c (fixit_print, fixits_run): Work on byte-base columns. * tests/input.at: Check it.
* diagnostics: expose a means to know whether a warning is enabledAkim Demaille2019-04-242-3/+11
| | | | * src/complain.h, src/complain.c (warning_is_enabled): New.
* gnulib: let it use its own PO domainAkim Demaille2019-04-237-25/+7
| | | | | | | | | | See https://www.gnu.org/software/gnulib/manual/html_node/Localization.html. * bootstrap.conf: Create gnulib-po. * Makefile.am, configure.ac: Use it. * po/POTFILES.in: Remove files now in gnulib. * src/main.c: Open the bison-gnulib domain.
* diagnostics: don't try to quote special filesAkim Demaille2019-04-233-11/+66
| | | | | | | | | Based on a report by Todd Freed. http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00000.html See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90034 * src/location.c (caret_info): Also track the file name. (location_caret): Don't quote special files.