From: Eric S. Raymond Date: Thu, 3 Nov 1994 22:53:28 +0000 (+0000) Subject: We can find block ends now. X-Git-Tag: 1-2~83 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=91e2a6bf3ce2c98488a848a69f18f67656b34281;p=cupl.git We can find block ends now. --- diff --git a/interpret.c b/interpret.c index 48c80cc..a747167 100644 --- a/interpret.c +++ b/interpret.c @@ -336,7 +336,6 @@ static void rewrite(node *tree) if (np->car->type == LABEL) np->car->car->syminf->target = np; -#ifdef _FOO_ /* pull blocks out of the main line */ for_cdr(np, tree) { @@ -347,11 +346,9 @@ static void rewrite(node *tree) node *endnode; bool found = FALSE; -printf("statement %d, label '%s'\n", np->number, sp->car->u.string); - for (endnode = np->cdr; endnode; endnode = endnode->cdr) if (endnode->car->type == LABEL - && endnode->car->cdr->type == BLOCK + && endnode->car->cdr->type == END && strcmp(sp->car->u.string, endnode->car->car->u.string) == 0) { @@ -359,12 +356,11 @@ printf("statement %d, label '%s'\n", np->number, sp->car->u.string); break; } if (!found) - warn("no END matching block label %s\n", sp->car->u.string); - else - (void) printf("found END for %s\n", sp->car->u.string); + die("no END matching block label %s\n", sp->car->u.string); } + + /* rewrite code coes here */ } -#endif /* _FOO_ */ /* now, hack label references to eliminate name references */ recursive_apply(tree, r_label_rewrite);