diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 14:13:00 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 14:13:00 +0000 |
commit | faba8b69bbb1a57a9980aa454612ab8cca95e93a (patch) | |
tree | 33fe5371dd53025f8af04366049bd8871ac78fbf /eqn.c | |
parent | 62a9685b8f83f61948148be5fd01ec614799aeea (diff) | |
download | mandoc-faba8b69bbb1a57a9980aa454612ab8cca95e93a.tar.gz |
Full support for eqn positionals (above, over, sup, sub, etc.).
Diffstat (limited to 'eqn.c')
-rw-r--r-- | eqn.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -80,11 +80,22 @@ static const struct eqnstr eqnmarks[EQNMARK__MAX] = { }; static const struct eqnstr eqnfonts[EQNFONT__MAX] = { + { "", 0 }, { "roman", 5 }, { "bold", 4 }, { "italic", 6 }, }; +static const struct eqnstr eqnposs[EQNPOS__MAX] = { + { "", 0 }, + { "over", 4 }, + { "sup", 3 }, + { "sub", 3 }, + { "to", 2 }, + { "from", 4 }, + { "above", 5 }, +}; + /* ARGSUSED */ enum rofferr eqn_read(struct eqn_node **epp, int ln, @@ -189,8 +200,7 @@ eqn_box(struct eqn_node *ep, struct eqn_box *last, struct eqn_box **sv) *sv = last; nextc = 1; - font = EQNFONT_NONE; - + font = EQNFONT_NONE; again: if (NULL == (start = eqn_nexttok(ep, &sz))) return(0); @@ -204,6 +214,15 @@ again: goto again; } + for (i = 0; i < (int)EQNFONT__MAX; i++) { + if (eqnposs[i].sz != sz) + continue; + if (strncmp(eqnposs[i].name, start, sz)) + continue; + last->pos = (enum eqn_post)i; + goto again; + } + for (i = 0; i < (int)EQN__MAX; i++) { if (eqnparts[i].str.sz != sz) continue; |