[Lazarus] JEDI code formatting

Bernd Kreuss prof7bit at googlemail.com
Sat Feb 13 14:48:24 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Ishenin wrote:

> If the bug is fixed in the JCF code repository then I will update 
> lazarus version. I do this from time to time.

I have found the bug and fixed it. Here is the fix:

C:\lazarus\components\jcf2\Process\Indent\Indenter.pas
starting in line 113:

> function InGlobalTypeOrVarSection(const pt: TSourceToken): Boolean;
> begin
>   // are we in a type or var section?
>   if not pt.HasParentNode([nTypeSection, nVarSection]) then
>   begin

change this to:

> function InGlobalTypeOrVarSection(const pt: TSourceToken): Boolean;
> begin
>   // are we in a type or var section?
>   // EXPERIMENTAL: added CONST section to this list,
>   // maybe rename the whole function now? It is used only once.
>   if not pt.HasParentNode([nTypeSection, nVarSection, nConstSection]) then
>   begin

This is only called once near the end of the file at line 638 and seems
to be part of another prior bugfix. The bug in the bugfix 1898723 and my
fix for the fix will only ever happen if the setting "indent for
procedures in library" is DISabled, else all this code won't be executed
at all.

I'll continue to test this a bit although I think it is safe and could
already be sent upstream.

Bernd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLdq2ixT6R4jlFoh0RArzKAJ96SN143sG8RpPTJzT4AS8mWKRFIwCffITQ
m5r/8Z7sz7uont0zX0oAWQA=
=E/5A
-----END PGP SIGNATURE-----




More information about the Lazarus mailing list