aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-04 17:48:28 +0000
commit6cff4f9d35431af8274477e9e1cd8dbb193f159a (patch)
tree915d9a7213a5eb4bcdd275befff13cc2a5e27720 /mdoc_man.c
parent094f88dec3c7fd9ede485ab47df6943bd7686330 (diff)
downloadmandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.gz
mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.tar.zst
mandoc-6cff4f9d35431af8274477e9e1cd8dbb193f159a.zip
Parser reorg:
Generate the first node on the roff level: .br Fix some column numbers in diagnostic messages while here.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index d1f90372..38fb57e6 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.109 2017/04/24 23:06:18 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.110 2017/05/04 17:48:29 schwarze Exp $ */
/*
* Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -20,6 +20,7 @@
#include <assert.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "mandoc_aux.h"
@@ -238,7 +239,6 @@ static const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {
{ cond_body, pre_en, post_en, NULL, NULL }, /* En */
{ NULL, NULL, NULL, NULL, NULL }, /* Dx */
{ NULL, NULL, post_percent, NULL, NULL }, /* %Q */
- { NULL, pre_br, NULL, NULL, NULL }, /* br */
{ NULL, pre_sp, post_sp, NULL, NULL }, /* sp */
{ NULL, NULL, post_percent, NULL, NULL }, /* %U */
{ NULL, NULL, NULL, NULL, NULL }, /* Ta */
@@ -651,7 +651,16 @@ print_node(DECL_ARGS)
outflags &= ~(MMAN_spc | MMAN_spc_force);
else if (outflags & MMAN_Sm)
outflags |= MMAN_spc;
+ } else if (n->tok < ROFF_MAX) {
+ switch (n->tok) {
+ case ROFF_br:
+ pre_br(meta, n);
+ break;
+ default:
+ abort();
+ }
} else {
+ assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
/*
* Conditionally run the pre-node action handler for a
* node.