From 6cff4f9d35431af8274477e9e1cd8dbb193f159a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 4 May 2017 17:48:28 +0000 Subject: Parser reorg: Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here. --- mandocdb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index 10023d08..f7dfcab0 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.246 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.247 2017/05/04 17:48:28 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2017 Ingo Schwarze @@ -302,7 +302,6 @@ static const struct mdoc_handler __mdocs[MDOC_MAX - MDOC_Dd] = { { NULL, 0, 0 }, /* En */ { NULL, TYPE_Dx, NODE_NOSRC }, /* Dx */ { NULL, 0, 0 }, /* %Q */ - { NULL, 0, 0 }, /* br */ { NULL, 0, 0 }, /* sp */ { NULL, 0, 0 }, /* %U */ { NULL, 0, 0 }, /* Ta */ @@ -1547,8 +1546,11 @@ parse_mdoc(struct mpage *mpage, const struct roff_meta *meta, { for (n = n->child; n != NULL; n = n->next) { - if (n->tok == TOKEN_NONE || n->flags & mdocs[n->tok].taboo) + if (n->tok == TOKEN_NONE || + n->tok < ROFF_MAX || + n->flags & mdocs[n->tok].taboo) continue; + assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); switch (n->type) { case ROFFT_ELEM: case ROFFT_BLOCK: -- cgit v1.2.3-56-ge451