diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 07:08:12 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 07:08:12 +0000 |
commit | 6833508f150b9e1131c3e4446b71833171c103f0 (patch) | |
tree | 55cb47fe86eb32db5363cbc4ba3c48a3681bb870 /man_macro.c | |
parent | 04c844c9b370f59b5c07157eec6ba5a879b30218 (diff) | |
download | mandoc-6833508f150b9e1131c3e4446b71833171c103f0.tar.gz mandoc-6833508f150b9e1131c3e4446b71833171c103f0.tar.zst mandoc-6833508f150b9e1131c3e4446b71833171c103f0.zip |
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.
Diffstat (limited to 'man_macro.c')
-rw-r--r-- | man_macro.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/man_macro.c b/man_macro.c index 30d3cfd9..48b9858a 100644 --- a/man_macro.c +++ b/man_macro.c @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.139 2018/12/31 04:55:46 schwarze Exp $ */ +/* $Id: man_macro.c,v 1.140 2018/12/31 07:08:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2012-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> @@ -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); |