[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-source
Subject:    mdocml: First in several iterative patches in getting complex -column
From:       kristaps () mdocml ! bsd ! lv
Date:       2010-05-30 21:28:32
Message-ID: 201005302128.o4ULSWUb019512 () krisdoz ! my ! domain
[Download RAW message or body]

Log Message:
-----------
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.

Modified Files:
--------------
    mdocml:
        mdoc_macro.c

Added Files:
-----------
    mdocml/regress/mdoc/It:
        mixed-tabs-tas.in
        simple-tabs-tas.in

Revision Data
-------------
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.70 -r1.71
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -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;
--- /dev/null
+++ 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
--- /dev/null
+++ 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
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic