=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_action.c,v retrieving revision 1.28 retrieving revision 1.33 diff -u -p -r1.28 -r1.33 --- mandoc/Attic/mdoc_action.c 2009/07/15 15:53:57 1.28 +++ mandoc/Attic/mdoc_action.c 2009/07/25 16:03:03 1.33 @@ -1,4 +1,4 @@ -/* $Id: mdoc_action.c,v 1.28 2009/07/15 15:53:57 kristaps Exp $ */ +/* $Id: mdoc_action.c,v 1.33 2009/07/25 16:03:03 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -42,13 +42,13 @@ static int post_dd(POST_ARGS); 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); @@ -89,7 +89,7 @@ const struct actions mdoc_actions[MDOC_MAX] = { { 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 */ @@ -162,7 +162,7 @@ const struct actions mdoc_actions[MDOC_MAX] = { { 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 */ @@ -172,6 +172,8 @@ const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* En */ { NULL, NULL }, /* Dx */ { NULL, NULL }, /* %Q */ + { NULL, NULL }, /* br */ + { NULL, NULL }, /* sp */ }; static int concat(struct mdoc *, const struct mdoc_node *, @@ -298,11 +300,6 @@ post_lb(POST_ARGS) char *buf; size_t sz; - /* - * FIXME: this must be broken apart into a series of TEXT nodes, - * each containing a single word. - */ - assert(MDOC_TEXT == m->last->child->type); p = mdoc_a2lib(m->last->child->string); if (NULL == p) { @@ -331,11 +328,6 @@ post_st(POST_ARGS) { const char *p; - /* - * FIXME: this must be broken apart into a series of TEXT nodes, - * each containing a single word. - */ - assert(MDOC_TEXT == m->last->child->type); p = mdoc_a2st(m->last->child->string); assert(p); @@ -353,11 +345,6 @@ post_at(POST_ARGS) struct mdoc_node *n; const char *p; - /* - * FIXME: this must be broken apart into a series of TEXT nodes, - * each containing a single word. - */ - if (m->last->child) { assert(MDOC_TEXT == m->last->child->type); p = mdoc_a2att(m->last->child->string); @@ -500,7 +487,6 @@ post_dt(POST_ARGS) 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) { @@ -748,7 +734,7 @@ post_bl(POST_ARGS) static int -post_lk(POST_ARGS) +post_tilde(POST_ARGS) { struct mdoc_node *n; @@ -758,7 +744,7 @@ post_lk(POST_ARGS) 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); @@ -858,7 +844,12 @@ pre_bd(PRE_ARGS) 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 "". + */ for (n = n->parent, i = 0; i < (int)n->args->argc; i++) if (MDOC_Literal == n->args->argv[i].arg)