version 1.51, 2009/02/23 12:45:19 |
version 1.56, 2009/03/05 12:08:53 |
|
|
* macro. |
* macro. |
*/ |
*/ |
|
|
|
/* |
|
* FIXME: don't use static mdoc_argv values, as they require us to do a |
|
* complicated copy-over when actually assigning them to dynamic memory. |
|
*/ |
|
|
#include "private.h" |
#include "private.h" |
|
|
static int macro_obsolete(MACRO_PROT_ARGS); |
static int macro_obsolete(MACRO_PROT_ARGS); |
Line 170 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 175 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */ |
/* XXX - .Fo supposed to be (but isn't) callable. */ |
/* XXX - .Fo supposed to be (but isn't) callable. */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Fo */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Fo */ |
/* XXX - .Fc supposed to be (but isn't) callable. */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Fc */ |
{ macro_scoped_close, MDOC_EXPLICIT }, /* Fc */ |
|
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Oo */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Oo */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Oc */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Oc */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Bk */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Bk */ |
Line 751 macro_text(MACRO_PROT_ARGS) |
|
Line 755 macro_text(MACRO_PROT_ARGS) |
|
return(perr(mdoc, line, ppos, EARGVLIM)); |
return(perr(mdoc, line, ppos, EARGVLIM)); |
} |
} |
|
|
c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); |
c = mdoc_elem_alloc(mdoc, line, ppos, |
|
tok, (size_t)argc, argv); |
|
|
if (0 == c) { |
if (0 == c) { |
mdoc_argv_free(argc, argv); |
mdoc_argv_free(argc, argv); |
Line 796 macro_text(MACRO_PROT_ARGS) |
|
Line 801 macro_text(MACRO_PROT_ARGS) |
|
return(0); |
return(0); |
} |
} |
|
|
|
/* FIXME: .Fl and .Ar handling of `|'. */ |
|
|
if (ARGS_QWORD != w && mdoc_isdelim(p)) { |
if (ARGS_QWORD != w && mdoc_isdelim(p)) { |
if (0 == lastpunct && ! rewind_elem(mdoc, tok)) { |
if (0 == lastpunct && ! rewind_elem(mdoc, tok)) { |
mdoc_argv_free(argc, argv); |
mdoc_argv_free(argc, argv); |
Line 803 macro_text(MACRO_PROT_ARGS) |
|
Line 810 macro_text(MACRO_PROT_ARGS) |
|
} |
} |
lastpunct = 1; |
lastpunct = 1; |
} else if (lastpunct) { |
} else if (lastpunct) { |
c = mdoc_elem_alloc(mdoc, line, |
c = mdoc_elem_alloc(mdoc, line, ppos, |
ppos, tok, argc, argv); |
tok, (size_t)argc, argv); |
if (0 == c) { |
if (0 == c) { |
mdoc_argv_free(argc, argv); |
mdoc_argv_free(argc, argv); |
return(0); |
return(0); |
Line 922 macro_scoped(MACRO_PROT_ARGS) |
|
Line 929 macro_scoped(MACRO_PROT_ARGS) |
|
|
|
if (ARGS_ERROR == c) |
if (ARGS_ERROR == c) |
return(0); |
return(0); |
if (ARGS_PUNCT == c) |
|
break; |
|
if (ARGS_EOLN == c) |
if (ARGS_EOLN == c) |
break; |
break; |
|
|
if (ARGS_PHRASE == c) { |
if (ARGS_PHRASE == c) { |
/* |
/* |
if ( ! mdoc_phrase(mdoc, line, lastarg, buf)) |
if ( ! mdoc_phrase(mdoc, line, lastarg, buf)) |
Line 953 macro_scoped(MACRO_PROT_ARGS) |
|
Line 957 macro_scoped(MACRO_PROT_ARGS) |
|
break; |
break; |
} |
} |
|
|
if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) |
|
return(0); |
|
if (1 == ppos && ! append_delims(mdoc, line, pos, buf)) |
if (1 == ppos && ! append_delims(mdoc, line, pos, buf)) |
return(0); |
return(0); |
|
if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) |
|
return(0); |
|
|
if ( ! mdoc_body_alloc(mdoc, line, ppos, tok)) |
if ( ! mdoc_body_alloc(mdoc, line, ppos, tok)) |
return(0); |
return(0); |
Line 1229 macro_constant_delimited(MACRO_PROT_ARGS) |
|
Line 1233 macro_constant_delimited(MACRO_PROT_ARGS) |
|
return(perr(mdoc, line, ppos, EARGVLIM)); |
return(perr(mdoc, line, ppos, EARGVLIM)); |
} |
} |
|
|
c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); |
c = mdoc_elem_alloc(mdoc, line, ppos, |
|
tok, (size_t)argc, argv); |
|
|
mdoc_argv_free(argc, argv); |
mdoc_argv_free(argc, argv); |
|
|
if (0 == c) |
if (0 == c) |
Line 1320 macro_constant(MACRO_PROT_ARGS) |
|
Line 1326 macro_constant(MACRO_PROT_ARGS) |
|
return(perr(mdoc, line, ppos, EARGVLIM)); |
return(perr(mdoc, line, ppos, EARGVLIM)); |
} |
} |
|
|
c = mdoc_elem_alloc(mdoc, line, ppos, tok, argc, argv); |
c = mdoc_elem_alloc(mdoc, line, ppos, |
|
tok, (size_t)argc, argv); |
|
|
mdoc_argv_free(argc, argv); |
mdoc_argv_free(argc, argv); |
|
|
if (0 == c) |
if (0 == c) |