version 1.81, 2010/06/26 16:07:08 |
version 1.82, 2010/06/27 15:52:41 |
Line 50 static int append_delims(struct mdoc *, |
|
Line 50 static int append_delims(struct mdoc *, |
|
int, int *, char *); |
int, int *, char *); |
static enum mdoct lookup(enum mdoct, const char *); |
static enum mdoct lookup(enum mdoct, const char *); |
static enum mdoct lookup_raw(const char *); |
static enum mdoct lookup_raw(const char *); |
static int phrase(struct mdoc *, |
static int phrase(struct mdoc *, int, int, char *); |
const struct regset *, |
|
int, int, char *); |
|
static enum mdoct rew_alt(enum mdoct); |
static enum mdoct rew_alt(enum mdoct); |
static int rew_dobreak(enum mdoct, |
static int rew_dobreak(enum mdoct, |
const struct mdoc_node *); |
const struct mdoc_node *); |
Line 609 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
Line 607 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
if ( ! rew_last(m, n)) |
if ( ! rew_last(m, n)) |
return(0); |
return(0); |
|
|
#ifdef UGLY |
|
/* |
/* |
* The current block extends an enclosing block beyond a line |
* The current block extends an enclosing block beyond a line |
* break. Now that the current block ends, close the enclosing |
* break. Now that the current block ends, close the enclosing |
Line 622 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
Line 619 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
if ( ! mdoc_body_alloc(m, n->line, n->pos, n->tok)) |
if ( ! mdoc_body_alloc(m, n->line, n->pos, n->tok)) |
return(0); |
return(0); |
} |
} |
#endif |
|
|
|
return(1); |
return(1); |
} |
} |
Line 741 blk_exp_close(MACRO_PROT_ARGS) |
|
Line 737 blk_exp_close(MACRO_PROT_ARGS) |
|
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |
} |
} |
if ( ! mdoc_macro(m, regs, ntok, line, lastarg, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 842 in_line(MACRO_PROT_ARGS) |
|
Line 838 in_line(MACRO_PROT_ARGS) |
|
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY)) |
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_MACROEMPTY)) |
return(0); |
return(0); |
} |
} |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
if ( ! nl) |
if ( ! nl) |
return(1); |
return(1); |
Line 938 blk_full(MACRO_PROT_ARGS) |
|
Line 934 blk_full(MACRO_PROT_ARGS) |
|
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
struct mdoc_node *head; /* save of head macro */ |
struct mdoc_node *head; /* save of head macro */ |
struct mdoc_node *body; /* save of body macro */ |
struct mdoc_node *body; /* save of body macro */ |
#ifdef UGLY |
|
struct mdoc_node *n; |
struct mdoc_node *n; |
#endif |
|
enum mdoc_type mtt; |
enum mdoc_type mtt; |
enum mdoct ntok; |
enum mdoct ntok; |
enum margserr ac, lac; |
enum margserr ac, lac; |
Line 1088 blk_full(MACRO_PROT_ARGS) |
|
Line 1082 blk_full(MACRO_PROT_ARGS) |
|
if (ARGS_PEND == ac && ARGS_PPHRASE == lac) |
if (ARGS_PEND == ac && ARGS_PPHRASE == lac) |
m->flags |= MDOC_PPHRASE; |
m->flags |= MDOC_PPHRASE; |
|
|
if ( ! phrase(m, regs, line, la, buf)) |
if ( ! phrase(m, line, la, buf)) |
return(0); |
return(0); |
|
|
m->flags &= ~MDOC_PPHRASE; |
m->flags &= ~MDOC_PPHRASE; |
Line 1103 blk_full(MACRO_PROT_ARGS) |
|
Line 1097 blk_full(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1122 blk_full(MACRO_PROT_ARGS) |
|
Line 1116 blk_full(MACRO_PROT_ARGS) |
|
if (NULL != body) |
if (NULL != body) |
goto out; |
goto out; |
|
|
#ifdef UGLY |
|
/* |
/* |
* If there is an open (i.e., unvalidated) sub-block requiring |
* If there is an open (i.e., unvalidated) sub-block requiring |
* explicit close-out, postpone switching the current block from |
* explicit close-out, postpone switching the current block from |
Line 1138 blk_full(MACRO_PROT_ARGS) |
|
Line 1131 blk_full(MACRO_PROT_ARGS) |
|
return(1); |
return(1); |
} |
} |
} |
} |
#endif |
|
|
|
/* Close out scopes to remain in a consistent state. */ |
/* Close out scopes to remain in a consistent state. */ |
|
|
Line 1231 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1223 blk_part_imp(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1376 blk_part_exp(MACRO_PROT_ARGS) |
|
Line 1368 blk_part_exp(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
break; |
break; |
} |
} |
Line 1495 in_line_argn(MACRO_PROT_ARGS) |
|
Line 1487 in_line_argn(MACRO_PROT_ARGS) |
|
if ( ! flushed && ! rew_elem(m, tok)) |
if ( ! flushed && ! rew_elem(m, tok)) |
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
j++; |
j++; |
break; |
break; |
Line 1601 in_line_eoln(MACRO_PROT_ARGS) |
|
Line 1593 in_line_eoln(MACRO_PROT_ARGS) |
|
|
|
if ( ! rew_elem(m, tok)) |
if ( ! rew_elem(m, tok)) |
return(0); |
return(0); |
return(mdoc_macro(m, regs, ntok, line, la, pos, buf)); |
return(mdoc_macro(m, ntok, line, la, pos, buf)); |
} |
} |
|
|
/* Close out (no delimiters). */ |
/* Close out (no delimiters). */ |
Line 1620 ctx_synopsis(MACRO_PROT_ARGS) |
|
Line 1612 ctx_synopsis(MACRO_PROT_ARGS) |
|
|
|
/* If we're not in the SYNOPSIS, go straight to in-line. */ |
/* If we're not in the SYNOPSIS, go straight to in-line. */ |
if (SEC_SYNOPSIS != m->lastsec) |
if (SEC_SYNOPSIS != m->lastsec) |
return(in_line(m, regs, tok, line, ppos, pos, buf)); |
return(in_line(m, tok, line, ppos, pos, buf)); |
|
|
/* If we're a nested call, same place. */ |
/* If we're a nested call, same place. */ |
if ( ! nl) |
if ( ! nl) |
return(in_line(m, regs, tok, line, ppos, pos, buf)); |
return(in_line(m, tok, line, ppos, pos, buf)); |
|
|
/* |
/* |
* XXX: this will open a block scope; however, if later we end |
* XXX: this will open a block scope; however, if later we end |
Line 1632 ctx_synopsis(MACRO_PROT_ARGS) |
|
Line 1624 ctx_synopsis(MACRO_PROT_ARGS) |
|
* the formatting. Be careful. |
* the formatting. Be careful. |
*/ |
*/ |
|
|
return(blk_part_imp(m, regs, tok, line, ppos, pos, buf)); |
return(blk_part_imp(m, tok, line, ppos, pos, buf)); |
} |
} |
|
|
|
|
Line 1651 obsolete(MACRO_PROT_ARGS) |
|
Line 1643 obsolete(MACRO_PROT_ARGS) |
|
* macro is encountered. |
* macro is encountered. |
*/ |
*/ |
static int |
static int |
phrase(struct mdoc *m, const struct regset *regs, |
phrase(struct mdoc *m, int line, int ppos, char *buf) |
int line, int ppos, char *buf) |
|
{ |
{ |
int la, pos; |
int la, pos; |
enum margserr ac; |
enum margserr ac; |
Line 1677 phrase(struct mdoc *m, const struct regset *regs, |
|
Line 1668 phrase(struct mdoc *m, const struct regset *regs, |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, regs, ntok, line, la, &pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, &pos, buf)) |
return(0); |
return(0); |
return(append_delims(m, line, &pos, buf)); |
return(append_delims(m, line, &pos, buf)); |
} |
} |
Line 1722 phrase_ta(MACRO_PROT_ARGS) |
|
Line 1713 phrase_ta(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if ( ! mdoc_macro(m, regs, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(m, ntok, line, la, pos, buf)) |
return(0); |
return(0); |
return(append_delims(m, line, pos, buf)); |
return(append_delims(m, line, pos, buf)); |
} |
} |