summaryrefslogtreecommitdiffstats
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-07 15:49:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-07 15:49:36 +0000
commit0f679b197ab273ae0779713155a8a455d4a770fe (patch)
treeaff454adb0052ff2632ea4814e8e19e9cc7dd9f1 /mdoc_argv.c
parent14c096e3772b640b87176e27eaa291c9fefbe0de (diff)
downloadmandoc-0f679b197ab273ae0779713155a8a455d4a770fe.tar.gz
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).
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 0ab8d9d6..5519d07f 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -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;