Provide a new function roff_req_or_macro() to parse and handle a request
authorschwarze <schwarze@openbsd.org>
Sat, 30 Apr 2022 18:46:16 +0000 (18:46 +0000)
committerschwarze <schwarze@openbsd.org>
Sat, 30 Apr 2022 18:46:16 +0000 (18:46 +0000)
commitf79258f38adfde76960dd906169a01b9cdd56b03
tree8b8203d03ac497ceb5f2cb4556bf358c1af07a52
parent609704bb108dada7d73d9bbb0959f8012c6991e0
Provide a new function roff_req_or_macro() to parse and handle a request
or macro, including context-dependent error handling inside tbl(7) code
and inside .ce/.rj blocks.  Use it both in the top level roff(7) parser
and inside conditional blocks.

This fixes an assertion failure triggered by ".if 1 .ce" inside tbl(7)
code, found by tb@ using afl(1).

As a side benefit for readability, only one place remains in the
code that calls the main handler functions for the various roff(7)
requests.  This patch also improves column numbers in some error
messages and various comments.
regress/usr.bin/mandoc/roff/ce/Makefile
regress/usr.bin/mandoc/roff/ce/break.in [new file with mode: 0644]
regress/usr.bin/mandoc/roff/ce/break.out_ascii [new file with mode: 0644]
regress/usr.bin/mandoc/tbl/macro/Makefile
regress/usr.bin/mandoc/tbl/macro/nested.out_lint
regress/usr.bin/mandoc/tbl/macro/req.in [new file with mode: 0644]
regress/usr.bin/mandoc/tbl/macro/req.out_ascii [new file with mode: 0644]
regress/usr.bin/mandoc/tbl/macro/req.out_lint [new file with mode: 0644]
usr.bin/mandoc/roff.c