Hi

I created a ticket in RT two days ago (well, one day ago) and still waiting for it to be created, so, forget RT and here it goes.

At the moment parrot stopped in the first error it encounter. Basically, if you have a file with 10 errors, you need to run 10 times parrot to correct them.

As other decent compilers do (gcc, at least), they try to recover and continue parsing, this way giving the most information about the program it can.

Ok, now parrot does that too. Or at least, my version in my laptop. Changes are basically on these files:
M      compilers/imcc/imcc.y
M      compilers/imcc/imcparser.c
M      compilers/imcc/imcparser.h
M      compilers/imcc/imclexer.c
M      compilers/imcc/imc.h
M      compilers/imcc/main.c
M      compilers/imcc/imcc.l
M      t/compilers/imcc/syn/file.t
M      t/compilers/imcc/syn/errors.t

and in the output that parrot gives everytime it runs. Btw, if it encounters more than N errors (N being 40 atm), parrot does not try to recover anymore.

Talked with Leo already and he thinks this is a good approach, but as it changes some of the behaviour of parrot, please let me know until Sunday Afternoon if there is anything wrong with this patch. If nobody says a thing, I'll just apply it.

Cheers
Alberto
--
Alberto Simões - Departamento de Informática - Universidade do Minho
                 Campus de Gualtar - 4710-057 Braga - Portugal

"Beware of bugs in the above code;
 I have only proved it correct, not tried it."
                                   --- Donald Knuth

Attachment: ErrorRecovery.diff.gz
Description: GNU Zip compressed data

Reply via email to