diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 12:30:44 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 12:30:44 +0000 |
commit | 29705bfc7b3e67b1a949858f4629bf261e31def1 (patch) | |
tree | a566d92de2a211c3ccefb76078da044269b1e5c2 /mandoc.h | |
parent | 984843a13d3cf51a40ccae5218578c091429a4a1 (diff) | |
download | mandoc-29705bfc7b3e67b1a949858f4629bf261e31def1.tar.gz |
Support nested `{, }' subexpressions in eqn. Document in code.
Diffstat (limited to 'mandoc.h')
-rw-r--r-- | mandoc.h | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -112,6 +112,8 @@ enum mandocerr { /* related to equations */ MANDOCERR_EQNARGS, /* bad equation macro arguments */ MANDOCERR_EQNNEST, /* too many nested equation defines */ + MANDOCERR_EQNNSCOPE, /* unexpected equation scope closure*/ + MANDOCERR_EQNSCOPE, /* equation scope open on exit */ /* related to tables */ MANDOCERR_TBL, /* bad table syntax */ @@ -278,19 +280,24 @@ struct tbl_span { }; enum eqn_boxt { - EQN_ROOT, - EQN_TEXT + EQN_ROOT, /* root of parse tree */ + EQN_TEXT, /* text (number, variable, whatever) */ + EQN_SUBEXPR /* nested subexpression */ }; +/* + * A "box" is a parsed mathematical expression as defined by the eqn.7 + * grammar. + */ struct eqn_box { - enum eqn_boxt type; - struct eqn_box *child; - struct eqn_box *next; - char *text; + enum eqn_boxt type; /* type of node */ + struct eqn_box *child; /* child node */ + struct eqn_box *next; /* next in tree */ + char *text; /* text (or NULL) */ }; struct eqn { - struct eqn_box *root; + struct eqn_box *root; /* root mathematical expression */ int ln; /* invocation line */ int pos; /* invocation position */ }; |