[BACK]Return to break.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / roff / ce

File: [cvsweb.bsd.lv] / mandoc / regress / roff / ce / break.in (download)

Revision 1.1, Sat Apr 30 18:51:37 2022 UTC (2 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: HEAD

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.

.\" $OpenBSD: break.in,v 1.1 2022/04/30 18:46:16 schwarze Exp $
.TH CE-BREAK 1 "April 30, 2022"
.SH NAME
ce-break \- centering requests broken by high-level macros
.SH DESCRIPTION
initial
text
.ce 3
Text centered with the .ce request is
.I not
filled.
.rj 4
Text adjusted to the right margin
works in just the same way and is
.I not
filled either.
.ce
High-level macros break centering even in a
.if 1 .I conditional
block.
.PP
.nf
Now entering
explicit no-fill mode.
.ce 3
Text is still
.I not
filled.
.PP
.fi
final
text
in fill mode