From 9aa6ef8197493fef732a3c196a9405dac78ef349 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 30 Apr 2022 18:51:36 +0000 Subject: 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/tbl/macro/req.in | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 regress/tbl/macro/req.in (limited to 'regress/tbl/macro/req.in') diff --git a/regress/tbl/macro/req.in b/regress/tbl/macro/req.in new file mode 100644 index 00000000..30e1fe98 --- /dev/null +++ b/regress/tbl/macro/req.in @@ -0,0 +1,30 @@ +.\" $OpenBSD: req.in,v 1.1 2022/04/30 18:46:16 schwarze Exp $ +.TH TBL-MACRO-REQ 1 "April 30, 2022" +.SH NAME +tbl-macro-req \- requests generating nodes in a table +.SH DESCRIPTION +initial text +.TS +box tab(:); +l | l . +a:b:stray +_ +c:T{ +d +e +T} +.ce +f:T{ +g +.br +h +T} +.if 1 .ce +i:T{ +j +.if 1 .br +k +T} +.TE +.PP +final text -- cgit