-# $OpenBSD: Makefile,v 1.2 2017/06/03 15:54:09 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2022/04/28 10:17:38 schwarze Exp $
-REGRESS_TARGETS = args blank
-LINT_TARGETS = args blank
+REGRESS_TARGETS = args blank nest
+LINT_TARGETS = args blank nest
# groff-1.22.3 defect:
# - A blank line in next line scope causes a blank line.
--- /dev/null
+B-ARGS(1) General Commands Manual B-ARGS(1)
+
+N\bNA\bAM\bME\bE
+ B-nest - nested next-line scopes
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text b\bbo\bol\bld\bd t\bte\bex\bxt\bt back to roman _\bi_\bt_\ba_\bl_\bi_\bcroman
+
+section_\bh_\be_\ba_\bd_\be_\br
+ final text
+
+OpenBSD April 28, 2022 B-ARGS(1)
--- /dev/null
+mandoc: nest.in:12:2: WARNING: line scope broken: IR breaks SM
+mandoc: nest.in:11:2: WARNING: line scope broken: IR breaks B
+mandoc: nest.in:15:2: WARNING: line scope broken: SH breaks SM
+mandoc: nest.in:14:2: WARNING: line scope broken: SH breaks B
+mandoc: nest.in:18:2: WARNING: line scope broken: RI breaks B
+mandoc: nest.in:17:2: WARNING: line scope broken: RI breaks B
-/* $OpenBSD: man.c,v 1.135 2019/01/05 00:36:46 schwarze Exp $ */
+/* $OpenBSD: man.c,v 1.136 2022/04/28 10:17:37 schwarze Exp $ */
/*
+ * Copyright (c) 2013-2015,2017-2019,2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
return (ep - cp) % 2 ? NULL : ep;
}
+/*
+ * Rewind all open next-line scopes.
+ */
void
man_descope(struct roff_man *man, int line, int offs, char *start)
{
return 1;
}
+/*
+ * Rewind open next-line scopes
+ * unless the tok request or macro is allowed inside them.
+ */
void
man_breakscope(struct roff_man *man, int tok)
{
(man_macro(n->tok)->flags & (MAN_NSCOPED | MAN_ESCOPED))
== MAN_NSCOPED)
n = n->parent;
-
- mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos,
- "%s breaks %s", roff_name[tok], roff_name[n->tok]);
-
+ for (;;) {
+ mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos,
+ "%s breaks %s", roff_name[tok], roff_name[n->tok]);
+ if (n->parent->type != ROFFT_ELEM ||
+ (man_macro(n->parent->tok)->flags &
+ MAN_ESCOPED) == 0)
+ break;
+ n = n->parent;
+ }
roff_node_delete(man, n);
man->flags &= ~MAN_ELINE;
}