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.
This commit is contained in:
parent
200034075d
commit
de5ac65dd6
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue