[fpc-devel] Semicolon before else

Aleksa Todorovic alexione at gmail.com
Thu Jan 28 22:26:21 CET 2010

On Tue, Jan 26, 2010 at 10:56, Juha Manninen <juha.manninen at phnet.fi> wrote:
> Object Pascal is otherwise a nice language but there are few annoying syntax
> details that other languages have solved better. Three such cases pop into my
> mind:
> 1. This semicolon / no semicolon irritation.

I'm trying to solve that one :-) So, here's an updated patch with
several improvements:
- parser now only uses some additional info from scanner, it doesn't
do any modification to scanner internals
- full backward compatibility: problematic else inside case is
correctly recognized (weather it is part of last if statement or part
of case, including nested if/else-s)
- modified fpc can successfully recompile trunk versions of fpc and
lazarus (as well as projects I work on) and everything seems to work
- there is also test program, but it uses ordinary Writeln-s, still
need to see how convert that to true fpc test

Due to deadlines I have these days, I wont have time to work more on
this. After that, if there is good will to accept this patch, I will
gladly take some time to make tests and do any modifications needed.

If not, there is another thing I badly need - generics of records, so
I'll try to make them usable (before, as Florian said in ticket we
"bite the bullet and support methods and operators inside records

-------------- next part --------------
A non-text attachment was scrubbed...
Name: semicolon_before_else2.patch
Type: application/octet-stream
Size: 7074 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20100128/a51c10c5/attachment.obj>

More information about the fpc-devel mailing list