version 1.286, 2015/04/18 16:06:41 |
version 1.287, 2015/04/19 13:50:26 |
|
|
#include "roff.h" |
#include "roff.h" |
#include "mdoc.h" |
#include "mdoc.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
|
#include "roff_int.h" |
#include "libmdoc.h" |
#include "libmdoc.h" |
|
|
/* FIXME: .Bl -diag can't have non-text children in HEAD. */ |
/* FIXME: .Bl -diag can't have non-text children in HEAD. */ |
Line 904 post_fo(POST_ARGS) |
|
Line 905 post_fo(POST_ARGS) |
|
n->child->next->line, n->child->next->pos, |
n->child->next->line, n->child->next->pos, |
"Fo ... %s", n->child->next->string); |
"Fo ... %s", n->child->next->string); |
while (n->child != n->last) |
while (n->child != n->last) |
mdoc_node_delete(mdoc, n->last); |
roff_node_delete(mdoc, n->last); |
} |
} |
|
|
post_fname(mdoc); |
post_fname(mdoc); |
Line 1246 post_bl_block(POST_ARGS) |
|
Line 1247 post_bl_block(POST_ARGS) |
|
mdoc->parse, nc->line, nc->pos, |
mdoc->parse, nc->line, nc->pos, |
"%s before It", |
"%s before It", |
mdoc_macronames[nc->tok]); |
mdoc_macronames[nc->tok]); |
mdoc_node_delete(mdoc, nc); |
roff_node_delete(mdoc, nc); |
} else |
} else |
break; |
break; |
nc = ni->body->last; |
nc = ni->body->last; |
Line 1357 post_bl_head(POST_ARGS) |
|
Line 1358 post_bl_head(POST_ARGS) |
|
mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, |
mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, |
nch->line, nch->pos, "Bl ... %s", nch->string); |
nch->line, nch->pos, "Bl ... %s", nch->string); |
while (nch != NULL) { |
while (nch != NULL) { |
mdoc_node_delete(mdoc, nch); |
roff_node_delete(mdoc, nch); |
nch = nh->child; |
nch = nh->child; |
} |
} |
return; |
return; |
Line 1398 post_bl_head(POST_ARGS) |
|
Line 1399 post_bl_head(POST_ARGS) |
|
argv->value[i++] = nch->string; |
argv->value[i++] = nch->string; |
nch->string = NULL; |
nch->string = NULL; |
nnext = nch->next; |
nnext = nch->next; |
mdoc_node_delete(NULL, nch); |
roff_node_delete(NULL, nch); |
} |
} |
nh->nchild = 0; |
nh->nchild = 0; |
nh->child = NULL; |
nh->child = NULL; |
Line 1497 post_bk(POST_ARGS) |
|
Line 1498 post_bk(POST_ARGS) |
|
if (n->type == ROFFT_BLOCK && n->body->child == NULL) { |
if (n->type == ROFFT_BLOCK && n->body->child == NULL) { |
mandoc_msg(MANDOCERR_BLK_EMPTY, |
mandoc_msg(MANDOCERR_BLK_EMPTY, |
mdoc->parse, n->line, n->pos, "Bk"); |
mdoc->parse, n->line, n->pos, "Bk"); |
mdoc_node_delete(mdoc, n); |
roff_node_delete(mdoc, n); |
} |
} |
} |
} |
|
|
Line 1585 post_st(POST_ARGS) |
|
Line 1586 post_st(POST_ARGS) |
|
if (NULL == (p = mdoc_a2st(nch->string))) { |
if (NULL == (p = mdoc_a2st(nch->string))) { |
mandoc_vmsg(MANDOCERR_ST_BAD, mdoc->parse, |
mandoc_vmsg(MANDOCERR_ST_BAD, mdoc->parse, |
nch->line, nch->pos, "St %s", nch->string); |
nch->line, nch->pos, "St %s", nch->string); |
mdoc_node_delete(mdoc, n); |
roff_node_delete(mdoc, n); |
} else { |
} else { |
free(nch->string); |
free(nch->string); |
nch->string = mandoc_strdup(p); |
nch->string = mandoc_strdup(p); |
Line 1632 post_rs(POST_ARGS) |
|
Line 1633 post_rs(POST_ARGS) |
|
|
|
/* |
/* |
* Remove this child from the chain. This somewhat |
* Remove this child from the chain. This somewhat |
* repeats mdoc_node_unlink(), but since we're |
* repeats roff_node_unlink(), but since we're |
* just re-ordering, there's no need for the |
* just re-ordering, there's no need for the |
* full unlink process. |
* full unlink process. |
*/ |
*/ |
Line 2005 post_ignpar(POST_ARGS) |
|
Line 2006 post_ignpar(POST_ARGS) |
|
mdoc->parse, np->line, np->pos, |
mdoc->parse, np->line, np->pos, |
"%s after %s", mdoc_macronames[np->tok], |
"%s after %s", mdoc_macronames[np->tok], |
mdoc_macronames[mdoc->last->tok]); |
mdoc_macronames[mdoc->last->tok]); |
mdoc_node_delete(mdoc, np); |
roff_node_delete(mdoc, np); |
} |
} |
|
|
if (NULL != (np = mdoc->last->last)) |
if (NULL != (np = mdoc->last->last)) |
Line 2014 post_ignpar(POST_ARGS) |
|
Line 2015 post_ignpar(POST_ARGS) |
|
np->line, np->pos, "%s at the end of %s", |
np->line, np->pos, "%s at the end of %s", |
mdoc_macronames[np->tok], |
mdoc_macronames[np->tok], |
mdoc_macronames[mdoc->last->tok]); |
mdoc_macronames[mdoc->last->tok]); |
mdoc_node_delete(mdoc, np); |
roff_node_delete(mdoc, np); |
} |
} |
} |
} |
|
|
Line 2047 pre_par(PRE_ARGS) |
|
Line 2048 pre_par(PRE_ARGS) |
|
mdoc->last->line, mdoc->last->pos, |
mdoc->last->line, mdoc->last->pos, |
"%s before %s", mdoc_macronames[mdoc->last->tok], |
"%s before %s", mdoc_macronames[mdoc->last->tok], |
mdoc_macronames[n->tok]); |
mdoc_macronames[n->tok]); |
mdoc_node_delete(mdoc, mdoc->last); |
roff_node_delete(mdoc, mdoc->last); |
} |
} |
|
|
static void |
static void |
Line 2080 post_par(POST_ARGS) |
|
Line 2081 post_par(POST_ARGS) |
|
mdoc->last->line, mdoc->last->pos, |
mdoc->last->line, mdoc->last->pos, |
"%s after %s", mdoc_macronames[mdoc->last->tok], |
"%s after %s", mdoc_macronames[mdoc->last->tok], |
mdoc_macronames[np->tok]); |
mdoc_macronames[np->tok]); |
mdoc_node_delete(mdoc, mdoc->last); |
roff_node_delete(mdoc, mdoc->last); |
} |
} |
|
|
static void |
static void |
Line 2139 post_dd(POST_ARGS) |
|
Line 2140 post_dd(POST_ARGS) |
|
free(datestr); |
free(datestr); |
} |
} |
out: |
out: |
mdoc_node_delete(mdoc, n); |
roff_node_delete(mdoc, n); |
} |
} |
|
|
static void |
static void |
Line 2224 post_dt(POST_ARGS) |
|
Line 2225 post_dt(POST_ARGS) |
|
nn->line, nn->pos, "Dt ... %s", nn->string); |
nn->line, nn->pos, "Dt ... %s", nn->string); |
|
|
out: |
out: |
mdoc_node_delete(mdoc, n); |
roff_node_delete(mdoc, n); |
} |
} |
|
|
static void |
static void |
Line 2290 post_os(POST_ARGS) |
|
Line 2291 post_os(POST_ARGS) |
|
#endif /*!OSNAME*/ |
#endif /*!OSNAME*/ |
|
|
out: |
out: |
mdoc_node_delete(mdoc, n); |
roff_node_delete(mdoc, n); |
} |
} |
|
|
/* |
/* |