diff options
-rw-r--r-- | mdoc.c | 10 | ||||
-rw-r--r-- | mdoc.h | 27 | ||||
-rw-r--r-- | mdoc_action.c | 3 | ||||
-rw-r--r-- | mdoc_argv.c | 3 | ||||
-rw-r--r-- | mdoc_macro.c | 3 | ||||
-rw-r--r-- | mdoc_term.c | 10 | ||||
-rw-r--r-- | mdoc_validate.c | 3 |
7 files changed, 28 insertions, 31 deletions
@@ -34,7 +34,7 @@ enum merr { }; const char *const __mdoc_macronames[MDOC_MAX] = { - "\\\"", "Dd", "Dt", "Os", + "Ap", "Dd", "Dt", "Os", "Sh", "Ss", "Pp", "D1", "Dl", "Bd", "Ed", "Bl", "El", "It", "Ad", "An", @@ -63,12 +63,12 @@ const char *const __mdoc_macronames[MDOC_MAX] = { "Tn", "Ux", "Xc", "Xo", "Fo", "Fc", "Oo", "Oc", "Bk", "Ek", "Bt", "Hf", - "Fr", "Ud", "Lb", "Ap", - "Lp", "Lk", "Mt", "Brq", + "Fr", "Ud", "Lb", "Lp", + "Lk", "Mt", "Brq", "Bro", /* LINTED */ - "Bro", "Brc", "\%C", "Es", + "Brc", "\%C", "Es", "En", /* LINTED */ - "En", "Dx", "\%Q" + "Dx", "\%Q" }; const char *const __mdoc_argnames[MDOC_ARG_MAX] = { @@ -29,7 +29,7 @@ /* What follows is a list of ALL possible macros. */ -#define MDOC___ 0 +#define MDOC_Ap 0 #define MDOC_Dd 1 #define MDOC_Dt 2 #define MDOC_Os 3 @@ -136,19 +136,18 @@ #define MDOC_Fr 104 #define MDOC_Ud 105 #define MDOC_Lb 106 -#define MDOC_Ap 107 -#define MDOC_Lp 108 -#define MDOC_Lk 109 -#define MDOC_Mt 110 -#define MDOC_Brq 111 -#define MDOC_Bro 112 -#define MDOC_Brc 113 -#define MDOC__C 114 -#define MDOC_Es 115 -#define MDOC_En 116 -#define MDOC_Dx 117 -#define MDOC__Q 118 -#define MDOC_MAX 119 +#define MDOC_Lp 107 +#define MDOC_Lk 108 +#define MDOC_Mt 109 +#define MDOC_Brq 110 +#define MDOC_Bro 111 +#define MDOC_Brc 112 +#define MDOC__C 113 +#define MDOC_Es 114 +#define MDOC_En 115 +#define MDOC_Dx 116 +#define MDOC__Q 117 +#define MDOC_MAX 118 /* What follows is a list of ALL possible macro arguments. */ diff --git a/mdoc_action.c b/mdoc_action.c index 660f1fff..4a314905 100644 --- a/mdoc_action.c +++ b/mdoc_action.c @@ -71,7 +71,7 @@ static int pre_dl(PRE_ARGS); #define nerr(m, n, t) perr((m), (n)->line, (n)->pos, (t)) const struct actions mdoc_actions[MDOC_MAX] = { - { NULL, NULL }, /* \" */ + { NULL, NULL }, /* Ap */ { NULL, post_dd }, /* Dd */ { NULL, post_dt }, /* Dt */ { NULL, post_os }, /* Os */ @@ -178,7 +178,6 @@ const struct actions mdoc_actions[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { NULL, NULL }, /* Ud */ { NULL, NULL }, /* Lb */ - { NULL, NULL }, /* Ap */ { NULL, NULL }, /* Lp */ { NULL, post_lk }, /* Lk */ { NULL, NULL }, /* Mt */ diff --git a/mdoc_argv.c b/mdoc_argv.c index bf36b9f5..cae37572 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -105,7 +105,7 @@ static int mdoc_argvflags[MDOC_ARG_MAX] = { }; static int mdoc_argflags[MDOC_MAX] = { - 0, /* \" */ + 0, /* Ap */ 0, /* Dd */ 0, /* Dt */ 0, /* Os */ @@ -212,7 +212,6 @@ static int mdoc_argflags[MDOC_MAX] = { 0, /* Fr */ 0, /* Ud */ 0, /* Lb */ - 0, /* Ap */ ARGS_DELIM, /* Lp */ ARGS_DELIM | ARGS_QUOTED, /* Lk */ ARGS_DELIM | ARGS_QUOTED, /* Mt */ diff --git a/mdoc_macro.c b/mdoc_macro.c index 79134d56..deb03e3d 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -74,7 +74,7 @@ static int swarn(struct mdoc *, enum mdoc_type, int, int, /* Central table of library: who gets parsed how. */ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { - { NULL, 0 }, /* \" */ + { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ap */ { in_line_eoln, MDOC_PROLOGUE }, /* Dd */ { in_line_eoln, MDOC_PROLOGUE }, /* Dt */ { in_line_eoln, MDOC_PROLOGUE }, /* Os */ @@ -181,7 +181,6 @@ const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { { obsolete, 0 }, /* Fr */ { in_line_eoln, 0 }, /* Ud */ { in_line_eoln, 0 }, /* Lb */ - { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ap */ { in_line, 0 }, /* Lp */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */ diff --git a/mdoc_term.c b/mdoc_term.c index 35ec24e7..cf6a8b50 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -183,7 +183,7 @@ struct termact { }; static const struct termact termacts[MDOC_MAX] = { - { NULL, NULL }, /* \" */ + { termp_ap_pre, NULL }, /* Ap */ { NULL, NULL }, /* Dd */ { NULL, NULL }, /* Dt */ { NULL, NULL }, /* Os */ @@ -290,8 +290,7 @@ static const struct termact termacts[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { termp_ud_pre, NULL }, /* Ud */ { termp_lb_pre, termp_lb_post }, /* Lb */ - { termp_ap_pre, NULL }, /* Lb */ - { termp_pp_pre, NULL }, /* Pp */ + { termp_pp_pre, NULL }, /* Lp */ { termp_lk_pre, NULL }, /* Lk */ { termp_mt_pre, NULL }, /* Mt */ { termp_brq_pre, termp_brq_post }, /* Brq */ @@ -336,7 +335,10 @@ mdoc_run(struct termp *p, const struct mdoc *m) */ print_head(p, mdoc_meta(m)); - print_body(p, NULL, mdoc_meta(m), mdoc_node(m)); + assert(mdoc_node(m)); + assert(MDOC_ROOT == mdoc_node(m)->type); + if (mdoc_node(m)->child) + print_body(p, NULL, mdoc_meta(m), mdoc_node(m)->child); print_foot(p, mdoc_meta(m)); return(1); } diff --git a/mdoc_validate.c b/mdoc_validate.c index ebd023d8..5bc3bec1 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -191,7 +191,7 @@ static v_post posts_bf[] = { hwarn_le1, post_bf, NULL }; static v_post posts_fo[] = { hwarn_eq1, bwarn_ge1, NULL }; const struct valids mdoc_valids[MDOC_MAX] = { - { NULL, NULL }, /* \" */ + { NULL, NULL }, /* Ap */ { pres_dd, posts_text }, /* Dd */ { pres_dt, NULL }, /* Dt */ { pres_os, NULL }, /* Os */ @@ -298,7 +298,6 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { NULL, posts_notext }, /* Ud */ { pres_lb, posts_lb }, /* Lb */ - { NULL, NULL }, /* Ap */ { NULL, posts_pp }, /* Lp */ { NULL, NULL }, /* Lk */ { NULL, posts_text }, /* Mt */ |