aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-31 08:18:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-31 08:18:12 +0000
commit6f05a74d1a074bf18303e8d7c95cad567e72e2ea (patch)
tree1598ff9a593ee47b7530f102339baa8252a1f708
parent8027bf3a863c4dd65487affc9c5299479fb0d20f (diff)
downloadmandoc-6f05a74d1a074bf18303e8d7c95cad567e72e2ea.tar.gz
mandoc-6f05a74d1a074bf18303e8d7c95cad567e72e2ea.tar.zst
mandoc-6f05a74d1a074bf18303e8d7c95cad567e72e2ea.zip
Store the fill mode with a new flag NODE_NOFILL in every node,
like it is already done with NODE_SYNPRETTY, such that the fill mode becomes more directly available to the formatters. Not used yet, but will be used by upcoming commits.
-rw-r--r--roff.c6
-rw-r--r--roff.h17
2 files changed, 14 insertions, 9 deletions
diff --git a/roff.c b/roff.c
index f0c56a2b..076f55ec 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.358 2018/12/31 07:08:12 schwarze Exp $ */
+/* $Id: roff.c,v 1.359 2018/12/31 08:18:12 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -889,6 +889,10 @@ roff_node_alloc(struct roff_man *man, int line, int pos,
n->flags |= NODE_SYNPRETTY;
else
n->flags &= ~NODE_SYNPRETTY;
+ if (man->flags & ROFF_NOFILL)
+ n->flags |= NODE_NOFILL;
+ else
+ n->flags &= ~NODE_NOFILL;
if (man->flags & MDOC_NEWLINE)
n->flags |= NODE_LINE;
man->flags &= ~MDOC_NEWLINE;
diff --git a/roff.h b/roff.h
index 1e7bd1a3..a65e5508 100644
--- a/roff.h
+++ b/roff.h
@@ -1,4 +1,4 @@
-/* $Id: roff.h,v 1.67 2018/12/31 07:08:12 schwarze Exp $ */
+/* $Id: roff.h,v 1.68 2018/12/31 08:18:12 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -512,14 +512,15 @@ struct roff_node {
int flags;
#define NODE_VALID (1 << 0) /* Has been validated. */
#define NODE_ENDED (1 << 1) /* Gone past body end mark. */
-#define NODE_EOS (1 << 2) /* At sentence boundary. */
+#define NODE_BROKEN (1 << 2) /* Must validate parent when ending. */
#define NODE_LINE (1 << 3) /* First macro/text on line. */
-#define NODE_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting. */
-#define NODE_BROKEN (1 << 5) /* Must validate parent when ending. */
-#define NODE_DELIMO (1 << 6)
-#define NODE_DELIMC (1 << 7)
-#define NODE_NOSRC (1 << 8) /* Generated node, not in input file. */
-#define NODE_NOPRT (1 << 9) /* Shall not print anything. */
+#define NODE_DELIMO (1 << 4)
+#define NODE_DELIMC (1 << 5)
+#define NODE_EOS (1 << 6) /* At sentence boundary. */
+#define NODE_SYNPRETTY (1 << 7) /* SYNOPSIS-style formatting. */
+#define NODE_NOFILL (1 << 8) /* Fill mode switched off. */
+#define NODE_NOSRC (1 << 9) /* Generated node, not in input file. */
+#define NODE_NOPRT (1 << 10) /* Shall not print anything. */
int prev_font; /* Before entering this node. */
int aux; /* Decoded node data, type-dependent. */
enum roff_tok tok; /* Request or macro ID. */