version 1.93, 2009/07/17 10:56:57 |
version 1.99, 2009/08/13 11:43:24 |
|
|
|
|
const char *const __mdoc_merrnames[MERRMAX] = { |
const char *const __mdoc_merrnames[MERRMAX] = { |
"trailing whitespace", /* ETAILWS */ |
"trailing whitespace", /* ETAILWS */ |
"empty last list column", /* ECOLEMPTY */ |
|
"argument-like parameter", /* EARGVPARM */ |
|
"unexpected quoted parameter", /* EQUOTPARM */ |
"unexpected quoted parameter", /* EQUOTPARM */ |
"unterminated quoted parameter", /* EQUOTTERM */ |
"unterminated quoted parameter", /* EQUOTTERM */ |
"system: malloc error", /* EMALLOC */ |
"system: malloc error", /* EMALLOC */ |
"argument parameter suggested", /* EARGVAL */ |
"argument parameter suggested", /* EARGVAL */ |
"macro not callable", /* ENOCALL */ |
|
"macro disallowed in prologue", /* EBODYPROL */ |
"macro disallowed in prologue", /* EBODYPROL */ |
"macro disallowed in body", /* EPROLBODY */ |
"macro disallowed in body", /* EPROLBODY */ |
"text disallowed in prologue", /* ETEXTPROL */ |
"text disallowed in prologue", /* ETEXTPROL */ |
Line 72 const char *const __mdoc_merrnames[MERRMAX] = { |
|
Line 69 const char *const __mdoc_merrnames[MERRMAX] = { |
|
"superfluous width argument", /* ENOWIDTH */ |
"superfluous width argument", /* ENOWIDTH */ |
"system: utsname error", /* EUTSNAME */ |
"system: utsname error", /* EUTSNAME */ |
"obsolete macro", /* EOBS */ |
"obsolete macro", /* EOBS */ |
"macro-like parameter", /* EMACPARM */ |
|
"end-of-line scope violation", /* EIMPBRK */ |
"end-of-line scope violation", /* EIMPBRK */ |
"empty macro ignored", /* EIGNE */ |
"empty macro ignored", /* EIGNE */ |
"unclosed explicit scope", /* EOPEN */ |
"unclosed explicit scope", /* EOPEN */ |
|
|
mdoc_macro(struct mdoc *m, int tok, |
mdoc_macro(struct mdoc *m, int tok, |
int ln, int pp, int *pos, char *buf) |
int ln, int pp, int *pos, char *buf) |
{ |
{ |
|
/* |
|
* If we're in the prologue, deny "body" macros. Similarly, if |
|
* we're in the body, deny prologue calls. |
|
*/ |
if (MDOC_PROLOGUE & mdoc_macros[tok].flags && |
if (MDOC_PROLOGUE & mdoc_macros[tok].flags && |
MDOC_PBODY & m->flags) |
MDOC_PBODY & m->flags) |
return(mdoc_perr(m, ln, pp, EPROLBODY)); |
return(mdoc_perr(m, ln, pp, EPROLBODY)); |
Line 363 mdoc_macro(struct mdoc *m, int tok, |
|
Line 362 mdoc_macro(struct mdoc *m, int tok, |
|
! (MDOC_PBODY & m->flags)) |
! (MDOC_PBODY & m->flags)) |
return(mdoc_perr(m, ln, pp, EBODYPROL)); |
return(mdoc_perr(m, ln, pp, EBODYPROL)); |
|
|
if (1 != pp && ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) |
|
return(mdoc_perr(m, ln, pp, ENOCALL)); |
|
|
|
return((*mdoc_macros[tok].fp)(m, tok, ln, pp, pos, buf)); |
return((*mdoc_macros[tok].fp)(m, tok, ln, pp, pos, buf)); |
} |
} |
|
|
|
|
macrowarn(struct mdoc *m, int ln, const char *buf) |
macrowarn(struct mdoc *m, int ln, const char *buf) |
{ |
{ |
if ( ! (MDOC_IGN_MACRO & m->pflags)) |
if ( ! (MDOC_IGN_MACRO & m->pflags)) |
return(mdoc_verr(m, ln, 1, |
return(mdoc_verr(m, ln, 0, |
"unknown macro: %s%s", |
"unknown macro: %s%s", |
buf, strlen(buf) > 3 ? "..." : "")); |
buf, strlen(buf) > 3 ? "..." : "")); |
return(mdoc_vwarn(m, ln, 1, "unknown macro: %s%s", |
return(mdoc_vwarn(m, ln, 0, "unknown macro: %s%s", |
buf, strlen(buf) > 3 ? "..." : "")); |
buf, strlen(buf) > 3 ? "..." : "")); |
} |
} |
|
|
Line 679 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 675 parsemacro(struct mdoc *m, int ln, char *buf) |
|
|
|
/* Empty lines are ignored. */ |
/* Empty lines are ignored. */ |
|
|
|
/* FIXME: this can accept `. xx' like libman! */ |
|
|
if (0 == buf[1]) |
if (0 == buf[1]) |
return(1); |
return(1); |
|
|
Line 719 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 717 parsemacro(struct mdoc *m, int ln, char *buf) |
|
while (buf[i] && ' ' == buf[i]) |
while (buf[i] && ' ' == buf[i]) |
i++; |
i++; |
|
|
/* Begin recursive parse sequence. */ |
/* |
|
* Begin recursive parse sequence. Since we're at the start of |
|
* the line, we don't need to do callable/parseable checks. |
|
*/ |
if ( ! mdoc_macro(m, c, ln, 1, &i, buf)) |
if ( ! mdoc_macro(m, c, ln, 1, &i, buf)) |
goto err; |
goto err; |
|
|