version 1.57, 2009/03/08 20:57:35 |
version 1.58, 2009/03/09 13:04:01 |
Line 38 static int mdoc_node_append(struct mdoc *, |
|
Line 38 static int mdoc_node_append(struct mdoc *, |
|
|
|
static int parsetext(struct mdoc *, int, char *); |
static int parsetext(struct mdoc *, int, char *); |
static int parsemacro(struct mdoc *, int, char *); |
static int parsemacro(struct mdoc *, int, char *); |
|
static int macrowarn(struct mdoc *, int, const char *); |
|
|
|
|
const char *const __mdoc_macronames[MDOC_MAX] = { |
const char *const __mdoc_macronames[MDOC_MAX] = { |
Line 495 parsetext(struct mdoc *mdoc, int line, char *buf) |
|
Line 496 parsetext(struct mdoc *mdoc, int line, char *buf) |
|
} |
} |
|
|
|
|
|
static int |
|
macrowarn(struct mdoc *m, int ln, const char *buf) |
|
{ |
|
if ( ! (MDOC_IGN_MACRO & m->pflags)) |
|
return(mdoc_perr(m, ln, 1, "unknown macro: %s%s", |
|
buf, buf[3] ? "..." : "")); |
|
return(mdoc_pwarn(m, ln, 1, WARN_SYNTAX, |
|
"unknown macro: %s%s", |
|
buf, buf[3] ? "..." : "")); |
|
} |
|
|
|
|
|
|
/* |
/* |
* Parse a macro line, that is, a line beginning with the control |
* Parse a macro line, that is, a line beginning with the control |
* character. |
* character. |
Line 525 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 539 parsemacro(struct mdoc *m, int ln, char *buf) |
|
mac[i - 1] = 0; |
mac[i - 1] = 0; |
|
|
if (i == 5 || i <= 2) { |
if (i == 5 || i <= 2) { |
(void)mdoc_perr(m, ln, 1, "unknown macro: %s%s", |
if ( ! macrowarn(m, ln, mac)) |
mac, i == 5 ? "..." : ""); |
goto err; |
goto err; |
return(1); |
} |
} |
|
|
if (MDOC_MAX == (c = mdoc_tokhash_find(m->htab, mac))) { |
if (MDOC_MAX == (c = mdoc_tokhash_find(m->htab, mac))) { |
(void)mdoc_perr(m, ln, 1, "unknown macro: %s", mac); |
if ( ! macrowarn(m, ln, mac)) |
goto err; |
goto err; |
|
return(1); |
} |
} |
|
|
/* The macro is sane. Jump to the next word. */ |
/* The macro is sane. Jump to the next word. */ |