diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-03-02 01:00:40 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-03-02 01:00:40 +0000 |
commit | c2106c30fc02017f424d0af2aaea8733129851a9 (patch) | |
tree | ad908eda7569c61185a55eb7818873ceb0c17513 /usr.bin/mandoc | |
parent | 038ab018e83805ffd7295eb1d96d2eba5f39b351 (diff) |
Accept the non-standard macros .Sp (similar to .sp)
and .Vb/.Ve (similar to .nf/.fi) in man(7) mode.
These are not intended to be used manually, but they allow us to
properly render man(7) code autogenerated by pod2man(1),
making Perl and OpenSSL happy in our tree.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/man.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/man.h | 7 | ||||
-rw-r--r-- | usr.bin/mandoc/man_action.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/man_html.c | 7 | ||||
-rw-r--r-- | usr.bin/mandoc/man_macro.c | 9 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 5 | ||||
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 9 |
7 files changed, 35 insertions, 12 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index daea772af0c..960db5052cd 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.19 2010/02/26 12:42:29 schwarze Exp $ */ +/* $Id: man.c,v 1.20 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -55,7 +55,8 @@ const char *const __man_macronames[MAN_MAX] = { "R", "B", "I", "IR", "RI", "na", "i", "sp", "nf", "fi", "r", "RE", - "RS", "DT", "UC", "PD" + "RS", "DT", "UC", "PD", + "Sp", "Vb", "Ve", }; const char * const *man_macronames = __man_macronames; diff --git a/usr.bin/mandoc/man.h b/usr.bin/mandoc/man.h index 4abe9a3d695..b99ffda6026 100644 --- a/usr.bin/mandoc/man.h +++ b/usr.bin/mandoc/man.h @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.12 2009/12/22 23:58:00 schwarze Exp $ */ +/* $Id: man.h,v 1.13 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -51,7 +51,10 @@ #define MAN_DT 29 #define MAN_UC 30 #define MAN_PD 31 -#define MAN_MAX 32 +#define MAN_Sp 32 +#define MAN_Vb 33 +#define MAN_Ve 34 +#define MAN_MAX 35 enum man_type { MAN_TEXT, diff --git a/usr.bin/mandoc/man_action.c b/usr.bin/mandoc/man_action.c index 4732d148d81..ba0079c5ad0 100644 --- a/usr.bin/mandoc/man_action.c +++ b/usr.bin/mandoc/man_action.c @@ -1,4 +1,4 @@ -/* $Id: man_action.c,v 1.11 2009/12/23 22:30:17 schwarze Exp $ */ +/* $Id: man_action.c,v 1.12 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -64,6 +64,9 @@ const struct actions man_actions[MAN_MAX] = { { NULL }, /* DT */ { NULL }, /* UC */ { NULL }, /* PD */ + { NULL }, /* Sp */ + { post_nf }, /* Vb */ + { post_fi }, /* Ve */ }; diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index 0a4050f79a4..ec076849380 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.5 2010/02/18 02:11:26 schwarze Exp $ */ +/* $Id: man_html.c,v 1.6 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -99,6 +99,9 @@ static const struct htmlman mans[MAN_MAX] = { { man_ign_pre, NULL }, /* DT */ { man_ign_pre, NULL }, /* UC */ { man_ign_pre, NULL }, /* PD */ + { man_br_pre, NULL }, /* Sp */ + { NULL, NULL }, /* Vb */ + { NULL, NULL }, /* Vi */ }; @@ -331,7 +334,7 @@ man_br_pre(MAN_ARGS) SCALE_VS_INIT(&su, 1); - if (MAN_sp == n->tok && n->child) + if ((MAN_sp == n->tok || MAN_Sp == n->tok) && n->child) a2roffsu(n->child->string, &su, SCALE_VS); else if (MAN_br == n->tok) su.scale = 0; diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index d0e96db233f..33832ecde15 100644 --- a/usr.bin/mandoc/man_macro.c +++ b/usr.bin/mandoc/man_macro.c @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.9 2009/10/27 21:40:07 schwarze Exp $ */ +/* $Id: man_macro.c,v 1.10 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -68,6 +68,9 @@ const struct man_macro __man_macros[MAN_MAX] = { { in_line_eoln, 0 }, /* DT */ { in_line_eoln, 0 }, /* UC */ { in_line_eoln, 0 }, /* PD */ + { in_line_eoln, 0 }, /* Sp */ + { in_line_eoln, 0 }, /* Vb */ + { in_line_eoln, 0 }, /* Ve */ }; const struct man_macro * const man_macros = __man_macros; @@ -312,6 +315,10 @@ in_line_eoln(MACRO_PROT_ARGS) if (0 == w) break; + /* XXX ignore Vb arguments for now */ + if (MAN_Vb == tok) + continue; + if ( ! man_word_alloc(m, line, la, p)) return(0); } diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 87c1c7bb723..d30823cc11d 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.22 2010/02/26 12:42:29 schwarze Exp $ */ +/* $Id: man_term.c,v 1.23 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -133,6 +133,9 @@ static const struct termact termacts[MAN_MAX] = { { pre_ign, NULL }, /* DT */ { pre_ign, NULL }, /* UC */ { pre_ign, NULL }, /* PD */ + { pre_sp, NULL }, /* Sp */ + { pre_nf, NULL }, /* Vb */ + { pre_fi, NULL }, /* Ve */ }; diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 64e49bf1f07..68d87fa3ef0 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.12 2010/02/26 12:42:29 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.13 2010/03/02 01:00:39 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -51,7 +51,7 @@ static v_check posts_ge2_le5[] = { check_ge2, check_le5, NULL }; static v_check posts_par[] = { check_par, NULL }; static v_check posts_part[] = { check_part, NULL }; static v_check posts_sec[] = { check_sec, NULL }; -static v_check posts_sp[] = { check_le1, NULL }; +static v_check posts_le1[] = { check_le1, NULL }; static v_check pres_bline[] = { check_bline, NULL }; static const struct man_valid man_valids[MAN_MAX] = { @@ -78,7 +78,7 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, NULL }, /* RI */ { NULL, posts_eq0 }, /* na */ { NULL, NULL }, /* i */ - { NULL, posts_sp }, /* sp */ + { NULL, posts_le1 }, /* sp */ { pres_bline, posts_eq0 }, /* nf */ { pres_bline, posts_eq0 }, /* fi */ { NULL, NULL }, /* r */ @@ -87,6 +87,9 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, NULL }, /* DT */ { NULL, NULL }, /* UC */ { NULL, NULL }, /* PD */ + { NULL, posts_le1 }, /* Sp */ + { pres_bline, posts_le1 }, /* Vb */ + { pres_bline, posts_eq0 }, /* Ve */ }; |