aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2014-10-10 08:44:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2014-10-10 08:44:24 +0000
commit08be124a58f07e4e41c58ea794f3e9eb04230e2b (patch)
tree7ae377429c8c326e79f2bb6133d4f43f2a9dfecc /mandoc.h
parent12f47a5652f90a1d86d7f6245d2d7f4dfae9f04e (diff)
downloadmandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.tar.gz
mandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.tar.zst
mandoc-08be124a58f07e4e41c58ea794f3e9eb04230e2b.zip
Re-write of eqn(7) parser and MathML output.
This adds parser-level support for the grammar described by the eqn second-edition technical paper, "Typesetting Mathematics — User's Guide" (Kernighan, Cherry). The reason for this re-write is the grouping rules, which were not possible given the existing implementation. The re-write has also considerably simplified the HTML (and, if it ever is completed, terminal) front-end.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/mandoc.h b/mandoc.h
index bf1c061b..ce673875 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.158 2014/09/28 14:05:11 kristaps Exp $ */
+/* $Id: mandoc.h,v 1.159 2014/10/10 08:44:24 kristaps Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -306,21 +306,10 @@ enum eqn_boxt {
EQN_ROOT, /* root of parse tree */
EQN_TEXT, /* text (number, variable, whatever) */
EQN_SUBEXPR, /* nested `eqn' subexpression */
- EQN_LIST, /* subexpressions list */
- EQN_MATRIX /* matrix subexpression */
-};
-
-enum eqn_markt {
- EQNMARK_NONE = 0,
- EQNMARK_DOT,
- EQNMARK_DOTDOT,
- EQNMARK_HAT,
- EQNMARK_TILDE,
- EQNMARK_VEC,
- EQNMARK_DYAD,
- EQNMARK_BAR,
- EQNMARK_UNDER,
- EQNMARK__MAX
+ EQN_LIST, /* list (braces, etc.) */
+ EQN_LISTONE, /* singleton list */
+ EQN_PILE, /* vertical pile */
+ EQN_MATRIX /* pile of piles */
};
enum eqn_fontt {
@@ -334,13 +323,14 @@ enum eqn_fontt {
enum eqn_post {
EQNPOS_NONE = 0,
- EQNPOS_OVER,
EQNPOS_SUP,
EQNPOS_SUBSUP,
EQNPOS_SUB,
EQNPOS_TO,
EQNPOS_FROM,
EQNPOS_FROMTO,
+ EQNPOS_OVER,
+ EQNPOS_SQRT,
EQNPOS__MAX
};
@@ -371,10 +361,13 @@ struct eqn_box {
struct eqn_box *prev; /* node sibling */
struct eqn_box *parent; /* node sibling */
char *text; /* text (or NULL) */
- char *left;
- char *right;
+ char *left; /* fence left-hand */
+ char *right; /* fence right-hand */
+ char *top; /* expression over-symbol */
+ char *bottom; /* expression under-symbol */
+ size_t args; /* arguments in parent */
+ size_t expectargs; /* max arguments in parent */
enum eqn_post pos; /* position of next box */
- enum eqn_markt mark; /* a mark about the box */
enum eqn_fontt font; /* font of box */
enum eqn_pilet pile; /* equation piling */
};