]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Simplify Bison error message reporting.
authorNick Bowler <nbowler@draconx.ca>
Thu, 20 Jul 2023 02:22:10 +0000 (22:22 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 20 Jul 2023 02:22:10 +0000 (22:22 -0400)
commit41ff7ec97691736525bb3da095afd5ca9a8ef003
tree59bc1df0522d90deeaa30c0b45ddb8fba8d2c70e
parent779cb9b02891e3f9fc8b9620bb630cf529d76c67
libcdecl: Simplify Bison error message reporting.

Bison emits a bunch of code to pretty print token names for error
messages, doing things like removing quotes and backslashes.

But this is all totally pointless: all of the relevant strings are
already correctly formatted (in part because fix-yytname.awk does
some of this at compile time), and the process will not alter them.
They simply need to be copied as-is.

Fortunately, Bison provides a simple mechanism to replace this with
our own function, and wouldn't you know it we already have a suitable
copying function in the library, so let's use that.
src/cdecl-internal.h
src/output.c
src/parse.y