[fpc-devel] Semicolon before else

Aleksa Todorovic alexione at gmail.com
Tue Jan 26 12:08:21 CET 2010


On Tue, Jan 26, 2010 at 07:42, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> David W Noon wrote:
>
> Example where 'do_3 is part of the case statement:
>  case p of
>    '1': do_1;
>    '2' if (q > 0) then do_2;
>    else do_3;
>  end;
>
> Example where 'do_3' is part of the '2' if/else statement:
>  case p of
>    '1': do_1;
>    '2' if (q > 0) then do_2
>        else do_3;
>  end;
>
>
> Syntax and understanding is as clear as rain.

Not really, the difference is not so obvious. Maybe there should be
warning for situations like this in all Pascal modes? To get rid of
it, on would have to wrap if statement with begin/end or add another
case-branch before case-else which is not single if statement? Or just
ignore the warning...



More information about the fpc-devel mailing list