aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-07 06:05:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-07 06:05:38 +0000
commit20276f6161ced22d83924afefed6d39cb45df6f3 (patch)
tree751aeacfe8f17ade13a5dcfbecb2d9b421288b03
parent30b7779eb2696f56263ec38a19cce37e4ce809da (diff)
downloadmandoc-20276f6161ced22d83924afefed6d39cb45df6f3.tar.gz
mandoc-20276f6161ced22d83924afefed6d39cb45df6f3.tar.zst
mandoc-20276f6161ced22d83924afefed6d39cb45df6f3.zip
Initial ARGS_PPHRASE (partial phrase) framework.
Running tally of changes in index.sgml.
-rw-r--r--index.sgml13
-rw-r--r--libmdoc.h5
-rw-r--r--mdoc_argv.c6
-rw-r--r--mdoc_macro.c13
4 files changed, 23 insertions, 14 deletions
diff --git a/index.sgml b/index.sgml
index 227fa15e..afaf0d13 100644
--- a/index.sgml
+++ b/index.sgml
@@ -219,6 +219,16 @@
<COL CLASS="date">
<TBODY>
<TR>
+ <TD VALIGN="top"><SPAN CLASS="date">xx-05-2010</SPAN></TD>
+ <TD VALIGN="top">
+ Clean-up in internal <SPAN CLASS="flag">-mdoc</SPAN> library. Rolled back
+ break-at-hyphen (broken). <SPAN CLASS="flag">-DUGLY</SPAN> is now the default
+ (why not).
+ Version: <SPAN CLASS="rev">1.9.24</SPAN>.
+ </TD>
+ </TR>
+
+ <TR>
<TD VALIGN="top"><SPAN CLASS="date">07-04-2010</SPAN></TD>
<TD VALIGN="top">
<SPAN CLASS="nm">mdocml</SPAN> has been linked to the <A CLASS="external"
@@ -232,7 +242,6 @@
layout. Version: <SPAN CLASS="rev">1.9.23</SPAN>.
</TD>
</TR>
-
<TR>
<TD VALIGN="top"><SPAN CLASS="date">31-03-2010</SPAN></TD>
<TD VALIGN="top">
@@ -300,7 +309,7 @@
<TR>
<TD>
<DIV CLASS="foot">
- Copyright &#169; 2008&#8211;2010 Kristaps Dzonsons, $Date: 2010/04/07 11:40:05 $
+ Copyright &#169; 2008&#8211;2010 Kristaps Dzonsons, $Date: 2010/05/07 06:05:38 $
</DIV>
</TD>
</TR>
diff --git a/libmdoc.h b/libmdoc.h
index f6b4d135..f9a0ca2f 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -1,4 +1,4 @@
-/* $Id: libmdoc.h,v 1.37 2010/05/07 05:54:09 kristaps Exp $ */
+/* $Id: libmdoc.h,v 1.38 2010/05/07 06:05:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -117,7 +117,8 @@ enum margserr {
ARGS_WORD,
ARGS_PUNCT,
ARGS_QWORD,
- ARGS_PHRASE
+ ARGS_PHRASE,
+ ARGS_PPHRASE
};
enum margverr {
diff --git a/mdoc_argv.c b/mdoc_argv.c
index d45ba999..b68d2c74 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_argv.c,v 1.40 2010/05/07 05:54:09 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.41 2010/05/07 06:05:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -378,6 +378,7 @@ args(struct mdoc *m, int line, int *pos,
{
int i;
char *p, *pp;
+ enum margserr rc;
/*
* Parse out the terms (like `val' in `.Xx -arg val' or simply
@@ -440,6 +441,7 @@ 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');
@@ -488,7 +490,7 @@ args(struct mdoc *m, int line, int *pos,
for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++)
/* Skip ahead. */ ;
- return(ARGS_PHRASE);
+ return(rc);
}
/*
diff --git a/mdoc_macro.c b/mdoc_macro.c
index 89240740..86eb7b83 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_macro.c,v 1.56 2010/05/07 05:54:09 kristaps Exp $ */
+/* $Id: mdoc_macro.c,v 1.57 2010/05/07 06:05:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -632,7 +632,6 @@ append_delims(struct mdoc *mdoc, int line, int *pos, char *buf)
for (;;) {
lastarg = *pos;
ac = mdoc_zargs(mdoc, line, pos, buf, ARGS_NOWARN, &p);
- assert(ARGS_PHRASE != ac);
if (ARGS_ERROR == ac)
return(0);
@@ -965,6 +964,7 @@ blk_full(MACRO_PROT_ARGS)
/* Don't emit leading punct. for phrases. */
if (NULL == head && ARGS_PHRASE != ac &&
+ ARGS_PPHRASE != ac &&
ARGS_QWORD != ac &&
1 == mdoc_isdelim(p)) {
if ( ! mdoc_word_alloc(m, line, la, p))
@@ -974,13 +974,14 @@ blk_full(MACRO_PROT_ARGS)
/* Always re-open head for phrases. */
- if (NULL == head || ARGS_PHRASE == ac) {
+ if (NULL == head || ARGS_PHRASE == ac ||
+ ARGS_PPHRASE == ac) {
if ( ! mdoc_head_alloc(m, line, ppos, tok))
return(0);
head = m->last;
}
- if (ARGS_PHRASE == ac) {
+ if (ARGS_PHRASE == ac || ARGS_PPHRASE == ac) {
if ( ! phrase(m, line, la, buf))
return(0);
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))
@@ -1084,8 +1085,6 @@ blk_part_imp(MACRO_PROT_ARGS)
la = *pos;
ac = mdoc_args(m, line, pos, buf, tok, &p);
- assert(ARGS_PHRASE != ac);
-
if (ARGS_ERROR == ac)
return(0);
if (ARGS_EOLN == ac)
@@ -1187,8 +1186,6 @@ blk_part_exp(MACRO_PROT_ARGS)
if (ARGS_EOLN == ac)
break;
- assert(ARGS_PHRASE != ac);
-
/* Flush out leading punctuation. */
if (NULL == head && ARGS_QWORD != ac &&