version 1.141, 2018/12/14 05:18:02 |
version 1.145, 2018/12/31 08:38:21 |
|
|
/* $OpenBSD$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org> |
Line 48 static void check_root(CHKARGS); |
|
Line 48 static void check_root(CHKARGS); |
|
static void check_text(CHKARGS); |
static void check_text(CHKARGS); |
|
|
static void post_AT(CHKARGS); |
static void post_AT(CHKARGS); |
|
static void post_EE(CHKARGS); |
|
static void post_EX(CHKARGS); |
static void post_IP(CHKARGS); |
static void post_IP(CHKARGS); |
static void post_OP(CHKARGS); |
static void post_OP(CHKARGS); |
static void post_SH(CHKARGS); |
static void post_SH(CHKARGS); |
Line 78 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
Line 80 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
NULL, /* I */ |
NULL, /* I */ |
NULL, /* IR */ |
NULL, /* IR */ |
NULL, /* RI */ |
NULL, /* RI */ |
NULL, /* nf */ |
|
NULL, /* fi */ |
|
NULL, /* RE */ |
NULL, /* RE */ |
check_part, /* RS */ |
check_part, /* RS */ |
NULL, /* DT */ |
NULL, /* DT */ |
Line 90 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
Line 90 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
NULL, /* SY */ |
NULL, /* SY */ |
NULL, /* YS */ |
NULL, /* YS */ |
post_OP, /* OP */ |
post_OP, /* OP */ |
NULL, /* EX */ |
post_EX, /* EX */ |
NULL, /* EE */ |
post_EE, /* EE */ |
post_UR, /* UR */ |
post_UR, /* UR */ |
NULL, /* UE */ |
NULL, /* UE */ |
post_UR, /* MT */ |
post_UR, /* MT */ |
Line 101 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
Line 101 static const v_check man_valids[MAN_MAX - MAN_TH] = { |
|
|
|
/* Validate the subtree rooted at man->last. */ |
/* Validate the subtree rooted at man->last. */ |
void |
void |
man_node_validate(struct roff_man *man) |
man_validate(struct roff_man *man) |
{ |
{ |
struct roff_node *n; |
struct roff_node *n; |
const v_check *cp; |
const v_check *cp; |
Line 128 man_node_validate(struct roff_man *man) |
|
Line 128 man_node_validate(struct roff_man *man) |
|
|
|
man->last = man->last->child; |
man->last = man->last->child; |
while (man->last != NULL) { |
while (man->last != NULL) { |
man_node_validate(man); |
man_validate(man); |
if (man->last == n) |
if (man->last == n) |
man->last = man->last->child; |
man->last = man->last->child; |
else |
else |
Line 153 man_node_validate(struct roff_man *man) |
|
Line 153 man_node_validate(struct roff_man *man) |
|
default: |
default: |
if (n->tok < ROFF_MAX) { |
if (n->tok < ROFF_MAX) { |
roff_validate(man); |
roff_validate(man); |
|
man_state(man, n); |
break; |
break; |
} |
} |
assert(n->tok >= MAN_TH && n->tok < MAN_MAX); |
assert(n->tok >= MAN_TH && n->tok < MAN_MAX); |
Line 207 check_text(CHKARGS) |
|
Line 208 check_text(CHKARGS) |
|
{ |
{ |
char *cp, *p; |
char *cp, *p; |
|
|
if (MAN_LITERAL & man->flags) |
if (n->flags & NODE_NOFILL) |
return; |
return; |
|
|
cp = n->string; |
cp = n->string; |
for (p = cp; NULL != (p = strchr(p, '\t')); p++) |
for (p = cp; NULL != (p = strchr(p, '\t')); p++) |
mandoc_msg(MANDOCERR_FI_TAB, |
mandoc_msg(MANDOCERR_FI_TAB, |
n->line, n->pos + (int)(p - cp), NULL); |
n->line, n->pos + (int)(p - cp), NULL); |
|
} |
|
|
|
static void |
|
post_EE(CHKARGS) |
|
{ |
|
if ((n->flags & NODE_NOFILL) == 0) |
|
mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE"); |
|
} |
|
|
|
static void |
|
post_EX(CHKARGS) |
|
{ |
|
if (n->flags & NODE_NOFILL) |
|
mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX"); |
} |
} |
|
|
static void |
static void |