aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_data.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-08 17:52:49 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-08 17:52:49 +0000
commit5b9fac5e713255fd71fe6d4dfb25ad29e2db9413 (patch)
tree8ec52bbf39f33db83019b6b793c1a6e9fa7fdfbb /tbl_data.c
parent6ebbfa9eba538830064426c0d6621de116539b03 (diff)
downloadmandoc-5b9fac5e713255fd71fe6d4dfb25ad29e2db9413.tar.gz
mandoc-5b9fac5e713255fd71fe6d4dfb25ad29e2db9413.tar.zst
mandoc-5b9fac5e713255fd71fe6d4dfb25ad29e2db9413.zip
Simplify by creating struct roff_node syntax tree nodes for tbl(7)
right from roff_parseln() rather than delegating to read.c, similar to what i just did for eqn(7). The interface function roff_span() becomes obsolete and is deleted, the former interface function roff_addtbl() becomes static, the interface functions tbl_read() and tbl_cdata() become void, and minus twelve linus of code. No functional change.
Diffstat (limited to 'tbl_data.c')
-rw-r--r--tbl_data.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tbl_data.c b/tbl_data.c
index a6b6962e..ae1906ef 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_data.c,v 1.44 2017/07/04 21:08:29 schwarze Exp $ */
+/* $Id: tbl_data.c,v 1.45 2017/07/08 17:52:50 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -128,7 +128,7 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp,
tbl->parse, ln, sv, dat->string);
}
-int
+void
tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos)
{
struct tbl_dat *dat;
@@ -143,10 +143,10 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos)
pos++;
while (p[pos] != '\0')
getdata(tbl, tbl->last_span, ln, p, &pos);
- return 1;
+ return;
} else if (p[pos] == '\0') {
tbl->part = TBL_PART_DATA;
- return 1;
+ return;
}
/* Fallthrough: T} is part of a word. */
@@ -166,8 +166,6 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos)
if (dat->layout->pos == TBL_CELL_DOWN)
mandoc_msg(MANDOCERR_TBLDATA_SPAN, tbl->parse,
ln, pos, dat->string);
-
- return 0;
}
static struct tbl_span *