version 1.6, 2009/01/09 14:45:44 |
version 1.7, 2009/01/12 12:52:21 |
Line 159 post_sh(struct mdoc *mdoc) |
|
Line 159 post_sh(struct mdoc *mdoc) |
|
if (MDOC_HEAD != mdoc->last->type) |
if (MDOC_HEAD != mdoc->last->type) |
return(1); |
return(1); |
|
|
assert(MDOC_Sh == mdoc->last->data.head.tok); |
assert(MDOC_Sh == mdoc->last->tok); |
|
|
n = mdoc->last->child; |
n = mdoc->last->child; |
assert(n); |
assert(n); |
Line 189 post_dt(struct mdoc *mdoc) |
|
Line 189 post_dt(struct mdoc *mdoc) |
|
struct mdoc_node *n; |
struct mdoc_node *n; |
|
|
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_Dt == mdoc->last->data.elem.tok); |
assert(MDOC_Dt == mdoc->last->tok); |
assert(0 == mdoc->meta.title[0]); |
assert(0 == mdoc->meta.title[0]); |
|
|
sz = META_TITLE_SZ; |
sz = META_TITLE_SZ; |
Line 236 post_os(struct mdoc *mdoc) |
|
Line 236 post_os(struct mdoc *mdoc) |
|
struct mdoc_node *n; |
struct mdoc_node *n; |
|
|
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_Os == mdoc->last->data.elem.tok); |
assert(MDOC_Os == mdoc->last->tok); |
assert(0 == mdoc->meta.os[0]); |
assert(0 == mdoc->meta.os[0]); |
|
|
sz = META_OS_SZ; |
sz = META_OS_SZ; |
Line 269 post_dd(struct mdoc *mdoc) |
|
Line 269 post_dd(struct mdoc *mdoc) |
|
struct mdoc_node *n; |
struct mdoc_node *n; |
|
|
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_ELEM == mdoc->last->type); |
assert(MDOC_Dd == mdoc->last->data.elem.tok); |
assert(MDOC_Dd == mdoc->last->tok); |
|
|
n = mdoc->last->child; |
n = mdoc->last->child; |
assert(0 == mdoc->meta.date); |
assert(0 == mdoc->meta.date); |
Line 317 mdoc_action_pre(struct mdoc *mdoc, struct mdoc_node *n |
|
Line 317 mdoc_action_pre(struct mdoc *mdoc, struct mdoc_node *n |
|
int |
int |
mdoc_action_post(struct mdoc *mdoc) |
mdoc_action_post(struct mdoc *mdoc) |
{ |
{ |
int t; |
|
|
|
switch (mdoc->last->type) { |
if (MDOC_TEXT == mdoc->last->type) |
case (MDOC_BODY): |
|
t = mdoc->last->data.body.tok; |
|
break; |
|
case (MDOC_ELEM): |
|
t = mdoc->last->data.elem.tok; |
|
break; |
|
case (MDOC_BLOCK): |
|
t = mdoc->last->data.block.tok; |
|
break; |
|
case (MDOC_HEAD): |
|
t = mdoc->last->data.head.tok; |
|
break; |
|
default: |
|
return(1); |
return(1); |
} |
if (MDOC_ROOT == mdoc->last->type) |
|
return(1); |
|
|
if (NULL == mdoc_actions[t].post) |
if (NULL == mdoc_actions[mdoc->last->tok].post) |
return(1); |
return(1); |
/* TODO: MDOC_Nm... ? */ |
/* TODO: MDOC_Nm... ? */ |
return((*mdoc_actions[t].post)(mdoc)); |
return((*mdoc_actions[mdoc->last->tok].post)(mdoc)); |
} |
} |