Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-04

some bug in parser

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Evgeniy Ivanov

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.

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.

==================================================

Reply by email

Florian Klaempfl
to Evgeniy Ivanov
Show quoted text 5 lines
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?

Show quoted text 42 lines
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 - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Evgeniy Ivanov
to Florian Klaempfl

2007/4/5, Florian Klaempfl :

Show quoted text 9 lines
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?

Really. Sorry, I forgot about "forward".

Reply by email