-/* $Id: mdoc_action.c,v 1.30 2009/07/17 10:56:57 kristaps Exp $ */
+/* $Id: mdoc_action.c,v 1.34 2009/07/26 10:29:39 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
static int post_display(POST_ARGS);
static int post_dt(POST_ARGS);
static int post_lb(POST_ARGS);
-static int post_lk(POST_ARGS);
static int post_nm(POST_ARGS);
static int post_os(POST_ARGS);
static int post_prol(POST_ARGS);
static int post_sh(POST_ARGS);
static int post_st(POST_ARGS);
static int post_std(POST_ARGS);
+static int post_tilde(POST_ARGS);
static int pre_bd(PRE_ARGS);
static int pre_dl(PRE_ARGS);
{ NULL, post_nm }, /* Nm */
{ NULL, NULL }, /* Op */
{ NULL, NULL }, /* Ot */
- { NULL, NULL }, /* Pa */
+ { NULL, post_tilde }, /* Pa */
{ NULL, post_std }, /* Rv */
{ NULL, post_st }, /* St */
{ NULL, NULL }, /* Va */
{ NULL, NULL }, /* Ud */
{ NULL, post_lb }, /* Lb */
{ NULL, NULL }, /* Lp */
- { NULL, post_lk }, /* Lk */
+ { NULL, post_tilde }, /* Lk */
{ NULL, NULL }, /* Mt */
{ NULL, NULL }, /* Brq */
{ NULL, NULL }, /* Bro */
free(m->meta.vol);
if (NULL == (m->meta.vol = strdup(cp)))
return(mdoc_nerr(m, m->last, EMALLOC));
- n = n->next;
} else {
cp = mdoc_a2arch(n->string);
if (NULL == cp) {
if (NULL == (m->meta.os = strdup(buf)))
return(mdoc_nerr(m, m->last, EMALLOC));
- m->flags |= MDOC_PBODY;
return(post_prol(m));
}
static int
-post_lk(POST_ARGS)
+post_tilde(POST_ARGS)
{
struct mdoc_node *n;
n = m->last;
m->next = MDOC_NEXT_CHILD;
- /* XXX: this isn't documented anywhere! */
+ /* XXX: not documented for `Lk'. */
if ( ! mdoc_word_alloc(m, m->last->line, m->last->pos, "~"))
return(0);
}
mdoc_node_freelist(n);
+
+ if (m->meta.title && m->meta.date && m->meta.os)
+ m->flags |= MDOC_PBODY;
return(1);
}
if (MDOC_BODY == n->type)
m->flags |= MDOC_LITERAL;
+
return(1);
}
if (MDOC_BODY != n->type)
return(1);
- /* Enter literal context if `Bd -literal' or * -unfilled'. */
+ /* Enter literal context if `Bd -literal' or `-unfilled'. */
+
+ /*
+ * TODO: `-offset' without an argument should be the width of
+ * the literal "<string>".
+ */
for (n = n->parent, i = 0; i < (int)n->args->argc; i++)
if (MDOC_Literal == n->args->argv[i].arg)