version 1.96, 2009/07/27 19:43:02 |
version 1.99, 2009/08/13 11:43:24 |
Line 29 const char *const __mdoc_merrnames[MERRMAX] = { |
|
Line 29 const char *const __mdoc_merrnames[MERRMAX] = { |
|
"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 70 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 361 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)); |
} |
} |
|
|
Line 677 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 717 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; |
|
|