version 1.253, 2015/10/06 18:32:19 |
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 182 mdoc_block_alloc(struct roff_man *mdoc, int line, int |
|
Line 164 mdoc_block_alloc(struct roff_man *mdoc, int line, int |
|
|
|
switch (tok) { |
switch (tok) { |
case MDOC_Bd: |
case MDOC_Bd: |
/* FALLTHROUGH */ |
|
case MDOC_Bf: |
case MDOC_Bf: |
/* FALLTHROUGH */ |
|
case MDOC_Bl: |
case MDOC_Bl: |
/* FALLTHROUGH */ |
|
case MDOC_En: |
case MDOC_En: |
/* FALLTHROUGH */ |
|
case MDOC_Rs: |
case MDOC_Rs: |
p->norm = mandoc_calloc(1, sizeof(union mdoc_data)); |
p->norm = mandoc_calloc(1, sizeof(union mdoc_data)); |
break; |
break; |
Line 227 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 323 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 472 mdoc_isdelim(const char *p) |
|
Line 451 mdoc_isdelim(const char *p) |
|
if ('\0' == p[1]) |
if ('\0' == p[1]) |
switch (p[0]) { |
switch (p[0]) { |
case '(': |
case '(': |
/* FALLTHROUGH */ |
|
case '[': |
case '[': |
return DELIM_OPEN; |
return DELIM_OPEN; |
case '|': |
case '|': |
return DELIM_MIDDLE; |
return DELIM_MIDDLE; |
case '.': |
case '.': |
/* FALLTHROUGH */ |
|
case ',': |
case ',': |
/* FALLTHROUGH */ |
|
case ';': |
case ';': |
/* FALLTHROUGH */ |
|
case ':': |
case ':': |
/* FALLTHROUGH */ |
|
case '?': |
case '?': |
/* FALLTHROUGH */ |
|
case '!': |
case '!': |
/* FALLTHROUGH */ |
|
case ')': |
case ')': |
/* FALLTHROUGH */ |
|
case ']': |
case ']': |
return DELIM_CLOSE; |
return DELIM_CLOSE; |
default: |
default: |
Line 506 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); |
} |
} |