version 1.254, 2014/10/30 20:10:02 |
version 1.257, 2014/11/27 16:20:31 |
Line 72 static enum mdoc_sec a2sec(const char *); |
|
Line 72 static enum mdoc_sec a2sec(const char *); |
|
static size_t macro2len(enum mdoct); |
static size_t macro2len(enum mdoct); |
static void rewrite_macro2len(char **); |
static void rewrite_macro2len(char **); |
|
|
static int ebool(POST_ARGS); |
|
static int berr_ge1(POST_ARGS); |
static int berr_ge1(POST_ARGS); |
static int bwarn_ge1(POST_ARGS); |
static int bwarn_ge1(POST_ARGS); |
static int ewarn_eq0(POST_ARGS); |
static int ewarn_eq0(POST_ARGS); |
Line 122 static int post_sh_head(POST_ARGS); |
|
Line 121 static int post_sh_head(POST_ARGS); |
|
static int post_sh_name(POST_ARGS); |
static int post_sh_name(POST_ARGS); |
static int post_sh_see_also(POST_ARGS); |
static int post_sh_see_also(POST_ARGS); |
static int post_sh_authors(POST_ARGS); |
static int post_sh_authors(POST_ARGS); |
|
static int post_sm(POST_ARGS); |
static int post_st(POST_ARGS); |
static int post_st(POST_ARGS); |
static int post_vt(POST_ARGS); |
static int post_vt(POST_ARGS); |
static int pre_an(PRE_ARGS); |
static int pre_an(PRE_ARGS); |
Line 199 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
Line 199 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
{ NULL, NULL }, /* Bq */ |
{ NULL, NULL }, /* Bq */ |
{ NULL, NULL }, /* Bsx */ |
{ NULL, NULL }, /* Bsx */ |
{ NULL, post_bx }, /* Bx */ |
{ NULL, post_bx }, /* Bx */ |
{ NULL, ebool }, /* Db */ |
{ pre_obsolete, NULL }, /* Db */ |
{ NULL, NULL }, /* Dc */ |
{ NULL, NULL }, /* Dc */ |
{ NULL, NULL }, /* Do */ |
{ NULL, NULL }, /* Do */ |
{ NULL, NULL }, /* Dq */ |
{ NULL, NULL }, /* Dq */ |
Line 209 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
Line 209 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
{ NULL, NULL }, /* Eo */ |
{ NULL, NULL }, /* Eo */ |
{ NULL, NULL }, /* Fx */ |
{ NULL, NULL }, /* Fx */ |
{ NULL, NULL }, /* Ms */ |
{ NULL, NULL }, /* Ms */ |
{ NULL, ewarn_eq0 }, /* No */ |
{ NULL, NULL }, /* No */ |
{ NULL, post_ns }, /* Ns */ |
{ NULL, post_ns }, /* Ns */ |
{ NULL, NULL }, /* Nx */ |
{ NULL, NULL }, /* Nx */ |
{ NULL, NULL }, /* Ox */ |
{ NULL, NULL }, /* Ox */ |
Line 226 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
Line 226 static const struct valids mdoc_valids[MDOC_MAX] = { |
|
{ NULL, NULL }, /* Sc */ |
{ NULL, NULL }, /* Sc */ |
{ NULL, NULL }, /* So */ |
{ NULL, NULL }, /* So */ |
{ NULL, NULL }, /* Sq */ |
{ NULL, NULL }, /* Sq */ |
{ NULL, ebool }, /* Sm */ |
{ NULL, post_sm }, /* Sm */ |
{ NULL, post_hyph }, /* Sx */ |
{ NULL, post_hyph }, /* Sx */ |
{ NULL, NULL }, /* Sy */ |
{ NULL, NULL }, /* Sy */ |
{ NULL, NULL }, /* Tn */ |
{ NULL, NULL }, /* Tn */ |
Line 353 mdoc_valid_post(struct mdoc *mdoc) |
|
Line 353 mdoc_valid_post(struct mdoc *mdoc) |
|
case MDOC_ROOT: |
case MDOC_ROOT: |
return(post_root(mdoc)); |
return(post_root(mdoc)); |
default: |
default: |
|
|
|
/* |
|
* Closing delimiters are not special at the |
|
* beginning of a block, opening delimiters |
|
* are not special at the end. |
|
*/ |
|
|
|
if (n->child != NULL) |
|
n->child->flags &= ~MDOC_DELIMC; |
|
if (n->last != NULL) |
|
n->last->flags &= ~MDOC_DELIMO; |
|
|
|
/* Call the macro's postprocessor. */ |
|
|
p = mdoc_valids[n->tok].post; |
p = mdoc_valids[n->tok].post; |
return(*p ? (*p)(mdoc) : 1); |
return(*p ? (*p)(mdoc) : 1); |
} |
} |
Line 1162 post_defaults(POST_ARGS) |
|
Line 1176 post_defaults(POST_ARGS) |
|
if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "...")) |
if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "...")) |
return(0); |
return(0); |
break; |
break; |
case MDOC_Li: |
|
if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "")) |
|
return(0); |
|
break; |
|
case MDOC_Pa: |
case MDOC_Pa: |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case MDOC_Mt: |
case MDOC_Mt: |
Line 1612 post_bk(POST_ARGS) |
|
Line 1622 post_bk(POST_ARGS) |
|
} |
} |
|
|
static int |
static int |
ebool(struct mdoc *mdoc) |
post_sm(struct mdoc *mdoc) |
{ |
{ |
struct mdoc_node *nch; |
struct mdoc_node *nch; |
enum mdoct tok; |
|
|
|
tok = mdoc->last->tok; |
|
nch = mdoc->last->child; |
nch = mdoc->last->child; |
|
|
if (NULL == nch) { |
if (nch == NULL) { |
if (MDOC_Sm == tok) |
mdoc->flags ^= MDOC_SMOFF; |
mdoc->flags ^= MDOC_SMOFF; |
|
return(1); |
return(1); |
} |
} |
|
|
check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_LT, 2); |
assert(nch->type == MDOC_TEXT); |
|
|
assert(MDOC_TEXT == nch->type); |
if ( ! strcmp(nch->string, "on")) { |
|
mdoc->flags &= ~MDOC_SMOFF; |
if (0 == strcmp(nch->string, "on")) { |
|
if (MDOC_Sm == tok) |
|
mdoc->flags &= ~MDOC_SMOFF; |
|
return(1); |
return(1); |
} |
} |
if (0 == strcmp(nch->string, "off")) { |
if ( ! strcmp(nch->string, "off")) { |
if (MDOC_Sm == tok) |
mdoc->flags |= MDOC_SMOFF; |
mdoc->flags |= MDOC_SMOFF; |
|
return(1); |
return(1); |
} |
} |
|
|
mandoc_vmsg(MANDOCERR_SM_BAD, |
mandoc_vmsg(MANDOCERR_SM_BAD, |
mdoc->parse, nch->line, nch->pos, |
mdoc->parse, nch->line, nch->pos, |
"%s %s", mdoc_macronames[tok], nch->string); |
"%s %s", mdoc_macronames[mdoc->last->tok], nch->string); |
return(mdoc_node_relink(mdoc, nch)); |
return(mdoc_node_relink(mdoc, nch)); |
} |
} |
|
|