summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-24 00:00:11 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-05-24 00:00:11 +0000
commit6c7bf9cad1fb46791ef6a1c09fa7bc25809c5f62 (patch)
tree86650b0fbb5a4d65f42063e92a9e4db8647b752a /usr.bin/mandoc/mdoc_validate.c
parent66861bd8ad64765972ebcbe5446042a89b6488a4 (diff)
Increase performance by saving the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can know whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this. From kristaps@. While merging, fix a regression in mdoc_term.c, print_bvspace(): The bsd.lv version of this broke vertical spacing in .Bl -column.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r--usr.bin/mandoc/mdoc_validate.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index 185735279ca..8a4b2d98a0b 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,6 +1,6 @@
-/* $Id: mdoc_validate.c,v 1.55 2010/05/23 22:45:01 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.56 2010/05/24 00:00:10 schwarze Exp $ */
/*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
+ * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -564,27 +564,19 @@ pre_bl(PRE_ARGS)
case (MDOC_Inset):
/* FALLTHROUGH */
case (MDOC_Column):
- /*
- * Note that if a duplicate is detected, we
- * remove the duplicate instead of passing it
- * over. If we don't do this, mdoc_action will
- * become confused when it scans over multiple
- * types whilst setting its bitmasks.
- *
- * FIXME: this should occur in mdoc_action.c.
- */
- if (type >= 0) {
- if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP))
- return(0);
- mdoc_argn_free(n->args, pos);
+ if (type < 0) {
+ type = n->args->argv[pos].arg;
break;
}
- type = n->args->argv[pos].arg;
- break;
+ if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP))
+ break;
+ return(0);
case (MDOC_Compact):
- if (type < 0 && ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST))
- return(0);
- break;
+ if (type >= 0)
+ break;
+ if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST))
+ break;
+ return(0);
case (MDOC_Width):
if (width >= 0)
if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_ARGVREP))