From dfe0c6ee455f4a355885a711c81c5ae06ac20160 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 12 Jun 2010 11:21:44 +0000 Subject: Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed in the "data" union in mdoc_node. Allows me to remove some ugly loops in the front-end and duplicate tests in mdoc_action.c. Add a regression test to make sure we're not doing anything bad (more to come). --- mdoc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mdoc.h') diff --git a/mdoc.h b/mdoc.h index 07490544..def26d77 100644 --- a/mdoc.h +++ b/mdoc.h @@ -272,6 +272,12 @@ enum mdoc_disp { DISP_literal }; +struct mdoc_bd { + const char *offs; + enum mdoc_disp type; + int comp; +}; + /* Node in AST. */ struct mdoc_node { struct mdoc_node *parent; /* parent AST node */ @@ -300,7 +306,7 @@ struct mdoc_node { union { enum mdoc_list list; /* `Bl' nodes */ - enum mdoc_disp disp; /* `Bd' nodes */ + struct mdoc_bd Bd; } data; }; -- cgit