On Fri, Jan 29, 2010 at 12:11, Marc Weustink <marc.weust...@cuperus.nl> wrote: > Aleksa Todorovic wrote: >> >> On Fri, Jan 29, 2010 at 11:42, Michael Van Canneyt >> <mich...@freepascal.org> wrote: >>> >>> It breaks the behavious of case: >>> >>> case b of >>> 1 : something; >>> 2 : If a then >>> DoSomethingElse; >>> else >>> DoElse >>> end; >>> >>> As it is now, b=2 and a=False will result in no code executed. >>> >>> After the patch, B=2 and a=False will result in DoElse. >>> >> >> Have you actually tried it? I've tested those cases and they should work. > > > Then in your patch, how do you distinguish between the else belonging to the > case statement and the else belonging to the if ?
When compiler hits 'end' inside 'case', it analyzes syntax tree created for the last branch, and checks if there was semicolon before last else or not (which is clear sign if that else is part of if statement or case). _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel