[fpc-devel] some bug in parser
Florian Klaempfl
florian at freepascal.org
Thu Apr 5 21:17:25 CEST 2007
Evgeniy Ivanov schrieb:
> Hi! I've found an interesting bug. It makes an error while checking
> for errors (found "." after end, but ";" expected). And it is
> difficult to find it in the big part of code.
>
> I decided to post here, becouse I've found it is very interesting.
It's not a bug, the compiler thinks you want to declare nested procedures?
>
> Here is a simple example:
>
>
> main.pas:
> ==================================================
> program buggy;
>
> procedure some_act1;
> procedure some_act2;
> var
> variable:Integer;
> procedure global_act;
> var
> global:Integer;
> begin
> writeln('Global');
> some_act1;
> some_act2;
> end;
>
> procedure some_act1;
> begin
> writeln('Act1');
> end;
>
> procedure some_act2;
> begin
> writeln('Act2');
> end;
>
> var
> s:string;
> begin
> s:='Main!';
> writeln(s);
> end.
>
> ==================================================
> _______________________________________________
> fpc-devel maillist - fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
More information about the fpc-devel
mailing list