source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: no need to skip content before first section header
Date: Mon, 7 Jul 2014 11:03:43 -0400 (EDT)	[thread overview]
Message-ID: <201407071503.s67F3h84003089@krisdoz.my.domain> (raw)

Log Message:
-----------
no need to skip content before first section header

Modified Files:
--------------
    mdocml:
        mandoc.h
        mdoc.c
        mdoc_term.c
        read.c

Revision Data
-------------
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.270
retrieving revision 1.271
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.270 -r1.271
--- mdoc_term.c
+++ mdoc_term.c
@@ -275,8 +275,11 @@ terminal_mdoc(void *arg, const struct md
 
 	term_begin(p, print_mdoc_head, print_mdoc_foot, meta);
 
-	if (n->child)
+	if (n->child) {
+		if (MDOC_Sh != n->child->tok)
+			term_vspace(p);
 		print_mdoc_nodelist(p, NULL, meta, n->child);
+	}
 
 	term_end(p);
 }
Index: mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -Lmdoc.c -Lmdoc.c -u -p -r1.218 -r1.219
--- mdoc.c
+++ mdoc.c
@@ -227,13 +227,6 @@ mdoc_addeqn(struct mdoc *mdoc, const str
 
 	assert( ! (MDOC_HALT & mdoc->flags));
 
-	/* No text before an initial macro. */
-
-	if (SEC_NONE == mdoc->lastnamed) {
-		mdoc_pmsg(mdoc, ep->ln, ep->pos, MANDOCERR_NOTEXT);
-		return(1);
-	}
-
 	n = node_alloc(mdoc, ep->ln, ep->pos, MDOC_MAX, MDOC_EQN);
 	n->eqn = ep;
 
@@ -251,13 +244,6 @@ mdoc_addspan(struct mdoc *mdoc, const st
 
 	assert( ! (MDOC_HALT & mdoc->flags));
 
-	/* No text before an initial macro. */
-
-	if (SEC_NONE == mdoc->lastnamed) {
-		mdoc_pmsg(mdoc, sp->line, 0, MANDOCERR_NOTEXT);
-		return(1);
-	}
-
 	n = node_alloc(mdoc, sp->line, 0, MDOC_MAX, MDOC_TBL);
 	n->span = sp;
 
@@ -721,13 +707,6 @@ mdoc_ptext(struct mdoc *mdoc, int line, 
 {
 	char		 *c, *ws, *end;
 	struct mdoc_node *n;
-
-	/* No text before an initial macro. */
-
-	if (SEC_NONE == mdoc->lastnamed) {
-		mdoc_pmsg(mdoc, line, offs, MANDOCERR_NOTEXT);
-		return(1);
-	}
 
 	assert(mdoc->last);
 	n = mdoc->last;
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.138
retrieving revision 1.139
diff -Lmandoc.h -Lmandoc.h -u -p -r1.138 -r1.139
--- mandoc.h
+++ mandoc.h
@@ -139,7 +139,6 @@ enum	mandocerr {
 	MANDOCERR_BADCHAR, /* skipping bad character */
 	MANDOCERR_NAMESC, /* escaped character not allowed in a name */
 	MANDOCERR_NONAME, /* manual name not yet set */
-	MANDOCERR_NOTEXT, /* skipping text before first section header */
 	MANDOCERR_MACRO, /* skipping unknown macro */
 	MANDOCERR_ARGCOUNT, /* argument count wrong */
 	MANDOCERR_RS_SKIP, /* skipping invalid content in .Rs block: macro */
Index: read.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -Lread.c -Lread.c -u -p -r1.65 -r1.66
--- read.c
+++ read.c
@@ -183,7 +183,6 @@ static	const char * const	mandocerrs[MAN
 	"skipping bad character",
 	"escaped character not allowed in a name",
 	"manual name not yet set",
-	"skipping text before first section header",
 	"skipping unknown macro",
 	"argument count wrong",
 	"skipping invalid content in .Rs block",
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2014-07-07 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201407071503.s67F3h84003089@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).