=================================================================== RCS file: /cvs/mandoc/Attic/macro.c,v retrieving revision 1.51 retrieving revision 1.55 diff -u -p -r1.51 -r1.55 --- mandoc/Attic/macro.c 2009/02/23 12:45:19 1.51 +++ mandoc/Attic/macro.c 2009/02/28 20:13:06 1.55 @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.51 2009/02/23 12:45:19 kristaps Exp $ */ +/* $Id: macro.c,v 1.55 2009/02/28 20:13:06 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -170,8 +170,7 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { { macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */ /* XXX - .Fo supposed to be (but isn't) callable. */ { macro_scoped, MDOC_EXPLICIT }, /* Fo */ - /* XXX - .Fc supposed to be (but isn't) callable. */ - { macro_scoped_close, MDOC_EXPLICIT }, /* Fc */ + { macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Fc */ { macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Oo */ { macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Oc */ { macro_scoped, MDOC_EXPLICIT }, /* Bk */ @@ -751,7 +750,8 @@ macro_text(MACRO_PROT_ARGS) 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) { mdoc_argv_free(argc, argv); @@ -796,6 +796,8 @@ macro_text(MACRO_PROT_ARGS) return(0); } + /* FIXME: .Fl and .Ar handling of `|'. */ + if (ARGS_QWORD != w && mdoc_isdelim(p)) { if (0 == lastpunct && ! rewind_elem(mdoc, tok)) { mdoc_argv_free(argc, argv); @@ -803,8 +805,8 @@ macro_text(MACRO_PROT_ARGS) } lastpunct = 1; } else if (lastpunct) { - 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) { mdoc_argv_free(argc, argv); return(0); @@ -922,11 +924,8 @@ macro_scoped(MACRO_PROT_ARGS) if (ARGS_ERROR == c) return(0); - if (ARGS_PUNCT == c) - break; if (ARGS_EOLN == c) break; - if (ARGS_PHRASE == c) { /* if ( ! mdoc_phrase(mdoc, line, lastarg, buf)) @@ -953,10 +952,10 @@ macro_scoped(MACRO_PROT_ARGS) break; } - if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) - return(0); if (1 == ppos && ! append_delims(mdoc, line, pos, buf)) return(0); + if ( ! rewind_subblock(MDOC_HEAD, mdoc, tok, line, ppos)) + return(0); if ( ! mdoc_body_alloc(mdoc, line, ppos, tok)) return(0); @@ -1229,7 +1228,9 @@ macro_constant_delimited(MACRO_PROT_ARGS) 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); if (0 == c) @@ -1320,7 +1321,9 @@ macro_constant(MACRO_PROT_ARGS) 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); if (0 == c)