aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-12 11:21:44 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-12 11:21:44 +0000
commitaf1a16ee46c535e7e97fe26fc4c6c05844de41e2 (patch)
treebdb915b10db4fb4c1abb8e6c595cfc2957cb98e2 /mdoc.h
parent0b20ee1ae342d058c3e78b46ba69335c80addfda (diff)
downloadmandoc-af1a16ee46c535e7e97fe26fc4c6c05844de41e2.tar.gz
mandoc-af1a16ee46c535e7e97fe26fc4c6c05844de41e2.tar.zst
mandoc-af1a16ee46c535e7e97fe26fc4c6c05844de41e2.zip
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).
Diffstat (limited to 'mdoc.h')
-rw-r--r--mdoc.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/mdoc.h b/mdoc.h
index 3027400b..bf62321f 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.84 2010/06/12 10:09:19 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.85 2010/06/12 11:21:44 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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;
};