aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-21 23:42:28 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-21 23:42:28 +0000
commit4203843b4b3d7c453508e83eb6824fbd1b2f76bc (patch)
tree686d2db0761f361f952b95ed1da67f53f3dad3b5 /eqn.c
parent1f1fa3776c03b51f845d9d9f54cbc3c980f6ead6 (diff)
downloadmandoc-4203843b4b3d7c453508e83eb6824fbd1b2f76bc.tar.gz
mandoc-4203843b4b3d7c453508e83eb6824fbd1b2f76bc.tar.zst
mandoc-4203843b4b3d7c453508e83eb6824fbd1b2f76bc.zip
Fix eqn handling of PILE clauses (multiple ABOVE statements may be
specified for each PILE).
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/eqn.c b/eqn.c
index 79051681..41a5950e 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.20 2011/07/21 23:30:39 kristaps Exp $ */
+/* $Id: eqn.c,v 1.21 2011/07/21 23:42:28 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -259,33 +259,30 @@ eqn_box(struct eqn_node *ep, struct eqn_box *last)
EQN_MSG(MANDOCERR_EQNSYNT, ep);
return(EQN_ERR);
}
- if (EQN_DESCOPE != (c = eqn_eqn(ep, last))) {
- if (EQN_ERR != c)
- EQN_MSG(MANDOCERR_EQNSCOPE, ep);
- return(EQN_ERR);
- }
- assert(last->last);
- last->last->pile = (enum eqn_pilet)i;
- eqn_rewind(ep);
- start = eqn_nexttok(ep, &sz);
- assert(start);
- if (1 == sz && 0 == strncmp("}", start, 1))
- return(EQN_OK);
- if (5 != sz || strncmp("above", start, 5)) {
- EQN_MSG(MANDOCERR_EQNSYNT, ep);
- return(EQN_ERR);
+
+ while (EQN_DESCOPE == (c = eqn_eqn(ep, last))) {
+ assert(last->last);
+ last->last->pile = (enum eqn_pilet)i;
+ eqn_rewind(ep);
+ start = eqn_nexttok(ep, &sz);
+ assert(start);
+ if (5 != sz || strncmp("above", start, 5))
+ break;
+ last->last->above = 1;
}
- last->last->above = 1;
- if (EQN_DESCOPE != (c = eqn_eqn(ep, last))) {
+
+ if (EQN_DESCOPE != c) {
if (EQN_ERR != c)
EQN_MSG(MANDOCERR_EQNSCOPE, ep);
return(EQN_ERR);
}
+
eqn_rewind(ep);
start = eqn_nexttok(ep, &sz);
assert(start);
if (1 == sz && 0 == strncmp("}", start, 1))
return(EQN_OK);
+
EQN_MSG(MANDOCERR_EQNBADSCOPE, ep);
return(EQN_ERR);
}