version 1.53, 2010/05/07 05:34:56 |
version 1.55, 2010/05/07 05:48:29 |
|
|
append_delims(struct mdoc *mdoc, int line, int *pos, char *buf) |
append_delims(struct mdoc *mdoc, int line, int *pos, char *buf) |
{ |
{ |
int lastarg; |
int lastarg; |
enum margerr ac; |
enum margserr ac; |
char *p; |
char *p; |
|
|
if (0 == buf[*pos]) |
if (0 == buf[*pos]) |
|
|
blk_exp_close(MACRO_PROT_ARGS) |
blk_exp_close(MACRO_PROT_ARGS) |
{ |
{ |
int j, lastarg, maxargs, flushed; |
int j, lastarg, maxargs, flushed; |
enum margerr ac; |
enum margserr ac; |
enum mdoct ntok; |
enum mdoct ntok; |
char *p; |
char *p; |
|
|
Line 702 blk_exp_close(MACRO_PROT_ARGS) |
|
Line 702 blk_exp_close(MACRO_PROT_ARGS) |
|
if (ARGS_EOLN == ac) |
if (ARGS_EOLN == ac) |
break; |
break; |
|
|
if (MDOC_MAX != (ntok = lookup(tok, p))) { |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
if ( ! flushed) { |
|
if ( ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) |
if (MDOC_MAX == ntok) { |
return(0); |
if ( ! mdoc_word_alloc(m, line, lastarg, p)) |
flushed = 1; |
|
} |
|
if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf)) |
|
return(0); |
return(0); |
break; |
continue; |
} |
} |
|
|
if ( ! mdoc_word_alloc(m, line, lastarg, p)) |
if ( ! flushed) { |
|
if ( ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) |
|
return(0); |
|
flushed = 1; |
|
} |
|
if ( ! mdoc_macro(m, ntok, line, lastarg, pos, buf)) |
return(0); |
return(0); |
|
break; |
} |
} |
|
|
if ( ! flushed && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) |
if ( ! flushed && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) |
Line 731 in_line(MACRO_PROT_ARGS) |
|
Line 734 in_line(MACRO_PROT_ARGS) |
|
{ |
{ |
int la, lastpunct, c, cnt, d, nc; |
int la, lastpunct, c, cnt, d, nc; |
enum mdoct ntok; |
enum mdoct ntok; |
enum margerr ac; |
enum margserr ac; |
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
char *p; |
char *p; |
|
|
Line 787 in_line(MACRO_PROT_ARGS) |
|
Line 790 in_line(MACRO_PROT_ARGS) |
|
if (ARGS_PUNCT == ac) |
if (ARGS_PUNCT == ac) |
break; |
break; |
|
|
/* Quoted words shouldn't be looked-up. */ |
|
|
|
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
|
|
/* |
/* |
Line 890 blk_full(MACRO_PROT_ARGS) |
|
Line 891 blk_full(MACRO_PROT_ARGS) |
|
struct mdoc_node *n; |
struct mdoc_node *n; |
#endif |
#endif |
enum mdoct ntok; |
enum mdoct ntok; |
enum margerr ac; |
enum margserr ac; |
char *p; |
char *p; |
|
|
/* Close out prior implicit scope. */ |
/* Close out prior implicit scope. */ |
Line 985 blk_full(MACRO_PROT_ARGS) |
|
Line 986 blk_full(MACRO_PROT_ARGS) |
|
continue; |
continue; |
} |
} |
|
|
if (MDOC_MAX == (ntok = lookup(tok, p))) { |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
|
|
|
if (MDOC_MAX == ntok) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
Line 1044 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1047 blk_part_imp(MACRO_PROT_ARGS) |
|
{ |
{ |
int la; |
int la; |
enum mdoct ntok; |
enum mdoct ntok; |
enum margerr ac; |
enum margserr ac; |
char *p; |
char *p; |
struct mdoc_node *blk; /* saved block context */ |
struct mdoc_node *blk; /* saved block context */ |
struct mdoc_node *body; /* saved body context */ |
struct mdoc_node *body; /* saved body context */ |
Line 1101 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1104 blk_part_imp(MACRO_PROT_ARGS) |
|
body = m->last; |
body = m->last; |
} |
} |
|
|
if (MDOC_MAX == (ntok = lookup(tok, p))) { |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
|
|
|
if (MDOC_MAX == ntok) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
|
|
blk_part_exp(MACRO_PROT_ARGS) |
blk_part_exp(MACRO_PROT_ARGS) |
{ |
{ |
int la; |
int la; |
enum margerr ac; |
enum margserr ac; |
struct mdoc_node *head; /* keep track of head */ |
struct mdoc_node *head; /* keep track of head */ |
struct mdoc_node *body; /* keep track of body */ |
struct mdoc_node *body; /* keep track of body */ |
char *p; |
char *p; |
Line 1223 blk_part_exp(MACRO_PROT_ARGS) |
|
Line 1228 blk_part_exp(MACRO_PROT_ARGS) |
|
|
|
assert(NULL != head && NULL != body); |
assert(NULL != head && NULL != body); |
|
|
if (MDOC_MAX == (ntok = lookup(tok, p))) { |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
|
|
|
if (MDOC_MAX == ntok) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
|
|
in_line_argn(MACRO_PROT_ARGS) |
in_line_argn(MACRO_PROT_ARGS) |
{ |
{ |
int la, flushed, j, c, maxargs; |
int la, flushed, j, c, maxargs; |
enum margerr ac; |
enum margserr ac; |
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
char *p; |
char *p; |
enum mdoct ntok; |
enum mdoct ntok; |
Line 1339 in_line_argn(MACRO_PROT_ARGS) |
|
Line 1346 in_line_argn(MACRO_PROT_ARGS) |
|
flushed = 1; |
flushed = 1; |
} |
} |
|
|
if (MDOC_MAX != (ntok = lookup(tok, p))) { |
ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); |
|
|
|
if (MDOC_MAX != ntok) { |
if ( ! flushed && ! rew_elem(m, tok)) |
if ( ! flushed && ! rew_elem(m, tok)) |
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |
|
|
in_line_eoln(MACRO_PROT_ARGS) |
in_line_eoln(MACRO_PROT_ARGS) |
{ |
{ |
int c, la; |
int c, la; |
enum margerr ac; |
enum margserr ac; |
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
char *p; |
char *p; |
enum mdoct ntok; |
enum mdoct ntok; |
|
|
phrase(struct mdoc *m, int line, int ppos, char *buf) |
phrase(struct mdoc *m, int line, int ppos, char *buf) |
{ |
{ |
int la, pos; |
int la, pos; |
enum margerr ac; |
enum margserr ac; |
enum mdoct ntok; |
enum mdoct ntok; |
char *p; |
char *p; |
|
|