version 1.11, 2018/12/04 02:53:51 |
version 1.14, 2018/12/14 05:18:03 |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <stddef.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
Line 64 roff_valid_br(ROFF_VALID_ARGS) |
|
Line 64 roff_valid_br(ROFF_VALID_ARGS) |
|
struct roff_node *np; |
struct roff_node *np; |
|
|
if (n->child != NULL) |
if (n->child != NULL) |
mandoc_vmsg(MANDOCERR_ARG_SKIP, man->parse, |
mandoc_msg(MANDOCERR_ARG_SKIP, |
n->line, n->pos, "br %s", n->child->string); |
n->line, n->pos, "br %s", n->child->string); |
|
|
|
if (n->next != NULL && n->next->type == ROFFT_TEXT && |
|
*n->next->string == ' ') { |
|
mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, |
|
"br before text line with leading blank"); |
|
roff_node_delete(man, n); |
|
return; |
|
} |
|
|
if ((np = n->prev) == NULL) |
if ((np = n->prev) == NULL) |
return; |
return; |
|
|
Line 74 roff_valid_br(ROFF_VALID_ARGS) |
|
Line 82 roff_valid_br(ROFF_VALID_ARGS) |
|
case ROFF_br: |
case ROFF_br: |
case ROFF_sp: |
case ROFF_sp: |
case MDOC_Pp: |
case MDOC_Pp: |
mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse, |
mandoc_msg(MANDOCERR_PAR_SKIP, |
n->line, n->pos, "br after %s", roff_name[np->tok]); |
n->line, n->pos, "br after %s", roff_name[np->tok]); |
roff_node_delete(man, n); |
roff_node_delete(man, n); |
break; |
break; |
Line 120 roff_valid_ft(ROFF_VALID_ARGS) |
|
Line 128 roff_valid_ft(ROFF_VALID_ARGS) |
|
break; |
break; |
} |
} |
|
|
mandoc_vmsg(MANDOCERR_FT_BAD, man->parse, |
mandoc_msg(MANDOCERR_FT_BAD, n->line, n->pos, "ft %s", cp); |
n->line, n->pos, "ft %s", cp); |
|
roff_node_delete(man, n); |
roff_node_delete(man, n); |
} |
} |
|
|
Line 131 roff_valid_sp(ROFF_VALID_ARGS) |
|
Line 138 roff_valid_sp(ROFF_VALID_ARGS) |
|
struct roff_node *np; |
struct roff_node *np; |
|
|
if (n->child != NULL && n->child->next != NULL) |
if (n->child != NULL && n->child->next != NULL) |
mandoc_vmsg(MANDOCERR_ARG_EXCESS, man->parse, |
mandoc_msg(MANDOCERR_ARG_EXCESS, |
n->child->next->line, n->child->next->pos, |
n->child->next->line, n->child->next->pos, |
"sp ... %s", n->child->next->string); |
"sp ... %s", n->child->next->string); |
|
|
Line 140 roff_valid_sp(ROFF_VALID_ARGS) |
|
Line 147 roff_valid_sp(ROFF_VALID_ARGS) |
|
|
|
switch (np->tok) { |
switch (np->tok) { |
case ROFF_br: |
case ROFF_br: |
mandoc_msg(MANDOCERR_PAR_SKIP, man->parse, |
mandoc_msg(MANDOCERR_PAR_SKIP, |
np->line, np->pos, "br before sp"); |
np->line, np->pos, "br before sp"); |
roff_node_delete(man, np); |
roff_node_delete(man, np); |
break; |
break; |
case MDOC_Pp: |
case MDOC_Pp: |
mandoc_msg(MANDOCERR_PAR_SKIP, man->parse, |
mandoc_msg(MANDOCERR_PAR_SKIP, |
n->line, n->pos, "sp after Pp"); |
n->line, n->pos, "sp after Pp"); |
roff_node_delete(man, n); |
roff_node_delete(man, n); |
break; |
break; |