![]() ![]() | ![]() |
version 1.71, 2017/06/26 20:09:04 | version 1.73, 2017/07/05 15:03:27 | ||
---|---|---|---|
|
|
||
if (ep->data == NULL) | if (ep->data == NULL) | ||
return ROFF_IGN; | return ROFF_IGN; | ||
ep->start = ep->end = ep->data; | ep->start = ep->end = ep->data + strspn(ep->data, " ^~"); | ||
next_tok: | next_tok: | ||
tok = eqn_next(ep, MODE_TOK); | tok = eqn_next(ep, MODE_TOK); | ||
|
|
||
cur->text = mandoc_strdup(""); | cur->text = mandoc_strdup(""); | ||
} | } | ||
parent = eqn_box_makebinary(ep, EQNPOS_NONE, parent); | parent = eqn_box_makebinary(ep, EQNPOS_NONE, parent); | ||
parent->type = EQN_LISTONE; | parent->type = EQN_LIST; | ||
parent->expectargs = 1; | parent->expectargs = 1; | ||
parent->font = EQNFONT_ROMAN; | parent->font = EQNFONT_ROMAN; | ||
switch (tok) { | switch (tok) { | ||
|
|
||
* exactly one of those. | * exactly one of those. | ||
*/ | */ | ||
parent = eqn_box_alloc(ep, parent); | parent = eqn_box_alloc(ep, parent); | ||
parent->type = EQN_LISTONE; | parent->type = EQN_LIST; | ||
parent->expectargs = 1; | parent->expectargs = 1; | ||
switch (tok) { | switch (tok) { | ||
case EQN_TOK_FAT: | case EQN_TOK_FAT: | ||
|
|
||
break; | break; | ||
} | } | ||
parent = eqn_box_alloc(ep, parent); | parent = eqn_box_alloc(ep, parent); | ||
parent->type = EQN_LISTONE; | parent->type = EQN_LIST; | ||
parent->expectargs = 1; | parent->expectargs = 1; | ||
parent->size = size; | parent->size = size; | ||
break; | break; | ||
|
|
||
*/ | */ | ||
for (cur = parent; cur != NULL; cur = cur->parent) | for (cur = parent; cur != NULL; cur = cur->parent) | ||
if (cur->type == EQN_LIST && | if (cur->type == EQN_LIST && | ||
cur->expectargs > 1 && | |||
(tok == EQN_TOK_BRACE_CLOSE || | (tok == EQN_TOK_BRACE_CLOSE || | ||
cur->left != NULL)) | cur->left != NULL)) | ||
break; | break; | ||
|
|
||
parent->type == EQN_MATRIX)) | parent->type == EQN_MATRIX)) | ||
parent = parent->parent; | parent = parent->parent; | ||
/* Close out any "singleton" lists. */ | /* Close out any "singleton" lists. */ | ||
while (parent->type == EQN_LISTONE && | while (parent->type == EQN_LIST && | ||
parent->args == parent->expectargs) | parent->expectargs == 1 && | ||
parent->args == 1) | |||
parent = parent->parent; | parent = parent->parent; | ||
break; | break; | ||
case EQN_TOK_BRACE_OPEN: | case EQN_TOK_BRACE_OPEN: | ||
|
|
||
/* | /* | ||
* Post-process list status. | * Post-process list status. | ||
*/ | */ | ||
while (parent->type == EQN_LISTONE && | while (parent->type == EQN_LIST && | ||
parent->args == parent->expectargs) | parent->expectargs == 1 && | ||
parent->args == 1) | |||
parent = parent->parent; | parent = parent->parent; | ||
break; | break; | ||
default: | default: |