=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.106 retrieving revision 1.113 diff -u -p -r1.106 -r1.113 --- mandoc/mdoc.h 2010/12/15 14:52:16 1.106 +++ mandoc/mdoc.h 2010/12/26 14:44:13 1.113 @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.106 2010/12/15 14:52:16 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.113 2010/12/26 14:44:13 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -353,16 +353,21 @@ struct mdoc_an { enum mdoc_auth auth; /* -split, etc. */ }; +struct mdoc_rs { + struct mdoc_node *child_J; /* pointer to %J */ +}; + /* * Consists of normalised node arguments. These should be used instead * of iterating through the mdoc_arg pointers of a node: defaults are * provided, etc. */ -union mdoc_data { +union mdoc_data { struct mdoc_an An; - struct mdoc_bd *Bd; - struct mdoc_bf *Bf; - struct mdoc_bl *Bl; + struct mdoc_bd Bd; + struct mdoc_bf Bf; + struct mdoc_bl Bl; + struct mdoc_rs Rs; }; /* @@ -371,6 +376,7 @@ union mdoc_data { struct mdoc_node { struct mdoc_node *parent; /* parent AST node */ struct mdoc_node *child; /* first child AST node */ + struct mdoc_node *last; /* last child AST node */ struct mdoc_node *next; /* sibling AST node */ struct mdoc_node *prev; /* prior sibling AST node */ int nchild; /* number children */ @@ -379,13 +385,13 @@ struct mdoc_node { enum mdoct tok; /* tok or MDOC__MAX if none */ int flags; #define MDOC_VALID (1 << 0) /* has been validated */ -#define MDOC_ACTED (1 << 1) /* has been acted upon */ #define MDOC_EOS (1 << 2) /* at sentence boundary */ #define MDOC_LINE (1 << 3) /* first macro/text on line */ #define MDOC_SYNPRETTY (1 << 4) /* SYNOPSIS-style formatting */ #define MDOC_ENDED (1 << 5) /* rendering has been ended */ enum mdoc_type type; /* AST node type */ enum mdoc_sec sec; /* current named section */ + union mdoc_data *norm; /* normalised args */ /* FIXME: these can be union'd to shave a few bytes. */ struct mdoc_arg *args; /* BLOCK/ELEM */ struct mdoc_node *pending; /* BLOCK */ @@ -394,7 +400,6 @@ struct mdoc_node { struct mdoc_node *tail; /* BLOCK */ char *string; /* TEXT */ enum mdoc_endbody end; /* BODY */ - union mdoc_data data; }; /*