-/* $Id: mdoc_macro.c,v 1.88 2010/07/01 15:38:56 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.93 2010/07/18 17:00:26 schwarze Exp $ */
/*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
REWIND_THIS,
REWIND_MORE,
REWIND_LATER,
- REWIND_ERROR,
+ REWIND_ERROR
};
static int blk_full(MACRO_PROT_ARGS);
* knowing which symbols break this behaviour, for
* example, `. ;' shouldn't propogate the double-space.
*/
- if (mandoc_eos(p, strlen(p)))
+ if (mandoc_eos(p, strlen(p), 0))
m->last->flags |= MDOC_EOS;
}
lac = ARGS_ERROR == ac ? ARGS_PEND : ac;
ac = mdoc_args(m, line, pos, buf, tok, &p);
+ if (ARGS_PUNCT == ac)
+ break;
+
if (ARGS_ERROR == ac)
return(0);
*/
if (n && MDOC_TEXT == n->type && n->string)
- if (mandoc_eos(n->string, strlen(n->string)))
+ if (mandoc_eos(n->string, strlen(n->string), 1))
n->flags |= MDOC_EOS;
/* Up-propogate the end-of-space flag. */
assert( ! (MDOC_PARSED & mdoc_macros[tok].flags));
+ if (tok == MDOC_Pp)
+ rew_sub(MDOC_BLOCK, m, MDOC_Nm, line, ppos);
+
/* Parse macro arguments. */
for (arg = NULL; ; ) {
nl = MDOC_NEWLINE & m->flags;
/* If we're not in the SYNOPSIS, go straight to in-line. */
- if (SEC_SYNOPSIS != m->lastsec)
+ if ( ! (MDOC_SYNOPSIS & m->flags))
return(in_line(m, tok, line, ppos, pos, buf));
/* If we're a nested call, same place. */