version 1.234, 2014/10/20 19:04:45 |
version 1.235, 2014/10/25 14:35:37 |
Line 207 static const char *roff_getstrn(const struct roff *, |
|
Line 207 static const char *roff_getstrn(const struct roff *, |
|
static enum rofferr roff_it(ROFF_ARGS); |
static enum rofferr roff_it(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_line_ignore(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
static enum rofferr roff_nr(ROFF_ARGS); |
static void roff_openeqn(struct roff *, const char *, |
|
int, int, const char *); |
|
static enum rofft roff_parse(struct roff *, char *, int *, |
static enum rofft roff_parse(struct roff *, char *, int *, |
int, int); |
int, int); |
static enum rofferr roff_parsetext(char **, size_t *, int, int *); |
static enum rofferr roff_parsetext(char **, size_t *, int, int *); |
Line 1469 roff_getop(const char *v, int *pos, char *res) |
|
Line 1467 roff_getop(const char *v, int *pos, char *res) |
|
* or a single signed integer number. |
* or a single signed integer number. |
*/ |
*/ |
static int |
static int |
roff_evalpar(struct roff *r, int ln, |
roff_evalpar(struct roff *r, int ln, |
const char *v, int *pos, int *res) |
const char *v, int *pos, int *res) |
{ |
{ |
|
|
Line 1499 roff_evalpar(struct roff *r, int ln, |
|
Line 1497 roff_evalpar(struct roff *r, int ln, |
|
* Proceed left to right, there is no concept of precedence. |
* Proceed left to right, there is no concept of precedence. |
*/ |
*/ |
static int |
static int |
roff_evalnum(struct roff *r, int ln, const char *v, |
roff_evalnum(struct roff *r, int ln, const char *v, |
int *pos, int *res, int skipwhite) |
int *pos, int *res, int skipwhite) |
{ |
{ |
int mypos, operand2; |
int mypos, operand2; |
Line 1551 roff_evalnum(struct roff *r, int ln, const char *v, |
|
Line 1549 roff_evalnum(struct roff *r, int ln, const char *v, |
|
break; |
break; |
case '/': |
case '/': |
if (0 == operand2) { |
if (0 == operand2) { |
mandoc_msg(MANDOCERR_DIVZERO, |
mandoc_msg(MANDOCERR_DIVZERO, |
r->parse, ln, *pos, v); |
r->parse, ln, *pos, v); |
*res = 0; |
*res = 0; |
break; |
break; |
Line 1928 roff_eqndelim(struct roff *r, char **bufp, size_t *szp |
|
Line 1926 roff_eqndelim(struct roff *r, char **bufp, size_t *szp |
|
return(ROFF_REPARSE); |
return(ROFF_REPARSE); |
} |
} |
|
|
static void |
static enum rofferr |
roff_openeqn(struct roff *r, const char *name, int line, |
roff_EQ(ROFF_ARGS) |
int offs, const char *buf) |
|
{ |
{ |
struct eqn_node *e; |
struct eqn_node *e; |
int poff; |
|
|
|
assert(NULL == r->eqn); |
assert(NULL == r->eqn); |
e = eqn_alloc(name, offs, line, r->parse); |
e = eqn_alloc(ppos, ln, r->parse); |
|
|
if (r->last_eqn) { |
if (r->last_eqn) { |
r->last_eqn->next = e; |
r->last_eqn->next = e; |
Line 1948 roff_openeqn(struct roff *r, const char *name, int lin |
|
Line 1944 roff_openeqn(struct roff *r, const char *name, int lin |
|
|
|
r->eqn = r->last_eqn = e; |
r->eqn = r->last_eqn = e; |
|
|
if (buf) { |
if ((*bufp)[pos]) |
poff = 0; |
mandoc_vmsg(MANDOCERR_ARG_SKIP, r->parse, ln, pos, |
eqn_read(&r->eqn, line, buf, offs, &poff); |
".EQ %s", *bufp + pos); |
} |
|
} |
|
|
|
static enum rofferr |
|
roff_EQ(ROFF_ARGS) |
|
{ |
|
|
|
roff_openeqn(r, *bufp + pos, ln, ppos, NULL); |
|
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
|
|