version 1.6, 2011/07/17 12:13:37 |
version 1.7, 2011/07/17 12:52:54 |
Line 54 eqn_read(struct eqn_node **epp, int ln, |
|
Line 54 eqn_read(struct eqn_node **epp, int ln, |
|
return(ROFF_IGN); |
return(ROFF_IGN); |
|
|
if (6 == sz && 0 == strncmp("define", start, 6)) { |
if (6 == sz && 0 == strncmp("define", start, 6)) { |
/* |
if (end && '"' == *end) |
* TODO: warn if key is quoted: groff doesn't seem to |
mandoc_msg(MANDOCERR_EQNQUOTE, |
* like this (I don't know why). |
ep->parse, ln, pos, NULL); |
*/ |
|
start = eqn_nexttok(ep->parse, ln, pos, &end, &sz); |
start = eqn_nexttok(ep->parse, ln, pos, &end, &sz); |
|
|
for (i = 0; i < (int)ep->defsz; i++) { |
for (i = 0; i < (int)ep->defsz; i++) { |
if (ep->defs[i].keysz != sz) |
if (ep->defs[i].keysz != sz) |
continue; |
continue; |
Line 150 eqn_free(struct eqn_node *p) |
|
Line 151 eqn_free(struct eqn_node *p) |
|
free(p); |
free(p); |
} |
} |
|
|
|
/* |
|
* Return the current equation token setting "next" on the next one, |
|
* setting the token size in "sz". |
|
* This does the Right Thing for quoted strings, too. |
|
* Returns NULL if no more tokens exist. |
|
*/ |
static const char * |
static const char * |
eqn_nexttok(struct mparse *mp, int ln, int pos, |
eqn_nexttok(struct mparse *mp, int ln, int pos, |
const char **next, size_t *sz) |
const char **next, size_t *sz) |
Line 177 eqn_nexttok(struct mparse *mp, int ln, int pos, |
|
Line 184 eqn_nexttok(struct mparse *mp, int ln, int pos, |
|
while (' ' == **next) |
while (' ' == **next) |
(*next)++; |
(*next)++; |
} else { |
} else { |
|
/* |
|
* XXX: groff gets confused by this and doesn't always |
|
* do the "right thing" (just terminate it and warn |
|
* about it). |
|
*/ |
if (q) |
if (q) |
mandoc_msg(MANDOCERR_BADQUOTE, |
mandoc_msg(MANDOCERR_BADQUOTE, |
mp, ln, pos, NULL); |
mp, ln, pos, NULL); |