diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-03-24 20:10:53 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-03-24 20:10:53 +0000 |
commit | 1bd27bfb1ecce0925949a108025f62bf87b5c5f5 (patch) | |
tree | 121babbde4f600edf3a9e716f4d00acf795aa3f6 /man_action.c | |
parent | efcc4d089d85c2b28629f9b05e441837f2c1a4f2 (diff) | |
download | mandoc-1bd27bfb1ecce0925949a108025f62bf87b5c5f5.tar.gz |
Using man_node_delete() instead of man_node_free()/man_node_freelist() and friends (much simpler).
Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original.
Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).
Diffstat (limited to 'man_action.c')
-rw-r--r-- | man_action.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/man_action.c b/man_action.c index 7634b5fd..6cd24666 100644 --- a/man_action.c +++ b/man_action.c @@ -30,6 +30,7 @@ struct actions { }; static int post_TH(struct man *); +static int post_de(struct man *); static int post_fi(struct man *); static int post_nf(struct man *); @@ -69,6 +70,12 @@ const struct actions man_actions[MAN_MAX] = { { NULL }, /* Sp */ { post_nf }, /* Vb */ { post_fi }, /* Ve */ + { post_de }, /* de */ + { post_de }, /* dei */ + { post_de }, /* am */ + { post_de }, /* ami */ + { post_de }, /* ig */ + { NULL }, /* . */ }; @@ -108,6 +115,21 @@ post_fi(struct man *m) static int +post_de(struct man *m) +{ + + /* + * XXX: for the time being, we indiscriminately remove roff + * instructions from the parse stream. + */ + if (MAN_BLOCK == m->last->type) + man_node_delete(m, m->last); + + return(1); +} + + +static int post_nf(struct man *m) { @@ -179,8 +201,10 @@ post_TH(struct man *m) if (n && (n = n->next)) m->meta.vol = mandoc_strdup(n->string); - n = m->last; - man_node_unlink(m, n); - man_node_freelist(n); + /* + * Remove the `TH' node after we've processed it for our + * meta-data. + */ + man_node_delete(m, m->last); return(1); } |