version 1.253, 2015/01/22 22:51:43 |
version 1.260, 2015/02/06 16:06:25 |
|
|
ROFF_minss, |
ROFF_minss, |
ROFF_mk, |
ROFF_mk, |
ROFF_mso, |
ROFF_mso, |
/* MAN_na; ignored in mdoc(7) */ |
ROFF_na, |
ROFF_ne, |
ROFF_ne, |
/* MAN_nf; ignored in mdoc(7) */ |
/* MAN_nf; ignored in mdoc(7) */ |
ROFF_nh, |
ROFF_nh, |
Line 580 static struct roffmac roffs[ROFF_MAX] = { |
|
Line 580 static struct roffmac roffs[ROFF_MAX] = { |
|
{ "minss", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "minss", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "mk", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "mk", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "mso", roff_insec, NULL, NULL, 0, NULL }, |
{ "mso", roff_insec, NULL, NULL, 0, NULL }, |
|
{ "na", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ne", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ne", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "nh", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "nh", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "nhychar", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "nhychar", roff_line_ignore, NULL, NULL, 0, NULL }, |
Line 608 static struct roffmac roffs[ROFF_MAX] = { |
|
Line 609 static struct roffmac roffs[ROFF_MAX] = { |
|
{ "po", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "po", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ps", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ps", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "psbb", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "psbb", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "pshape", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "pshape", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "pso", roff_insec, NULL, NULL, 0, NULL }, |
{ "pso", roff_insec, NULL, NULL, 0, NULL }, |
{ "ptr", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ptr", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "pvs", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "pvs", roff_line_ignore, NULL, NULL, 0, NULL }, |
Line 640 static struct roffmac roffs[ROFF_MAX] = { |
|
Line 641 static struct roffmac roffs[ROFF_MAX] = { |
|
{ "sv", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "sv", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "sy", roff_insec, NULL, NULL, 0, NULL }, |
{ "sy", roff_insec, NULL, NULL, 0, NULL }, |
{ "T&", roff_T_, NULL, NULL, 0, NULL }, |
{ "T&", roff_T_, NULL, NULL, 0, NULL }, |
{ "ta", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ta", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "tc", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "tc", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "TE", roff_TE, NULL, NULL, 0, NULL }, |
{ "TE", roff_TE, NULL, NULL, 0, NULL }, |
{ "TH", roff_TH, NULL, NULL, 0, NULL }, |
{ "TH", roff_TH, NULL, NULL, 0, NULL }, |
{ "ti", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "ti", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "tkf", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "tkf", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "tl", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "tl", roff_unsupp, NULL, NULL, 0, NULL }, |
{ "tm", roff_line_ignore, NULL, NULL, 0, NULL }, |
{ "tm", roff_line_ignore, NULL, NULL, 0, NULL }, |
Line 1201 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
Line 1202 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
if (r->eqn != NULL) |
if (r->eqn != NULL) |
return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs)); |
return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs)); |
if (r->tbl != NULL && ( ! ctl || buf->buf[pos] == '\0')) |
if (r->tbl != NULL && ( ! ctl || buf->buf[pos] == '\0')) |
return(tbl_read(r->tbl, ln, buf->buf, pos)); |
return(tbl_read(r->tbl, ln, buf->buf, ppos)); |
if ( ! ctl) |
if ( ! ctl) |
return(roff_parsetext(buf, pos, offs)); |
return(roff_parsetext(buf, pos, offs)); |
|
|
Line 1236 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
Line 1237 roff_parseln(struct roff *r, int ln, struct buf *buf, |
|
if (r->tbl != NULL && (t == ROFF_MAX || t == ROFF_TS)) { |
if (r->tbl != NULL && (t == ROFF_MAX || t == ROFF_TS)) { |
mandoc_msg(MANDOCERR_TBLMACRO, r->parse, |
mandoc_msg(MANDOCERR_TBLMACRO, r->parse, |
ln, pos, buf->buf + spos); |
ln, pos, buf->buf + spos); |
return(ROFF_IGN); |
if (t == ROFF_TS) |
|
return(ROFF_IGN); |
|
while (buf->buf[pos] != '\0' && buf->buf[pos] != ' ') |
|
pos++; |
|
while (buf->buf[pos] != '\0' && buf->buf[pos] == ' ') |
|
pos++; |
|
return(tbl_read(r->tbl, ln, buf->buf, pos)); |
} |
} |
|
|
/* |
/* |
Line 1641 roff_getnum(const char *v, int *pos, int *res) |
|
Line 1648 roff_getnum(const char *v, int *pos, int *res) |
|
if (n) |
if (n) |
*res = -*res; |
*res = -*res; |
|
|
*pos = p; |
/* Each number may be followed by one optional scaling unit. */ |
return 1; |
|
|
switch (v[p]) { |
|
case 'f': |
|
*res *= 65536; |
|
break; |
|
case 'i': |
|
*res *= 240; |
|
break; |
|
case 'c': |
|
*res *= 240; |
|
*res /= 2.54; |
|
break; |
|
case 'v': |
|
/* FALLTROUGH */ |
|
case 'P': |
|
*res *= 40; |
|
break; |
|
case 'm': |
|
/* FALLTROUGH */ |
|
case 'n': |
|
*res *= 24; |
|
break; |
|
case 'p': |
|
*res *= 10; |
|
*res /= 3; |
|
break; |
|
case 'u': |
|
break; |
|
case 'M': |
|
*res *= 6; |
|
*res /= 25; |
|
break; |
|
default: |
|
p--; |
|
break; |
|
} |
|
|
|
*pos = p + 1; |
|
return(1); |
} |
} |
|
|
/* |
/* |
Line 2331 roff_TE(ROFF_ARGS) |
|
Line 2376 roff_TE(ROFF_ARGS) |
|
if (NULL == r->tbl) |
if (NULL == r->tbl) |
mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, |
mandoc_msg(MANDOCERR_BLK_NOTOPEN, r->parse, |
ln, ppos, "TE"); |
ln, ppos, "TE"); |
else |
else if ( ! tbl_end(&r->tbl)) { |
tbl_end(&r->tbl); |
free(buf->buf); |
|
buf->buf = mandoc_strdup(".sp"); |
|
buf->sz = 4; |
|
return(ROFF_REPARSE); |
|
} |
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
|
|
Line 2490 roff_cc(ROFF_ARGS) |
|
Line 2538 roff_cc(ROFF_ARGS) |
|
r->control = 0; |
r->control = 0; |
|
|
if (*p != '\0') |
if (*p != '\0') |
mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL); |
mandoc_vmsg(MANDOCERR_ARG_EXCESS, r->parse, |
|
ln, p - buf->buf, "cc ... %s", p); |
|
|
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
Line 2505 roff_tr(ROFF_ARGS) |
|
Line 2554 roff_tr(ROFF_ARGS) |
|
p = buf->buf + pos; |
p = buf->buf + pos; |
|
|
if (*p == '\0') { |
if (*p == '\0') { |
mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL); |
mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, ln, ppos, "tr"); |
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
|
|
Line 2533 roff_tr(ROFF_ARGS) |
|
Line 2582 roff_tr(ROFF_ARGS) |
|
} |
} |
ssz = (size_t)(p - second); |
ssz = (size_t)(p - second); |
} else if (*second == '\0') { |
} else if (*second == '\0') { |
mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, |
mandoc_vmsg(MANDOCERR_TR_ODD, r->parse, |
ln, (int)(p - buf->buf), NULL); |
ln, first - buf->buf, "tr %s", first); |
second = " "; |
second = " "; |
p--; |
p--; |
} |
} |