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.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.c')
-rw-r--r-- | usr.bin/mandoc/man.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 1aad5bb28d8..6e8e720e8f5 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.29 2010/05/15 18:06:02 schwarze Exp $ */ +/* $Id: man.c,v 1.30 2010/05/16 00:54:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -45,8 +45,6 @@ const char *const __man_merrnames[WERRMAX] = { "no scope context", /* WNOSCOPE */ "literal context already open", /* WOLITERAL */ "no literal context open", /* WNLITERAL */ - "invalid nesting of roff declarations", /* WROFFNEST */ - "scope in roff instructions broken", /* WROFFSCOPE */ "document title should be uppercase", /* WTITLECASE */ "deprecated comment style", /* WBADCOMMENT */ }; @@ -60,9 +58,8 @@ const char *const __man_macronames[MAN_MAX] = { "RI", "na", "i", "sp", "nf", "fi", "r", "RE", "RS", "DT", "UC", "PD", - "Sp", "Vb", "Ve", "de", - "dei", "am", "ami", "ig", - ".", "if", "ie", "el", + "Sp", "Vb", "Ve", + "if", "ie", "el", }; const char * const *man_macronames = __man_macronames; @@ -560,9 +557,6 @@ man_pmacro(struct man *m, int ln, char *buf) * Remove prior ELINE macro, as it's being clobbering by a new * macro. Note that NSCOPED macros do not close out ELINE * macros---they don't print text---so we let those slip by. - * NOTE: we don't allow roff blocks (NOCLOSE) to be embedded - * here because that would stipulate blocks as children of - * elements! */ if ( ! (MAN_NSCOPED & man_macros[tok].flags) && |