diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 23:42:28 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-07-21 23:42:28 +0000 |
commit | 4a9b3b91ed883201108726196caa6825d5df0914 (patch) | |
tree | 68d9b05aed786bd75733ac40449c411a8aa9c56c /eqn.c | |
parent | 561fdaf67b6be484562a755697a834c21b10e4d9 (diff) | |
download | mandoc-4a9b3b91ed883201108726196caa6825d5df0914.tar.gz |
Fix eqn handling of PILE clauses (multiple ABOVE statements may be
specified for each PILE).
Diffstat (limited to 'eqn.c')
-rw-r--r-- | eqn.c | 31 |
1 files changed, 14 insertions, 17 deletions
@@ -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); } |