From c307b01e3d5709e7d34106b6fe8e98b468bf33f8 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 31 Dec 2018 07:08:12 +0000 Subject: Move parsing of the .nf and .fi (fill mode) requests from the man(7) parser to the roff(7) parser. As a side effect, .nf and .fi are now also parsed in mdoc(7) input, though the mdoc(7) formatters still ignore most of their effect. --- man_macro.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'man_macro.c') diff --git a/man_macro.c b/man_macro.c index d652a431..4519da6c 100644 --- a/man_macro.c +++ b/man_macro.c @@ -63,8 +63,6 @@ static const struct man_macro man_macros[MAN_MAX - MAN_TH] = { { in_line_eoln, MAN_NSCOPED | MAN_ESCOPED | MAN_JOIN }, /* I */ { in_line_eoln, 0 }, /* IR */ { in_line_eoln, 0 }, /* RI */ - { in_line_eoln, MAN_NSCOPED }, /* nf */ - { in_line_eoln, MAN_NSCOPED }, /* fi */ { blk_close, MAN_XSCOPE }, /* RE */ { blk_exp, MAN_XSCOPE }, /* RS */ { in_line_eoln, 0 }, /* DT */ @@ -340,9 +338,9 @@ blk_imp(MACRO_PROT_ARGS) struct roff_node *n; rew_scope(man, tok); - n = roff_block_alloc(man, line, ppos, tok); - if (n->tok == MAN_SH || n->tok == MAN_SS) - man->flags &= ~MAN_LITERAL; + if (tok == MAN_SH || tok == MAN_SS) + man->flags &= ~ROFF_NOFILL; + roff_block_alloc(man, line, ppos, tok); n = roff_head_alloc(man, line, ppos, tok); /* Add line arguments. */ @@ -384,11 +382,6 @@ in_line_eoln(MACRO_PROT_ARGS) n = man->last; for (;;) { - if (buf[*pos] != '\0' && (tok == MAN_fi || tok == MAN_nf)) { - mandoc_msg(MANDOCERR_ARG_SKIP, line, *pos, - "%s %s", roff_name[tok], buf + *pos); - break; - } if (buf[*pos] != '\0' && man->last != n && tok == MAN_PD) { mandoc_msg(MANDOCERR_ARG_EXCESS, line, *pos, "%s ... %s", roff_name[tok], buf + *pos); -- cgit