summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-24 23:06:10 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-04-24 23:06:10 +0000
commit1995a3997d0b2fa581cf7d4bd1eceeb191637501 (patch)
treebb7b9ab18f0da321ccffc0b14508bb7afc84c6ed /usr.bin/mandoc/man.c
parentccfb087ee81a8766a4705eddacc9fc195e23d163 (diff)
Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h". * Represent mdoc and man macros in enum roff_tok. * Make TOKEN_NONE a proper enum value and use it throughout. * Put the prologue macros first in the macro tables. * Unify mdoc_macroname[] and man_macroname[] into roff_name[].
Diffstat (limited to 'usr.bin/mandoc/man.c')
-rw-r--r--usr.bin/mandoc/man.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index 8d99982e7cd..8246784d40e 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man.c,v 1.116 2017/03/03 13:55:06 schwarze Exp $ */
+/* $OpenBSD: man.c,v 1.117 2017/04/24 23:06:09 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -33,21 +33,6 @@
#include "roff_int.h"
#include "libman.h"
-const char *const __man_macronames[MAN_MAX] = {
- "br", "TH", "SH", "SS",
- "TP", "LP", "PP", "P",
- "IP", "HP", "SM", "SB",
- "BI", "IB", "BR", "RB",
- "R", "B", "I", "IR",
- "RI", "sp", "nf",
- "fi", "RE", "RS", "DT",
- "UC", "PD", "AT", "in",
- "ft", "OP", "EX", "EE",
- "UR", "UE", "ll"
- };
-
-const char * const *man_macronames = __man_macronames;
-
static void man_descope(struct roff_man *, int, int);
static int man_ptext(struct roff_man *, int, char *, int);
static int man_pmacro(struct roff_man *, int, char *, int);
@@ -273,8 +258,8 @@ man_breakscope(struct roff_man *man, int tok)
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
n->line, n->pos, "%s breaks %s",
- tok == TOKEN_NONE ? "TS" : man_macronames[tok],
- man_macronames[n->tok]);
+ tok == TOKEN_NONE ? "TS" : roff_name[tok],
+ roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_ELINE;
@@ -315,8 +300,8 @@ man_breakscope(struct roff_man *man, int tok)
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
n->line, n->pos, "%s breaks %s",
- tok == TOKEN_NONE ? "TS" : man_macronames[tok],
- man_macronames[n->tok]);
+ tok == TOKEN_NONE ? "TS" : roff_name[tok],
+ roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_BLINE;