From 820b4d56427ff6a0f1e3399ac7e4aea447dd5c20 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 3 Dec 2018 21:00:10 +0000 Subject: In the validators, translate obsolete macro aliases (Lp, Ot, LP, P) to the standard forms (Pp, Ft, PP) up front, such that later code does not need to look for the obsolete versions. This reduces the risk of incomplete handling. --- mdoc_term.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'mdoc_term.c') diff --git a/mdoc_term.c b/mdoc_term.c index 073cd4cb..13ed6880 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.368 2018/08/17 20:33:38 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.369 2018/12/03 21:00:11 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2018 Ingo Schwarze @@ -84,6 +84,7 @@ static void termp_xx_post(DECL_ARGS); static int termp__a_pre(DECL_ARGS); static int termp__t_pre(DECL_ARGS); +static int termp_abort_pre(DECL_ARGS); static int termp_an_pre(DECL_ARGS); static int termp_ap_pre(DECL_ARGS); static int termp_bd_pre(DECL_ARGS); @@ -159,7 +160,7 @@ static const struct mdoc_term_act mdoc_term_acts[MDOC_MAX - MDOC_Dd] = { { termp_nd_pre, NULL }, /* Nd */ { termp_nm_pre, termp_nm_post }, /* Nm */ { termp_quote_pre, termp_quote_post }, /* Op */ - { termp_ft_pre, NULL }, /* Ot */ + { termp_abort_pre, NULL }, /* Ot */ { termp_under_pre, NULL }, /* Pa */ { termp_ex_pre, NULL }, /* Rv */ { NULL, NULL }, /* St */ @@ -232,7 +233,7 @@ static const struct mdoc_term_act mdoc_term_acts[MDOC_MAX - MDOC_Dd] = { { termp_under_pre, NULL }, /* Fr */ { NULL, NULL }, /* Ud */ { NULL, termp_lb_post }, /* Lb */ - { termp_pp_pre, NULL }, /* Lp */ + { termp_abort_pre, NULL }, /* Lp */ { termp_lk_pre, NULL }, /* Lk */ { termp_under_pre, NULL }, /* Mt */ { termp_quote_pre, termp_quote_post }, /* Brq */ @@ -1493,7 +1494,6 @@ termp_bd_pre(DECL_ARGS) case MDOC_Bl: case MDOC_D1: case MDOC_Dl: - case MDOC_Lp: case MDOC_Pp: continue; default: @@ -2098,3 +2098,9 @@ termp_tag_pre(DECL_ARGS) tag_put(n->child->string, 1, p->line); return 1; } + +static int +termp_abort_pre(DECL_ARGS) +{ + abort(); +} -- cgit v1.2.3