version 1.39, 2010/05/15 09:20:01 |
version 1.40, 2010/05/15 12:30:59 |
|
|
return(0); |
return(0); |
else if (ARGS_EOLN == ac) |
else if (ARGS_EOLN == ac) |
break; |
break; |
assert(mdoc_isdelim(p)); |
assert(DELIM_NONE != mdoc_isdelim(p)); |
if ( ! mdoc_word_alloc(mdoc, line, lastarg, p)) |
if ( ! mdoc_word_alloc(mdoc, line, lastarg, p)) |
return(0); |
return(0); |
} |
} |
|
|
static int |
static int |
in_line(MACRO_PROT_ARGS) |
in_line(MACRO_PROT_ARGS) |
{ |
{ |
int la, lastpunct, cnt, d, nc, nl; |
int la, lastpunct, cnt, nc, nl; |
enum margverr av; |
enum margverr av; |
enum mdoct ntok; |
enum mdoct ntok; |
enum margserr ac; |
enum margserr ac; |
|
enum mdelim d; |
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
char *p; |
char *p; |
|
|
|
|
* the word. |
* the word. |
*/ |
*/ |
|
|
d = ARGS_QWORD == ac ? 0 : mdoc_isdelim(p); |
d = ARGS_QWORD == ac ? DELIM_NONE : mdoc_isdelim(p); |
|
|
if (ARGS_QWORD != ac && d) { |
if (ARGS_QWORD != ac && DELIM_NONE != d) { |
if (0 == lastpunct && ! rew_elem(m, tok)) |
if (0 == lastpunct && ! rew_elem(m, tok)) |
return(0); |
return(0); |
lastpunct = 1; |
lastpunct = 1; |
|
|
lastpunct = 0; |
lastpunct = 0; |
} |
} |
|
|
if ( ! d) |
if (DELIM_NONE == d) |
cnt++; |
cnt++; |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
|
|
if (ARGS_EOLN == ac) |
if (ARGS_EOLN == ac) |
break; |
break; |
|
|
/* |
|
* XXX Temporarily disable the handling of leading punctuation. |
|
* We must investigate the fallout before enabling this. |
|
*/ |
|
#if 0 |
|
/* Don't emit leading punct. for phrases. */ |
/* Don't emit leading punct. for phrases. */ |
|
|
if (NULL == head && |
if (NULL == head && |
|
|
ARGS_PPHRASE != ac && |
ARGS_PPHRASE != ac && |
ARGS_PEND != ac && |
ARGS_PEND != ac && |
ARGS_QWORD != ac && |
ARGS_QWORD != ac && |
1 == mdoc_isdelim(p)) { |
DELIM_OPEN == mdoc_isdelim(p)) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
} |
} |
#endif |
|
|
|
/* Always re-open head for phrases. */ |
/* Always re-open head for phrases. */ |
|
|
|
|
if (ARGS_PUNCT == ac) |
if (ARGS_PUNCT == ac) |
break; |
break; |
|
|
/* |
|
* XXX Temporarily disable the handling of leading punctuation. |
|
* We must investigate the fallout before enabling this. |
|
*/ |
|
#if 0 |
|
if (NULL == body && ARGS_QWORD != ac && |
if (NULL == body && ARGS_QWORD != ac && |
1 == mdoc_isdelim(p)) { |
DELIM_OPEN == mdoc_isdelim(p)) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
} |
} |
#endif |
|
|
|
if (NULL == body) { |
if (NULL == body) { |
if ( ! mdoc_body_alloc(m, line, ppos, tok)) |
if ( ! mdoc_body_alloc(m, line, ppos, tok)) |
|
|
if (ARGS_EOLN == ac) |
if (ARGS_EOLN == ac) |
break; |
break; |
|
|
/* |
|
* XXX Temporarily disable the handling of leading punctuation. |
|
* We must investigate the fallout before enabling this. |
|
*/ |
|
#if 0 |
|
/* Flush out leading punctuation. */ |
/* Flush out leading punctuation. */ |
|
|
if (NULL == head && ARGS_QWORD != ac && |
if (NULL == head && ARGS_QWORD != ac && |
1 == mdoc_isdelim(p)) { |
DELIM_OPEN == mdoc_isdelim(p)) { |
assert(NULL == body); |
assert(NULL == body); |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
} |
} |
#endif |
|
|
|
if (NULL == head) { |
if (NULL == head) { |
assert(NULL == body); |
assert(NULL == body); |
|
|
if (ARGS_EOLN == ac) |
if (ARGS_EOLN == ac) |
break; |
break; |
|
|
/* |
|
* XXX Temporarily disable the handling of leading punctuation. |
|
* We must investigate the fallout before enabling this. |
|
*/ |
|
#if 0 |
|
if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) && |
if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) && |
ARGS_QWORD != ac && |
ARGS_QWORD != ac && |
0 == j && 1 == mdoc_isdelim(p)) { |
0 == j && DELIM_OPEN == mdoc_isdelim(p)) { |
if ( ! mdoc_word_alloc(m, line, la, p)) |
if ( ! mdoc_word_alloc(m, line, la, p)) |
return(0); |
return(0); |
continue; |
continue; |
} else |
} else if (0 == j) |
#endif |
|
if (0 == j) |
|
if ( ! mdoc_elem_alloc(m, line, la, tok, arg)) |
if ( ! mdoc_elem_alloc(m, line, la, tok, arg)) |
return(0); |
return(0); |
|
|
|
|
|
|
if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) && |
if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) && |
ARGS_QWORD != ac && |
ARGS_QWORD != ac && |
! flushed && mdoc_isdelim(p)) { |
! flushed && |
|
DELIM_NONE != mdoc_isdelim(p)) { |
if ( ! rew_elem(m, tok)) |
if ( ! rew_elem(m, tok)) |
return(0); |
return(0); |
flushed = 1; |
flushed = 1; |