diff options
author | 2010-05-16 00:54:03 +0000 | |
---|---|---|
committer | 2010-05-16 00:54:03 +0000 | |
commit | f673a3c7f56af2337ea2de9b85dcf81ac59dc5c4 (patch) | |
tree | 335837a61651571ef0035e6ebe4688dd663eadae /usr.bin/mandoc/man_validate.c | |
parent | mdoc_isdelim now returns enum mdelim, not int any more; (diff) | |
download | wireguard-openbsd-f673a3c7f56af2337ea2de9b85dcf81ac59dc5c4.tar.xz wireguard-openbsd-f673a3c7f56af2337ea2de9b85dcf81ac59dc5c4.zip |
In theory, Kristaps never intended to write a roff parser,
but in practice, most real legacy man(7)uals are using so much
low level roff that we can't really get away without at least
partially handling some roff instructions.
As doing this in man(7) only has become messy and as even some
mdoc(7) pages need it, start a minimal partial roff preprocessor.
As a first step, move handling of .am[i], .de[i] and .ig there.
Do not use the roff preprocessor for new manuals!
Now that we have three main parser libraries - roff, man and mdoc -
each one having its own error handling is becoming messy, too.
Thus, start unifying message handling in one central place,
introducing a new generic function mmsg().
coded by kristaps@
Diffstat (limited to 'usr.bin/mandoc/man_validate.c')
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 0c34e0cd43b..b879304ff85 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.21 2010/05/15 18:06:03 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.22 2010/05/16 00:54:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -42,7 +42,6 @@ static int check_ge2(CHKARGS); static int check_le5(CHKARGS); static int check_par(CHKARGS); static int check_part(CHKARGS); -static int check_roff(CHKARGS); static int check_root(CHKARGS); static int check_sec(CHKARGS); static int check_text(CHKARGS); @@ -55,7 +54,6 @@ static v_check posts_part[] = { check_part, NULL }; static v_check posts_sec[] = { check_sec, NULL }; static v_check posts_le1[] = { check_le1, NULL }; static v_check pres_bline[] = { check_bline, NULL }; -static v_check pres_roff[] = { check_roff, NULL }; static const struct man_valid man_valids[MAN_MAX] = { { NULL, posts_eq0 }, /* br */ @@ -93,12 +91,6 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, posts_le1 }, /* Sp */ { pres_bline, posts_le1 }, /* Vb */ { pres_bline, posts_eq0 }, /* Ve */ - { pres_roff, NULL }, /* de */ - { pres_roff, NULL }, /* dei */ - { pres_roff, NULL }, /* am */ - { pres_roff, NULL }, /* ami */ - { pres_roff, NULL }, /* ig */ - { NULL, NULL }, /* . */ { NULL, NULL }, /* if */ { NULL, NULL }, /* ie */ { NULL, NULL }, /* el */ @@ -323,20 +315,3 @@ check_bline(CHKARGS) return(1); } - -static int -check_roff(CHKARGS) -{ - - if (MAN_BLOCK != n->type) - return(1); - - for (n = n->parent; n; n = n->parent) - if (MAN_de == n->tok || MAN_dei == n->tok || - MAN_am == n->tok || - MAN_ami == n->tok || - MAN_ig == n->tok) - return(man_nerr(m, n, WROFFNEST)); - - return(1); -} |