version 1.254, 2015/10/12 00:08:15 |
version 1.256, 2015/10/30 19:04:16 |
Line 121 mdoc_macro(MACRO_PROT_ARGS) |
|
Line 121 mdoc_macro(MACRO_PROT_ARGS) |
|
{ |
{ |
assert(tok > TOKEN_NONE && tok < MDOC_MAX); |
assert(tok > TOKEN_NONE && tok < MDOC_MAX); |
|
|
if (mdoc->flags & MDOC_PBODY) { |
|
if (tok == MDOC_Dt) { |
|
mandoc_vmsg(MANDOCERR_DT_LATE, |
|
mdoc->parse, line, ppos, |
|
"Dt %s", buf + *pos); |
|
return; |
|
} |
|
} else if ( ! (mdoc_macros[tok].flags & MDOC_PROLOGUE)) { |
|
if (mdoc->meta.title == NULL) { |
|
mandoc_vmsg(MANDOCERR_DT_NOTITLE, |
|
mdoc->parse, line, ppos, "%s %s", |
|
mdoc_macronames[tok], buf + *pos); |
|
mdoc->meta.title = mandoc_strdup("UNTITLED"); |
|
} |
|
if (NULL == mdoc->meta.vol) |
|
mdoc->meta.vol = mandoc_strdup("LOCAL"); |
|
mdoc->flags |= MDOC_PBODY; |
|
} |
|
(*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf); |
(*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf); |
} |
} |
|
|
Line 223 mdoc_node_relink(struct roff_man *mdoc, struct roff_no |
|
Line 205 mdoc_node_relink(struct roff_man *mdoc, struct roff_no |
|
{ |
{ |
|
|
roff_node_unlink(mdoc, p); |
roff_node_unlink(mdoc, p); |
|
p->prev = p->next = NULL; |
roff_node_append(mdoc, p); |
roff_node_append(mdoc, p); |
} |
} |
|
|
Line 319 mdoc_ptext(struct roff_man *mdoc, int line, char *buf, |
|
Line 302 mdoc_ptext(struct roff_man *mdoc, int line, char *buf, |
|
* behaviour that we want to work around it. |
* behaviour that we want to work around it. |
*/ |
*/ |
roff_elem_alloc(mdoc, line, offs, MDOC_sp); |
roff_elem_alloc(mdoc, line, offs, MDOC_sp); |
|
mdoc->last->flags |= MDOC_VALID | MDOC_ENDED; |
mdoc->next = ROFF_NEXT_SIBLING; |
mdoc->next = ROFF_NEXT_SIBLING; |
mdoc_valid_post(mdoc); |
|
return 1; |
return 1; |
} |
} |
|
|
Line 494 mdoc_isdelim(const char *p) |
|
Line 477 mdoc_isdelim(const char *p) |
|
return DELIM_MIDDLE; |
return DELIM_MIDDLE; |
|
|
return DELIM_NONE; |
return DELIM_NONE; |
|
} |
|
|
|
void |
|
mdoc_validate(struct roff_man *mdoc) |
|
{ |
|
|
|
mdoc->last = mdoc->first; |
|
mdoc_node_validate(mdoc); |
|
mdoc_state_reset(mdoc); |
} |
} |