summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 52eda379..4065cd77 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.40 2010/01/01 17:14:29 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.41 2010/01/30 08:42:20 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -31,6 +31,7 @@
#define REWIND_NOHALT (1 << 1)
#define REWIND_HALT (1 << 2)
+static int ctx_synopsis(MACRO_PROT_ARGS);
static int obsolete(MACRO_PROT_ARGS);
static int blk_part_exp(MACRO_PROT_ARGS);
static int in_line_eoln(MACRO_PROT_ARGS);
@@ -98,7 +99,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ in_line_eoln, 0 }, /* Rv */
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* St */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Va */
- { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */
+ { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Xr */
{ in_line_eoln, 0 }, /* %A */
{ in_line_eoln, 0 }, /* %B */
@@ -398,6 +399,8 @@ rew_dohalt(int tok, enum mdoc_type type, const struct mdoc_node *p)
case (MDOC_Qq):
/* FALLTHROUGH */
case (MDOC_Sq):
+ /* FALLTHROUGH */
+ case (MDOC_Vt):
assert(MDOC_TAIL != type);
if (type == p->type && tok == p->tok)
return(REWIND_REWIND);
@@ -1322,6 +1325,29 @@ in_line_eoln(MACRO_PROT_ARGS)
/* ARGSUSED */
static int
+ctx_synopsis(MACRO_PROT_ARGS)
+{
+
+ /* If we're not in the SYNOPSIS, go straight to in-line. */
+ if (SEC_SYNOPSIS != m->lastsec)
+ return(in_line(m, tok, line, ppos, pos, buf));
+
+ /* If we're a nested call, same place. */
+ if (ppos > 1)
+ return(in_line(m, tok, line, ppos, pos, buf));
+
+ /*
+ * XXX: this will open a block scope; however, if later we end
+ * up formatting the block scope, then child nodes will inherit
+ * the formatting. Be careful.
+ */
+
+ return(blk_part_imp(m, tok, line, ppos, pos, buf));
+}
+
+
+/* ARGSUSED */
+static int
obsolete(MACRO_PROT_ARGS)
{