From 98c1a46e2586de979ce0fc696b15d91fb80166c5 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 7 May 2010 15:49:36 +0000 Subject: De-chunking of text removed from parsers. This is a significant change (and I don't really like it), but it's what groff does. Distinction of ARGS_PHRASE and ARGS_PPHRASE in backend (not yet used). --- mdoc_argv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mdoc_argv.c') diff --git a/mdoc_argv.c b/mdoc_argv.c index b68d2c74..c1a5ee31 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_argv.c,v 1.41 2010/05/07 06:05:38 kristaps Exp $ */ +/* $Id: mdoc_argv.c,v 1.42 2010/05/07 15:49:36 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -398,7 +398,7 @@ args(struct mdoc *m, int line, int *pos, assert(*pos); assert(' ' != buf[*pos]); - if (0 == buf[*pos]) + if ('\0' == buf[*pos]) return(ARGS_EOLN); /* @@ -441,7 +441,6 @@ args(struct mdoc *m, int line, int *pos, */ if (ARGS_TABSEP & fl) { - rc = ARGS_PHRASE; /* Scan ahead to tab (can't be escaped). */ p = strchr(*v, '\t'); @@ -455,14 +454,19 @@ args(struct mdoc *m, int line, int *pos, break; } + /* By default, assume a phrase. */ + rc = ARGS_PHRASE; + /* * Adjust new-buffer position to be beyond delimiter * mark (e.g., Ta -> end + 2). */ if (p && pp) { *pos += pp < p ? 2 : 1; + rc = pp < p ? ARGS_PHRASE : ARGS_PPHRASE; p = pp < p ? pp : p; } else if (p && ! pp) { + rc = ARGS_PPHRASE; *pos += 1; } else if (pp && ! p) { p = pp; -- cgit v1.2.3-56-ge451