[fpc-pascal] deprecated syntax is inconsistent.

Aleksa Todorovic alexione at gmail.com
Thu Apr 29 15:09:41 CEST 2010


During my experiments with FPC, I had to to exactly that - support two
lookahead symbols - to implement (in)famous semicolon before 'else'.
One of problems I had was combination of macros and include files with
two lookahead symbols - I "fixed" it in a dirty way, but I'm not
completely sure that solution covered all possible situations.

Just think of include directive which includes file in which there is
macro which expands to 'deprecated'. That wouldn't be that easy with
two lookahead symbols, because you would have to keep lots of data
about both symbols (they could be in two different files, for
example). Now, just think of refactoring in FPC on such low level -
doesn't smell good at all :-)

I would rather stick to on lookahead symbol even if that means
"inconsistent" (subject to this discussion) syntax.


On Thu, Apr 29, 2010 at 14:55, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> On 29 April 2010 14:51, Florian Klaempfl <florian at freepascal.org> wrote:
>>
>> Having a bigger lookahead makes a lot more things far more complex
>> epecially in combination with include files, macros, generics.
>
> Why?  You only apply the extra lookaheads where needed (code that
> could be ambiguous). All other parts of the code will be parsed as
> normal - as it is done now.
>
> So far I know of only two examples where extra lookaheads need to be used.
>  * wiki example where 'default' is used
>  * my example to fix the inconsistent syntax for hint directives (deprecated).
>
> --
> Regards,
>  - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



-- 
Aleksa Todorovic - Lead Programmer
Eipix Entertainment
www eipix com



More information about the fpc-pascal mailing list