aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-07 16:41:04 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-07 16:41:04 +0000
commitd6db890aaed1f31787d501e6a425098d9054943b (patch)
tree416f7dad5b2086272af4a26ae586c6dc79074ca8 /roff.c
parentf4797a3b5c98a4a87c333409e15ed2ad5478e8b8 (diff)
downloadmandoc-d6db890aaed1f31787d501e6a425098d9054943b.tar.gz
mandoc-d6db890aaed1f31787d501e6a425098d9054943b.tar.zst
mandoc-d6db890aaed1f31787d501e6a425098d9054943b.zip
*** empty log message ***
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index b75b0dc2..37d62c04 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.48 2008/12/07 14:38:57 kristaps Exp $ */
+/* $Id: roff.c,v 1.49 2008/12/07 16:41:04 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -640,6 +640,13 @@ roffspecial(struct rofftree *tree, int tok, const char *start,
break;
roff_err(tree, start, "invalid `At' arg");
return(0);
+
+ case (ROFF_Fn):
+ if (0 != sz)
+ break;
+ roff_err(tree, start, "`%s' expects at least "
+ "one arg", toknames[tok]);
+ return(0);
case (ROFF_Nm):
if (0 == sz) {
@@ -1201,9 +1208,11 @@ roff_ordered(ROFFCALL_ARGS)
if ( ! roffparseopts(tree, tok, &argv, argcp, argvp))
return(0);
- if (NULL == *argv)
+ if (NULL == *argv) {
+ ordp[0] = NULL;
return(roffspecial(tree, tok, p, argcp,
(const char **)argvp, 0, ordp));
+ }
i = 0;
while (*argv && i < ROFF_MAXLINEARG) {
@@ -1281,6 +1290,8 @@ roff_text(ROFFCALL_ARGS)
* terminating punctuation. If we encounter it and all
* subsequent tokens are punctuation, then stop processing (the
* line-dominant macro will print these tokens after closure).
+ * If the punctuation is followed by non-punctuation, then close
+ * and re-open our scope, then continue.
*/
i = 0;
@@ -1312,8 +1323,20 @@ roff_text(ROFFCALL_ARGS)
break;
if (argv[j]) {
+ if (ROFF_LSCOPE & tokens[tok].flags) {
+ if ( ! roffdata(tree, 0, *argv++))
+ return(0);
+ continue;
+ }
+ if ( ! (*tree->cb.roffout)(tree->arg, tok))
+ return(0);
if ( ! roffdata(tree, 0, *argv++))
return(0);
+ if ( ! (*tree->cb.roffin)(tree->arg, tok,
+ argcp, argvp))
+ return(0);
+
+ i = 0;
continue;
}