summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-30 21:28:30 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-30 21:28:30 +0000
commita09ab3c573cd4f51a974cccf58ffaaab60d080ef (patch)
tree7669d5b0eb2951eeadda5834dc967564fc9b0d90
parent89acde071c972b5d612dcc42dd85d1d8ae6c3597 (diff)
downloadmandoc-a09ab3c573cd4f51a974cccf58ffaaab60d080ef.tar.gz
mandoc-a09ab3c573cd4f51a974cccf58ffaaab60d080ef.tar.zst
mandoc-a09ab3c573cd4f51a974cccf58ffaaab60d080ef.zip
First in several iterative patches in getting complex -column lists
supported (which works but is tricky enough that it should be broken down into digestable parts). This simply moves around the propogation of ARGS_PEND into one recognised by phrase(). Added a few regressions for simple -column lists.
-rw-r--r--mdoc_macro.c22
-rw-r--r--regress/mdoc/It/mixed-tabs-tas.in13
-rw-r--r--regress/mdoc/It/simple-tabs-tas.in17
3 files changed, 43 insertions, 9 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index a19bdd32..af3467a5 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.70 2010/05/29 18:47:54 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.71 2010/05/30 21:28:30 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1002,6 +1002,7 @@ blk_full(MACRO_PROT_ARGS)
}
ac = ARGS_ERROR;
+ lac = ARGS_PHRASE;
for ( ; ; ) {
la = *pos;
@@ -1013,16 +1014,10 @@ blk_full(MACRO_PROT_ARGS)
if (ARGS_EOLN == ac)
break;
- if (ARGS_PEND == ac) {
- if (ARGS_PPHRASE == lac)
- ac = ARGS_PPHRASE;
- else
- ac = ARGS_PHRASE;
- }
-
/* Don't emit leading punct. for phrases. */
if (NULL == head &&
+ ARGS_PEND != ac &&
ARGS_PHRASE != ac &&
ARGS_PPHRASE != ac &&
ARGS_QWORD != ac &&
@@ -1035,6 +1030,7 @@ blk_full(MACRO_PROT_ARGS)
/* Always re-open head for phrases. */
if (NULL == head ||
+ ARGS_PEND == ac ||
ARGS_PHRASE == ac ||
ARGS_PPHRASE == ac) {
if ( ! mdoc_head_alloc(m, line, ppos, tok))
@@ -1045,9 +1041,17 @@ blk_full(MACRO_PROT_ARGS)
if (ARGS_PHRASE == ac || ARGS_PPHRASE == ac) {
if (ARGS_PPHRASE == ac)
m->flags |= MDOC_PPHRASE;
- if ( ! phrase(m, line, la, buf, ac))
+ if (ARGS_PEND == ac && ARGS_PPHRASE == lac)
+ m->flags |= MDOC_PPHRASE;
+
+ if (ARGS_PEND == ac) {
+ if ( ! phrase(m, line, la, buf, lac))
+ return(0);
+ } else if ( ! phrase(m, line, la, buf, ac))
return(0);
+
m->flags &= ~MDOC_PPHRASE;
+
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))
return(0);
continue;
diff --git a/regress/mdoc/It/mixed-tabs-tas.in b/regress/mdoc/It/mixed-tabs-tas.in
new file mode 100644
index 00000000..0c6fca3c
--- /dev/null
+++ b/regress/mdoc/It/mixed-tabs-tas.in
@@ -0,0 +1,13 @@
+.Dd $Mdocdate: May 30 2010 $
+.Dt FOO
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+.Bl -column asdfasdf asdfasdf asdfasdf
+.It asdf Ta asdf asdf
+.El
+.Bl -column asdfasdf asdfasdf asdfasdf
+.It asdf asdf ; Ta asdf
+.El
diff --git a/regress/mdoc/It/simple-tabs-tas.in b/regress/mdoc/It/simple-tabs-tas.in
new file mode 100644
index 00000000..7b033935
--- /dev/null
+++ b/regress/mdoc/It/simple-tabs-tas.in
@@ -0,0 +1,17 @@
+.Dd $Mdocdate: May 30 2010 $
+.Dt FOO
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+.Bl -column asdfasdf asdfasdf asdfasdf
+.It asdf asdf asdf
+.El
+.Bl -column asdfasdf asdfasdf asdfasdf
+.It asdf ; Ta asdf ; Ta asdf
+.El
+.Bl -tag -width Ds
+.It asdf
+asdf
+.El