Waldek Hebisch wrote:
Waldek Hebisch wrote:
- Ada front end is very different from GPC. At least one GPC bug would be very easy to fix if GPC worked the Gnat way (but GPC is much simpler then Gnat).
Which one exactly are you referring to?
The following program ilustrates the problem (AFAIR something similar is in the todo directory). In procedure k reference to x is illegal becouse k is in the scope of second declaratin, but before the defining point. It would be easy to catch such things by tree-walk, but otherwise housekeeping is quite messy.
program scope; var x : integer; procedure p; procedure k; begin x:= x+1; end; var x : boolean; begin end; begin writeln('failed') end .
But the declaration of x itself is illegal there. It belongs between the "procedure p;" and the "procedure k;" lines. Proper indentation makes it obvious (below) or am I missing something?
program scope; var x : integer; procedure p; var x : boolean; (* line belongs here *) procedure k; begin x:= x+1; (* error on boolean *) end; begin end; begin writeln('failed') end.