From bf71220a9f906bbab505a3c280f4f04c52f383ff Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 7 Jul 2014 15:03:43 +0000 Subject: [PATCH] no need to skip content before first section header --- mandoc.h | 3 +-- mdoc.c | 23 +---------------------- mdoc_term.c | 7 +++++-- read.c | 3 +-- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/mandoc.h b/mandoc.h index 0d44b170..6776d804 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.138 2014/07/07 11:35:06 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.139 2014/07/07 15:03:43 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -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 */ diff --git a/mdoc.c b/mdoc.c index dcf40358..bdff8e18 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.218 2014/07/06 19:09:00 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.219 2014/07/07 15:03:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -227,13 +227,6 @@ mdoc_addeqn(struct mdoc *mdoc, const struct eqn *ep) 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 struct tbl_span *sp) 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; @@ -722,13 +708,6 @@ mdoc_ptext(struct mdoc *mdoc, int line, char *buf, int offs) 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; diff --git a/mdoc_term.c b/mdoc_term.c index 74f86dfb..4629e43a 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.270 2014/07/03 23:24:56 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.271 2014/07/07 15:03:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -275,8 +275,11 @@ terminal_mdoc(void *arg, const struct mdoc *mdoc) 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); } diff --git a/read.c b/read.c index 115a42e9..d491db70 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.65 2014/07/07 11:35:06 schwarze Exp $ */ +/* $Id: read.c,v 1.66 2014/07/07 15:03:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -183,7 +183,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "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", -- 2.47.1