diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-05-04 17:48:28 +0000 |
commit | 6cff4f9d35431af8274477e9e1cd8dbb193f159a (patch) | |
tree | 915d9a7213a5eb4bcdd275befff13cc2a5e27720 /man_term.c | |
parent | 094f88dec3c7fd9ede485ab47df6943bd7686330 (diff) | |
download | mandoc-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 'man_term.c')
-rw-r--r-- | man_term.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.192 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: man_term.c,v 1.193 2017/05/04 17:48:28 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -116,7 +116,6 @@ static const struct termact __termacts[MAN_MAX - MAN_TH] = { { pre_I, NULL, 0 }, /* I */ { pre_alternate, NULL, 0 }, /* IR */ { pre_alternate, NULL, 0 }, /* RI */ - { pre_sp, NULL, MAN_NOTEXT }, /* br */ { pre_sp, NULL, MAN_NOTEXT }, /* sp */ { pre_literal, NULL, 0 }, /* nf */ { pre_literal, NULL, 0 }, /* fi */ @@ -458,7 +457,7 @@ pre_sp(DECL_ARGS) } } - if (n->tok == MAN_br) + if (n->tok == ROFF_br) len = 0; else if (n->child == NULL) len = 1; @@ -987,6 +986,18 @@ print_man_node(DECL_ARGS) break; } + if (n->tok < ROFF_MAX) { + switch (n->tok) { + case ROFF_br: + pre_sp(p, mt, n, meta); + break; + default: + abort(); + } + return; + } + + assert(n->tok >= MAN_TH && n->tok <= MAN_MAX); if ( ! (MAN_NOTEXT & termacts[n->tok].flags)) term_fontrepl(p, TERMFONT_NONE); |