version 1.161, 2011/03/17 09:24:51 |
version 1.165, 2011/03/22 14:33:05 |
|
|
#include <string.h> |
#include <string.h> |
#include <time.h> |
#include <time.h> |
|
|
|
#include "mdoc.h" |
#include "mandoc.h" |
#include "mandoc.h" |
#include "libmdoc.h" |
#include "libmdoc.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
Line 179 static v_pre pres_sh[] = { pre_sh, NULL }; |
|
Line 180 static v_pre pres_sh[] = { pre_sh, NULL }; |
|
static v_pre pres_ss[] = { pre_ss, NULL }; |
static v_pre pres_ss[] = { pre_ss, NULL }; |
static v_pre pres_std[] = { pre_std, NULL }; |
static v_pre pres_std[] = { pre_std, NULL }; |
|
|
const struct valids mdoc_valids[MDOC_MAX] = { |
static const struct valids mdoc_valids[MDOC_MAX] = { |
{ NULL, NULL }, /* Ap */ |
{ NULL, NULL }, /* Ap */ |
{ pres_dd, posts_dd }, /* Dd */ |
{ pres_dd, posts_dd }, /* Dd */ |
{ pres_dt, posts_dt }, /* Dt */ |
{ pres_dt, posts_dt }, /* Dt */ |
Line 446 check_count(struct mdoc *m, enum mdoc_type type, |
|
Line 447 check_count(struct mdoc *m, enum mdoc_type type, |
|
} |
} |
|
|
t = lvl == CHECK_WARN ? MANDOCERR_ARGCWARN : MANDOCERR_ARGCOUNT; |
t = lvl == CHECK_WARN ? MANDOCERR_ARGCWARN : MANDOCERR_ARGCOUNT; |
|
mandoc_vmsg(t, m->parse, m->last->line, m->last->pos, |
return(mdoc_vmsg(m, t, m->last->line, m->last->pos, |
|
"want %s%d children (have %d)", |
"want %s%d children (have %d)", |
p, val, m->last->nchild)); |
p, val, m->last->nchild); |
|
return(1); |
} |
} |
|
|
static int |
static int |
Line 581 check_parent(PRE_ARGS, enum mdoct tok, enum mdoc_type |
|
Line 582 check_parent(PRE_ARGS, enum mdoct tok, enum mdoc_type |
|
(t == n->parent->type)) |
(t == n->parent->type)) |
return(1); |
return(1); |
|
|
mdoc_vmsg(mdoc, MANDOCERR_SYNTCHILD, |
mandoc_vmsg(MANDOCERR_SYNTCHILD, mdoc->parse, n->line, |
n->line, n->pos, "want parent %s", |
n->pos, "want parent %s", MDOC_ROOT == t ? |
MDOC_ROOT == t ? "<root>" : |
"<root>" : mdoc_macronames[tok]); |
mdoc_macronames[tok]); |
|
return(0); |
return(0); |
} |
} |
|
|
Line 1266 post_an(POST_ARGS) |
|
Line 1266 post_an(POST_ARGS) |
|
static int |
static int |
post_it(POST_ARGS) |
post_it(POST_ARGS) |
{ |
{ |
int i, cols, rc; |
int i, cols; |
enum mdoc_list lt; |
enum mdoc_list lt; |
struct mdoc_node *n, *c; |
struct mdoc_node *n, *c; |
enum mandocerr er; |
enum mandocerr er; |
Line 1332 post_it(POST_ARGS) |
|
Line 1332 post_it(POST_ARGS) |
|
else |
else |
er = MANDOCERR_SYNTARGCOUNT; |
er = MANDOCERR_SYNTARGCOUNT; |
|
|
rc = mdoc_vmsg(mdoc, er, |
mandoc_vmsg(er, mdoc->parse, mdoc->last->line, |
mdoc->last->line, mdoc->last->pos, |
mdoc->last->pos, |
"columns == %d (have %d)", cols, i); |
"columns == %d (have %d)", cols, i); |
return(rc); |
return(MANDOCERR_ARGCOUNT == er); |
default: |
default: |
break; |
break; |
} |
} |
Line 2002 post_dd(POST_ARGS) |
|
Line 2002 post_dd(POST_ARGS) |
|
|
|
n = mdoc->last; |
n = mdoc->last; |
if (NULL == n->child || '\0' == n->child->string[0]) { |
if (NULL == n->child || '\0' == n->child->string[0]) { |
mdoc->meta.date = mandoc_normdate(NULL, |
mdoc->meta.date = mandoc_normdate |
mdoc->msg, mdoc->data, n->line, n->pos); |
(mdoc->parse, NULL, n->line, n->pos); |
return(1); |
return(1); |
} |
} |
|
|
if ( ! concat(mdoc, buf, n->child, DATESIZE)) |
if ( ! concat(mdoc, buf, n->child, DATESIZE)) |
return(0); |
return(0); |
|
|
mdoc->meta.date = mandoc_normdate(buf, |
mdoc->meta.date = mandoc_normdate |
mdoc->msg, mdoc->data, n->line, n->pos); |
(mdoc->parse, buf, n->line, n->pos); |
|
|
return(1); |
return(1); |
} |
} |