version 1.180, 2018/08/26 16:21:23 |
version 1.181, 2018/12/14 05:18:02 |
Line 122 man_ptext(struct roff_man *man, int line, char *buf, i |
|
Line 122 man_ptext(struct roff_man *man, int line, char *buf, i |
|
|
|
if (buf[i] == '\0') { |
if (buf[i] == '\0') { |
if (man->flags & (MAN_ELINE | MAN_BLINE)) { |
if (man->flags & (MAN_ELINE | MAN_BLINE)) { |
mandoc_msg(MANDOCERR_BLK_BLANK, man->parse, |
mandoc_msg(MANDOCERR_BLK_BLANK, line, 0, NULL); |
line, 0, NULL); |
|
return 1; |
return 1; |
} |
} |
if (man->last->tok == MAN_SH || man->last->tok == MAN_SS) |
if (man->last->tok == MAN_SH || man->last->tok == MAN_SS) |
Line 148 man_ptext(struct roff_man *man, int line, char *buf, i |
|
Line 147 man_ptext(struct roff_man *man, int line, char *buf, i |
|
|
|
if (' ' == buf[i - 1] || '\t' == buf[i - 1]) { |
if (' ' == buf[i - 1] || '\t' == buf[i - 1]) { |
if (i > 1 && '\\' != buf[i - 2]) |
if (i > 1 && '\\' != buf[i - 2]) |
mandoc_msg(MANDOCERR_SPACE_EOL, man->parse, |
mandoc_msg(MANDOCERR_SPACE_EOL, line, i - 1, NULL); |
line, i - 1, NULL); |
|
|
|
for (--i; i && ' ' == buf[i]; i--) |
for (--i; i && ' ' == buf[i]; i--) |
/* Spin back to non-space. */ ; |
/* Spin back to non-space. */ ; |
Line 194 man_pmacro(struct roff_man *man, int ln, char *buf, in |
|
Line 192 man_pmacro(struct roff_man *man, int ln, char *buf, in |
|
if (sz > 0 && sz < 4) |
if (sz > 0 && sz < 4) |
tok = roffhash_find(man->manmac, buf + ppos, sz); |
tok = roffhash_find(man->manmac, buf + ppos, sz); |
if (tok == TOKEN_NONE) { |
if (tok == TOKEN_NONE) { |
mandoc_msg(MANDOCERR_MACRO, man->parse, |
mandoc_msg(MANDOCERR_MACRO, ln, ppos, "%s", buf + ppos - 1); |
ln, ppos, buf + ppos - 1); |
|
return 1; |
return 1; |
} |
} |
|
|
Line 225 man_pmacro(struct roff_man *man, int ln, char *buf, in |
|
Line 222 man_pmacro(struct roff_man *man, int ln, char *buf, in |
|
*/ |
*/ |
|
|
if (buf[offs] == '\0' && buf[offs - 1] == ' ') |
if (buf[offs] == '\0' && buf[offs - 1] == ' ') |
mandoc_msg(MANDOCERR_SPACE_EOL, man->parse, |
mandoc_msg(MANDOCERR_SPACE_EOL, ln, offs - 1, NULL); |
ln, offs - 1, NULL); |
|
|
|
/* |
/* |
* Some macros break next-line scopes; otherwise, remember |
* Some macros break next-line scopes; otherwise, remember |
Line 299 man_breakscope(struct roff_man *man, int tok) |
|
Line 295 man_breakscope(struct roff_man *man, int tok) |
|
== MAN_NSCOPED) |
== MAN_NSCOPED) |
n = n->parent; |
n = n->parent; |
|
|
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, |
mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, |
n->line, n->pos, "%s breaks %s", |
"%s breaks %s", roff_name[tok], roff_name[n->tok]); |
roff_name[tok], roff_name[n->tok]); |
|
|
|
roff_node_delete(man, n); |
roff_node_delete(man, n); |
man->flags &= ~MAN_ELINE; |
man->flags &= ~MAN_ELINE; |
Line 341 man_breakscope(struct roff_man *man, int tok) |
|
Line 336 man_breakscope(struct roff_man *man, int tok) |
|
assert(n->type == ROFFT_BLOCK); |
assert(n->type == ROFFT_BLOCK); |
assert(man_macro(n->tok)->flags & MAN_BSCOPED); |
assert(man_macro(n->tok)->flags & MAN_BSCOPED); |
|
|
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, |
mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, |
n->line, n->pos, "%s breaks %s", |
"%s breaks %s", roff_name[tok], roff_name[n->tok]); |
roff_name[tok], roff_name[n->tok]); |
|
|
|
roff_node_delete(man, n); |
roff_node_delete(man, n); |
man->flags &= ~MAN_BLINE; |
man->flags &= ~MAN_BLINE; |
Line 358 man_state(struct roff_man *man, struct roff_node *n) |
|
Line 352 man_state(struct roff_man *man, struct roff_node *n) |
|
case MAN_nf: |
case MAN_nf: |
case MAN_EX: |
case MAN_EX: |
if (man->flags & MAN_LITERAL && ! (n->flags & NODE_VALID)) |
if (man->flags & MAN_LITERAL && ! (n->flags & NODE_VALID)) |
mandoc_msg(MANDOCERR_NF_SKIP, man->parse, |
mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "nf"); |
n->line, n->pos, "nf"); |
|
man->flags |= MAN_LITERAL; |
man->flags |= MAN_LITERAL; |
break; |
break; |
case MAN_fi: |
case MAN_fi: |
case MAN_EE: |
case MAN_EE: |
if ( ! (man->flags & MAN_LITERAL) && |
if ( ! (man->flags & MAN_LITERAL) && |
! (n->flags & NODE_VALID)) |
! (n->flags & NODE_VALID)) |
mandoc_msg(MANDOCERR_FI_SKIP, man->parse, |
mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "fi"); |
n->line, n->pos, "fi"); |
|
man->flags &= ~MAN_LITERAL; |
man->flags &= ~MAN_LITERAL; |
break; |
break; |
default: |
default: |