aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-17 23:57:06 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-17 23:57:06 +0000
commitcdb13dfdb74f836f6d3b1fd54bc0b06dcc4d2ef5 (patch)
tree770d842591d5e9e62ecaec4c83ec4613a2a7684a /mdoc.h
parentbbeff922272e1f11c46dc4ae581934e3d0108e34 (diff)
downloadmandoc-cdb13dfdb74f836f6d3b1fd54bc0b06dcc4d2ef5.tar.gz
mandoc-cdb13dfdb74f836f6d3b1fd54bc0b06dcc4d2ef5.tar.zst
mandoc-cdb13dfdb74f836f6d3b1fd54bc0b06dcc4d2ef5.zip
Increase performance by stashing the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can known whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this.
Diffstat (limited to 'mdoc.h')
-rw-r--r--mdoc.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/mdoc.h b/mdoc.h
index b8d39beb..3476073c 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.81 2010/05/17 22:11:42 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.82 2010/05/17 23:57:06 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -247,6 +247,21 @@ struct mdoc_arg {
unsigned int refcnt;
};
+enum mdoc_list {
+ LIST__NONE = 0,
+ LIST_bullet,
+ LIST_column,
+ LIST_dash,
+ LIST_diag,
+ LIST_enum,
+ LIST_hang,
+ LIST_hyphen,
+ LIST_inset,
+ LIST_item,
+ LIST_ohang,
+ LIST_tag
+};
+
/* Node in AST. */
struct mdoc_node {
struct mdoc_node *parent; /* parent AST node */
@@ -272,6 +287,10 @@ struct mdoc_node {
struct mdoc_node *body; /* BLOCK */
struct mdoc_node *tail; /* BLOCK */
char *string; /* TEXT */
+
+ union {
+ enum mdoc_list list; /* for `Bl' nodes */
+ } data;
};
#define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */