From: ceriel Date: Wed, 29 Oct 1986 11:16:55 +0000 (+0000) Subject: Bug fix. Error recovery did not always work as expected. The generated X-Git-Tag: release-5-5~5175 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=de5ac65dd6ce6e0baf7e7943fff2406dce03f335;p=ack.git Bug fix. Error recovery did not always work as expected. The generated parser sometimes assumed that a token would not be deleted, and inserted tokens in front of it, and then deleted the token after all. It should at each error, first delete, and then insert. --- diff --git a/util/LLgen/src/compute.c b/util/LLgen/src/compute.c index 00c741926..fd42e1ba3 100644 --- a/util/LLgen/src/compute.c +++ b/util/LLgen/src/compute.c @@ -759,6 +759,10 @@ STATIC int nsafes(p) register p_nont p; { i = getntsafe(p); if (i != NOSAFETY) { i = do_safes(p->n_rule, i, &ch); + if (i < SCANDONE) i = SCANDONE; + /* After a nonterminal, we only know whether a scan was done + or not + */ if (getntout(p) != i) { ch = 1; setntout(p,i);