JCF Change Log

JCF 2.43: changed since 2.42

More assorted changes for FreePascal supplied by Paul Ishenin.

Support for some FreePascal operator overloads.

Fixed issues in the handling of UTF-8 format files containing Unicode characters.

Fixed Sourceforge bug 2490118: Parser exception with empty var section in a class, reported by TridenT
Fixed Sourceforge bug 2130798: Indentation strange on procedure local type/var declarations, reported by Lawrence Johnstone.
Fixed Sourceforge bug 2443660: Line Breaking Uses Clause - Not working, reported by Donovan J. Edye.
Fixed Sourceforge bug 2120068: IndentProcedures setting has no effect, reported by Lawrence Johnstone. Added a new setting to indent procedure body one stop.

JCF 2.42: changed since 2.41

Using JcfStringUtils.pas for many string-handling routines to be licence-compatible with Free Pascal. File supplied by Paul Ishenin.
A lot of FPC/Lazarus compatibility work from Paul Ishenin.

Errors found and fixed by testing with Lazarus source:

Fixed Sourceforge Bug 2197489: Too many spaces if no new line before "begin"

Added the formatting option "Settings | Spaces | Move Spaces to before colon". This option is not standard and  is not checked by default. It produces a layout where the colon is at the end of the spacing, e.g.  var flag :boolean; instead of the usual var flag: boolean;. This fixes SourceForge bug 2173842, requested by Wolfe Cheng.

JCF 2.41: Changed since 2.40

Delphi 2009 is now the default environment for JCF.

Support for some more Delphi 2009 syntax: Result := inherited; and a first pass at support for anonymous functions. Added more test cases on generics.

This fixes Sourceforge bug 2207649 D2009 - result := inherited;
Fixed Sourceforge bug 2120068: "IndentProcedures setting has no effect", by removing the unused settings.

Some code changes were made for string handling in Delphi 2009. All test cases pass in Delphi 2009 and Delphi 2007. The latest (SVN head) version of JCL and JVCL was used, since there are bugs in the Delphi 2009 released version.

JCF 2.40: Changed since 2.39

Fixed Sourceforge bug 2091031 Unsaved setting: setting "return after uses" is not saved in configuration. Reported by Herman Rozendaal
Fixed Sourceforge bug 2000557 Obfuscation error (if ... else) has space removed.
Fixed Sourceforge bug 2117568 Parser error on record with some fields having visibility.
Fixed Sourceforge bug 2121476 Parser error: Parser Error: CLASS OF with qualified type name. Reported and fix by SleepyGuy.
Fixed Sourceforge bug 2159448 Parser error on ASM hex number with "h" suffix.
Fixed Sourceforge bug 2173846 Cannot specify spaces before colon in typed const. Reported by Wolfe Cheng

Jean-Fabien Connault added support for building in Delphi 2009.  Also added simultaneous support of Delphi 2007 and Delphi 2009 (D11 and D12 subfolders).

Some changes to make porting to FreePascal easier, requested by Paul Ishenin. More changes to come in future versions for this.

Improvements to reporting of messages on the command line, requested by Mageslayer.

JCF 2.39: Changed since 2.38

Fixed Sourceforge bug 2071265: setting "return after uses" is not saved in configuration. Reported by Reinier Sterkenburg.
Fixed Sourceforge bug 2044146: 'end' does not match alignment. Reported by Christian Budde.
Fixed Sourceforge bug 2075894 Gave more information on parse failure, reported by Christoph Roeper.
Suppress parse tree dialog on failure from the commandline program, requested by Mageslayer.
Added non-zero commandline return codes in case of error, requested by Mageslayer.
Various fixes to previous versions of the IDE plugin, from  Christian Budde.

JCF 2.38: Changed since 2.37

Fixed Sourceforge bug 2037076: Parser exception with 'out' keyword reported by TridenT
Fixed Sourceforge bug 2023621: Error when a class function is in a record.
Jean-Fabien Connault checked in a fix to the registry setting location, where Delphi 2007 for Win32 wasn't properly detected, and updated references to JclStrings to JclAnsiStrings.

JCF 2.37: Changed since 2.36

The JCF source code and executables are now available under a dual licence - MPL 1.1 or GPL 2.0 or greater. Formerly, it was just under the MPL. The GPL licence was added at the request of Paul Ishenin from the Lazarus project, so that they can integrate formatter code into their project. Have fun, guys!

Fixed Sourceforge bug 1933836: Parser exception with Offset keyword in ASM statement. Asm statements that referenced variables that had the same names as asm operators were failing.

Fixed Sourceforge bug1948057 : Parser exception with empty class var reported by Trident.

Added an option for Sourceforge bug 1910600 No return inserted in uses clause, from Reinier Sterkenburg. The new option is under "Clarify|Line Breaking|Returns|Line break after uses" and when checked, a return will be inserted after the uses keyword of a uses clause.

JCF 2.36: Changed since 2.35

The major work was on Sourceforge bug 1900955: Parser fails to read various Unicode files. All character handling is now Unicode, and the following file character formats are supported: 8 bit ASCII, Utf8, Utf16 (big and little-endian) and Utf32 (big and little-endian).

Fixed Sourceforge bug 1898723: Indentation of procedures in library. this is an option, engaged by deselecting the "Clarify|Indentation|Indent procedures in Library" option.

JCF 2.35: Changed since 2.34

Fixed Sourceforge bug 1860760: Added support for "packed class" and "packed object syntax. Bug reported by JernejL

Fix to a case where the commandline program fails when it has the -config switch to specify a valid config file, and registry does not contain the path to a valid config file. Bug reported by lextm

JCF 2.34: Changed since 2.33

Compiled in Delphi 2007 using the latest version of JCL and JVCL

Generics are now supported: imported and passed all of TridenT's test cases for new syntax for generics.

The settings tree is now built in code rather than in the .dfm. this was apparently causing problems building the programs in Delphi 6 and 7.

JCF 2.33: Changed since 2.32

Asm capitalisation: Florent Ouchet of Team JEDI has tried out the asm options, and came back to me pointing out that the capitalisation should be more selective about what it capitalises. I have put in test cases and a fix.

JCF 2.32: Changed since 2.31

Asm options: After input from Robert Marquardt and Florent Ouchet of Team JEDI on their requirements for inline assembler block formatting, we have new asm options, and a new options panel in the settings.
Capitalisation sets the capitalisation of the contents of asm blocks.
Breaks after label controls the new lines after a label. Set to 0 to keep the next statement on the same line, to 1 for the next statement on the following line, 2 for a blank line, etc.
Extra indents for asm statements and their following parameters. The default values of 7 and 15 combine with top-level asm blocks indented by 2 spaces to produce standard indentation of 9 and 17 respectively.

JCF 2.31: Changed since 2.30

Fix to Sourceforge bug 1760354: Parser exception with Exports keyword. Reported by giotto_g

Added options for spaces inside brackets - after the open brackets and before the close brackets. Requested and code sample from mould.

Added option for indenting the case statement's else block at the same level as the case. It may look a bit odd, but it's according to the spec. Under Indentation, uncheck "extra indent for case...else blocks"

JCF 2.30: Changed since 2.29

Updates from Jean-Fabien Connault:
Added Windows Vista support
Added support for Delphi 2007
Added support for 120 DPI fonts
Registry relocated under HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Jedi
Recompiled help file

Fix to Sourceforge bug 1750777: Parser exception with Automated keyword
Fix to Sourceforge bug 1749553: class properties not properly formatted

JCF 2.29: Changed since 2.28

Fixed Sourceforge bug 1703941: Fails on units with class var in records, reported by Caleb Hattingh

JCF 2.28: Changed since 2.27

Fixed Sourceforge bug 1586325: Register IDE Plugin fails when using a localized version of Delphi. Bug reported by Herve Robache, fix suggested by Guillaume Cornu
Fixed Sourceforge Bug 1696552: newline before procedure/function keyword inserted in procedure vars, reported by tyebald

Did Feature Requests item 1387221: Insert single space before open bracket ( '(' ), requested by Oliver Koenig. Also did the option to add a single space before an open square bracket ( '[' ) in expressions. e.g. to space out expressions like  a := b[3]; as a := b [3];

This results in new options on the settings under "Spaces": Insert space before bracket - in function declaration, in function call and before '[' in expression. These options are off by default since having them on changes existing formatter behaviour and is not as per the official layout guide. Though Borland standards do not have a space here, some people's standards insist on this.

JCF 2.27: Changed since 2.26

Rebuilt with latest JCL and JVCL, JCL 1.98 Build 2530 and JVCL version 3.30s.
Fixed Sourceforge bug 1657290 Parser Exception with Attributes in Assembly, reported by TridenT.
Fixed Sourceforge bug 1658384 Parser Exception with "strict" keyword in records, reported by TridenT.
Bug report and fix for Sourceforge bug 1660999 formatting files which are in UTF-8 format supplied by TridenT

JCF 2.26: Changed since 2.25

Fixed Sourceforge bug 1611786 reported by TridenT - Parser Exception with & before keyword.
Fixed a minor UI issue -a checkbox was misaligned on the "Blank Lines" settings, reported by Lynn Allan
Fixed Sourceforge bug 1649562 reported by Guillaume Cornu - Parser Exception withthe  "Final" keyword used a a procedure name. 
Fixed Sourceforge bug 1634146 reported by Massimo After formatting using the IDE pluggin, all text is marked as as changed. Now most of the unchanged text should not marked as changed.

JCF 2.25: Changed since 2.24

Fixed settings file name issues (also that a missing settings file is reported a read-only under WinXP, and is therefor not written) - reported by bobcousins.
Fixed Sourceforge bug 1583093 "Parse error with the deprecated directive on type" reported by TridenT.

JCF 2.24: Changed since 2.23

I appologise that it's been a while since I updated this program. Things have been happening in the real world that have been taking my attention - new PC, a new job and a new wife.  Meanwhile the issues have been piling up on the JCF. So here's what's fixed:

Fixed Sourceforge bug 1558885 Exception "Too many ChildNodes" reported by TridenT - very large const arrays (more than 32768 elements) should not cause the internal error detection.
Fixed Sourceforge bug 1567643 "parser does not recognize some asm opcodes", and Sourceforge bug1569963: "parser error with inline assembler", reported by aiforge.  Fixed so that ASM opcodes with no params will work.
Fixed Sourceforge bug 1572695 "use of Label keyword as type cause an exception" reported and patch by TridenT
Fixed Sourceforge bug 1572852 "Exception:Constant in a class before visibility ident" reported and patch by TridenT
Fixed Sourceforge bug 1572899 "UNSAFE keyword (in Delphi.Net) generates an exception" reported and patch by TridenT
Fixed Sourceforge bug 1572931 "VMTOFFSET and DMTOFFSET not recognize in ASM block" reported and patch by TridenT
Fixed Sourceforge bug 1528271 "Bug in begin/end removal" reported by wanxingye

JCF 2.23: changed since 2.22

Fixed Sourceforge bug 1484149 property ExplicitWidth does not exist when using Delphi 7. Reported by kirdape.
Fixed Sourceforge bug 1479592  varargs -- causes jcf parse tree error. Reported by Charles Doumar.
Fixed Sourceforge bug 1101742: Option to indent else blocks more. Option suggested by and code given by Carsten Schuette.
I've put all the flags and settings that control indentation for non-standard layout in a group box called "options".

Built with the latest libraries: JCL1.97 and  JVCL 3.2.

JCF 2.22: Changed since 2.21

Fixed Sourceforge bug 1454950:  .Net Attributes incomplete, reported by, test case and patch supplied by neongraal.
Fixed Sourceforge bug 1440877:  Remove blank lines after procedure header, reported by  Andrew Sheshko. I have introduced a new setting, Max consecutive blank lines in the "Remove blank lines" section of the blank lines tab. the default value is 1, which is the previous behaviour of leaving at most 1 blank line in var sections and the like.   Andrew Sheshko's bug is fixed if the value is set to 0.

JCF 2.21: Changed since 2.20

I am getting this release out rapidly after the last one, since I will be away from the computer for the next three weeks. The next release will probably be some time towards the end of March.

Fixed Sourceforge bug 1423817 reported by havni - uses clause sorting put in one comma too many in a particular case.
Fixed Sourceforge bug 1422003 reported by havni - properties on records in Delphi.net were not supported. Also supported private and public sections in records.

JCF 2.20: Changed since 2.19

Fixed Sourceforge bug 1413849: Line and column of an error was reversed in the commandline formatter. Reported by Havni.
Fixed Sourceforge bug 1413818: Two errors with Delphi.net - the uses clause sorting did not handle dotted unit names, and methods on records were  not supported. Also added support for constructors and operator overloads on records.
Fixed Sourceforge bug 1413213: Exception type with a dotted name was not handled. Reportted by TridenT.

JCF 2.19: Changed since 2.18

Fixed Sourceforge bug 1400365: Parse error in ASM block. ASM labels and hexadecimal number suffixes are now recognised.
Fixed Sourceforge bug 1407559: Spaces around operators option "never" is too aggressive, reported by CDoumar. When the "space around operators" option was enabled, a := b + c; was converted to a := b+c; which is correct. But a := b mod c; was converted to a := bmodc; which is wrong.
 Fixed Sourceforge bug 1398940: Several Delphi.NET 2005Parse errors reported by TridenT, and fix to the dynamic arrays part supplied by TridenT. This was actually a list of several bugs, comprising:

JCF 2.18: Changed since 2.17

Fixed Sourceforge bug 1390572: Failed to parse asm statement with '&' before the parameter, reported by TridenT
Fixed Sourceforge bug 1384547 Parser Exception with Delphi.NET "Final" keyword, reported by TridenT.
Fixed Sourceforge bug 1384537 Parser Exception with Delphi.NET "Sealed" or "abstract" keyword, reported by TridenT.

Delphi 2006 update

I have built all code, except for version-specific IDE pluggins, in Borland Development Studio/Delphi 2006. Also used latest JCL and JVCL (JVCL 3.10). Delphi 2006 is now the primary development environment for this project. Thanks to Lextm for the Delphi 2006 IDE Plugin project.

I have made a more sensible directory structure for IDE Plug-ins - all are under the "IdePluggin" directory, in a directory named for the version of Delphi that the IDE plug in project is for (e.g. "\Jcf\IdePluggin\Delphi7" and "\Jcf\IdePluggin\Delphi2006". Projects are given for Delphi 5 through to 2006, but unfortunately I can only ensure the buildablity of the IDE pluggins for Delphi 7 and Delphi 2006, since those are the only versions of Delphi  that I have installed and working at present.

JCF 2.17: Changed since 2.16

Fixed Sourceforge bug #1380299 reported by an anonymous hero. This was a serious bug that resulted in files being deleted. This bug first occurred in version 2.16. Fixing this bug and replacing version 2.16 as soon as possible is the reason for this release.

JCF 2.16: Changed since 2.15

Fixed Sourceforge bug # 1355237 reported by  Adem Baba - at as a variable name fails.

Done Sourceforge request 1285981 from Leo van Elburg - Alignment now has a second Max Variance option, for the Interface section to have a different max variance to the Implementation section.
Done Sourceforge request 1355939 from  Darius Blaszijk - when a file is formatted, and the formatted file is identical to the input file, the file is now not written to. Output identical to the input can easily happen if the formatter has been run on that file before. The formatter was always writing results back to files even when no content changes were made, This was updating file timestamps needlessly, and this was apparently causing source control systems like CVS and SVN to think that there had been a change.
Done Sourceforge request 1333099 from Tommi Prami - a configurable number of lines before procedures. This applies to all freestanding procedures and functions, those attached to classes, also class methods, constructors, destructor and operator overloads. The option is found on the Clarify | Blank lines settings page. 

JCF 2.15: Changed since 2.14

Fixed Sourceforge bug #1333885 reported by  Roman Polunin - .dpr file without begin was not parsed.
Fixed Sourceforge bug #1329704 Option 'Leave as is' on "between end and else" not working.
Fixed Sourceforge bug #1343997 reported by TridenT - External function with a numeric index was not parsed.
Added a possible fix to a problem that lextms brought to my attention by email - the commandline formatter should work with nothing in the registry so long as a format config file is specified on the command line.

JCF 2.14: Changed since 2.13

Fixed Sourceforge bug # 1314607 reported by  Roman Polunin - case where try...except was not parsed.
Fixed Sourceforge bug #1311753 reported by  Roman Polunin - parameter list that ends in a comma was not  parsed.

By request, I have added an option for "Spacing around operators", for those who prefer a:= b+c; over the standard a := b + c; . The options are:

JCF 2.13: Changed since 2.12

Fixed Sourceforge bug #1281770 reported by TridenT - new Delphi.Net syntax for class vars was not supported.

JCF 2.12: Changed since 2.11

Darius Blaszijk requested that FreePascal files with .pp extension be recognised when formatting all files in a directory. Up to now, only files with .pas and .dpr extensions would be formatted. I made a user-definiable list of file extensions that will be picked up when formatting directories. This is in the settings, on the clarify page. The default is pas, dpr and pp.


Fixed Sourceforge bug #1262542 reported by Carsten Schuette - If statement conrtol flow changed  by removing a begin ... end in a case where it was not valid to do so.  This also fixes bug Sourceforge bug #1266141, essentially the same problem, reported by Olivier Pons.
Fixed Sourceforge bug #1258335 - reported by Roman. Multi-dimensional array constant with only one value in first subscript did not parse.
Fixed some cases where  the formatter did not realise that procedure/funcion/method names are identifiers for purposes of capitalisating identifiers (new in previous version).

Worked on categorisation of identifiers into three different levels of name strictness -  fixing bugs Sourceforge bug #1258340Sourceforge bug #1258333 and Sourceforge bug #1145219.

JCF 2.11: Changed since 2.10


Fixed Sourceforge bug #1212723 reported by Juergen Kehrel. Added new options to control the warnings for unused procedure parameters introduced in 2.10.  This is on a  new Format Settings page for Warnings. You can now turn off just this warning, or specify some parameter names to not warn upon, the best e.g. that many  event handler procedures have unused parameters called "Sender" which should not give a warning if they are unused.
Fixed Sourceforge bug #1213462 Case on write and read property reported by kb (at) prosafe.as. 

New features:

Turned the settings file from pseudo-XML into actual XML by including at the top the magic words "<?xml version="1.0" ?>" This will happen when you next alter or write any JCF settings file. The upshot to the JCF is minimal, but you can now use other XML tools to work with this file.

Added a new capitalisation options, Capitalise Identifier and Capitalise not identifier with associated settings pages. The first works just as the existing Any Word Caps (i.e. gives that word the specifier capitalsiation wherever it is found), but only affects cases where that textual token is used as an identifier - i.e. as the name of a variable, parameter, type, procedure, method, unit, etc. It is a list of words in their preferred capitalisation. Any identifier found in the source that matches an item in the list will be given this capitalisation. The second covers the other cases, where the words is used but not as an identifier. Using these lists is recommended over Any Word caps in the majority of cases.

Example: Using these options, and specifying the capitalisation "Read" for indentifiers  and "READ"  for not identitiers, the input code fragment property read: boolean read fbRead write SetRead; will be changed to property Read: boolean READ fbRead write SetRead;

Delphi.NET support:

Added support for Delphi.net attributes on classes vars and procedures. The sample code comes again from lextms.

JCF 2.10: Changed since 2.09

Due to the confusion as to whether the last release was 2.08 or 2.09, this one is numbered 2.10, read as "two point ten", not as "two point one zero".

Incorporated lextms's patch to the JcfIdeMain.pas unit, to allow it to work in Delphi 2005.

New features:

Added a new warning for procedure/function/method parameters that do not appear to be used in the function body

procedure Foo(i: integer);
  ShowMessage('I do not use i');

output is

Parameter i is not used near PROCEDURE in procedure Foo at line 20 col 1

To address various queries and bug reports, I have added options for line breaking conditional compilation directives. You can now specify to add, remove or leave returns before or after compiler directives. This can be set for each of three code places: in uses clauses, in code and elsewhere. Feedback received will determine if these setting will be further broken down - e.g. different line breaking options for {$ENDIF} might be useful.

Delphi.NET support:

The assimilation of Delphi.Net syntax proved to be a lot less troublesome than I had thought. It is mostly complete, with only attributes (i.e. the .Net metadata in square brackets) largely outstanding. Thanks to Lextms for providing the code samples, and code to get the IDE plug-in working in Delphi 2005. Source for this is included, as is the executable, "JcfIde9.bpl"

If you have any short code examples that compile in Delphi.Net, but which the code formatter 2.10 cannot parse, please send them in and I will try to fix them.

The following syntax is now supported:
Class operators, i.e. the following code will parse:

  TMyClass = class
    FData: Integer;
    class operator Add(A,B: TMyClass): TMyClass;
    class operator Implicit(A: Integer): TMyClass;
    class operator Implicit(A: TMyClass): Integer;

    property Data: Integer read FData write FData;

Support for class helpers, i.e. the following code will parse:

TMyClass = class
    procedure HelloMyClass;

  TMyClassHelper = class helper for TMyClass
    procedure HelloMyClassHelper;virtual;
  TMyClassHelper2 = class helper(TMyClassHelper) for TMyClass
    procedure HelloMyClassHelper;override;

Support for nested types, i.e. the following code will parse:

  TOuterClass = class
    myField: Integer;
      TInnerClass = class
        myInnerField: Integer;
        procedure innerProc;

    procedure outerProc;

JCF 2.09: Changed since 2.08


Sourceforge bug 1166818  Unit names not parsed correctly
fixed three related issues to do with the (relatively new) remove unnecessary begin..end transformation:
Sourceforge bug 1174572  bug in Remove begin and end from around single statement reported by Tat Ming
Sourceforge bug 1168928 2.08 corrupts "if then else" statements reported by Carsten Schuette
Sourceforge bug 1170450 Setting "remove begin end around" also removes //comment reported by Henk Fikkert

Delphi.NET support:

A few of the common bits of Delphi.net syntax are now supported in the parser, though there is not much special formatting for them. With thanks to Lextms, for providing the code samples used for testing these features.

Dotted names are supported in a few places where they weren't before: unit name as above, in class heritage and in object variable types, so the following code should parse:

  TMyForm = class(System.Windows.Forms.Form)
    TextBox: System.Windows.Forms.TextBox;

Supported "strict private" and "strict protected" visibility, e.g.

  TTest = class(TObject)
  strict private
    foo: integer;
  strict protected
    bar: integer;

Supported class constants, e.g.

  TMyClass = class
      x = 12;
      y = TMyClass.x + 23;
    procedure Hello;

Supported the static directive on procedures and sealed on classes. Supports class constructors, class vars and class properties, e.g.

  TMyClass3 = class(TObject)
    class procedure SetData(AData: Integer); static;
    class function GetData: Integer; static;
    class var FData: Integer;
    class constructor Create;

    class property Data: Integer read GetData write SetData;

Supported attributes in the body of the interface section, as happens in the default new form.

JCF 2.08: Changed since 2.07


Fixed Sourceforge bug #1098545 "Error in Chinese comment" - two-byte characters in comments caused problems when the second char was read as '}', reported by, and fix using IsDBCSLeadByte suggested by Alfred Yang. Turn on the setting "Registry Settings|General|Check for Multibyte chars" if this is an issue for you.
Fixed Sourceforge bug #1143581 "Uses clause problem in console app" submitted by Tat Ming, by adding an option to alphabetise program uses clauses. This is disabled by default for compatibility and because I expect it to be the usual desired behaviour.
Fixed some more on Sourceforge bug #1079842 space to tab does not work correctly, reported by Carsten Schuette
Fixed Sourcefore bug #1152816 Exception TEParseError in const section reported by Stefan Landauer
Fixed Sourcefore bug #1158125 - Alignment of variables in implicit published section, i.e. if you are aligning variable declarations in classes, this will also apply to the inital section with no visiblity specifed, e.g.
 TForm2 = class(TForm)
Label1: TLabel;
CheckBox1: TCheckBox;

Other changes:

Added suppot for DotNet Style uses clause, e.g. uses System.Text; and for Delphi 2005 style for ... in statements.
Built with the latest JCL (Version 1.94) and JCVL (Version 3.0 RC1)

JCF 2.07: Changed since 2.06

Fixed Sourceforge bug 1084582 "Inconsistent spacing after parenthesis", reported by bsorensen
Fixed Sourceforge bug1079842 space to tab does not work correctly, reported by Carsten Schuette
Fixed Sourceforge bugs 1079843 and 1071047,saving settings issues raised by Carsten Schuette and roaster respectively.
Fixed Sourceforge bug 1038136, "No warning on failure to write to read-only .cfg file", raised by richardlang. I have made a registry option called "Write settings file", with options "always", "never" and "fail quitely". It is "always" by default, and is shown on the registry options dialogue.Users with a read-only format options file on a server will have to set it to fail quietly or not try to write.

JCF 2.06: Changed since 2.05

Fixed Sourceforge bug 1036361 - The default directory for the settings file is now the application directory.
Fixed Sourceforge bug 1041629 - On error, emit the input code rather than blank.
Fixed Sourceforge bug 1060112 - the process to put begin..end around single statements should not insert a begin between "else" and "if".

JCF 2.05: Changed since 2.04

Fixed Sourceforge bug 1017930 and 1005978, both to do with uses clause sorting. the uses clause sorting has been rewritten, and also now has test cases.

JCF 2.04: Changed since 2.03

Minor bug fixes to new and newish fetaures:
Fixed Sourceforge bug 1001931 Extra blank line with Preprocessor parsing
Fixed Sourceforge bug 1008594 Error with "add begin and end to single statement"
Fixed Sourceforge bug 1014281 Problems with adding begin and end

JCF 2.03: Changed since 2.02

Fixed Sourceforge bug 1002701-  JcfGui losing files when backup option is "No backup" or "Backup to seperate file".  This is a serious bug, hence the speed of this release. Do not use JCfGui version 2.0.2.

JCF 2.02: Changed since 2.01

This version of the JCF is built with JCL1.91-Build1558 and JVCL300 BETA1. In order to get this to work, you will need to install the JvCustom package of Jvcl. (if it fails to compile, change CharIsNumber to CharIsNumberChar, particularly in JvJCLUtils.pas. JCL is getting a bit ahead of JVCL.)

Fixed Sourceforge bug 982267 -  misaligned comments reported by Juergen Kehrel
Fixed Sourceforge bug 991099 - Label before Until Statement Error reported by Charles Doumar
Fixed Sourceforge bug 991785 - two if's with one else

Added an option to sort the uses clauses (feature request 969114). This  can be found in the "transform" settings.
Added additonal options for block line breaking in case statements (feature request 853903) from Marcus Fuchs

JCF 2.01: Changed since 2.0

There are no bug fixes in version 2.01, because there are no reported bugs. I hope this is a good sign. If you have a bug, please log it. Likewise feature requests.

This release is the first step out of the feature freeze that lead up to 2.0. It contains several small features, and begins to look at the backlog of feature requests. While it is possilbe that these new features can introduce bugs, all have been tested and all can be turned off.

Added the "transform" options tab for processes that alter the code. On it are the option to add or remove begin and end blocks around single statements.
Adding will turn statements such as

if Somecond then
  b := SomeFunc;

... into ...

if Somecond then
  b := SomeFunc;

Removing begin end does the inverse to any single statement in a begin-end block. This will work on single statements underneath an if, else, case label, else case, while, for or with statement. The default option is to leave statements as-is, ie to neither add nor remove begin-end blocks

Added an option to always put a semicolon after the last statement in a block, where it is optional. This will turn code like

... into ...


Note the extra pendantic semicolon.

Feature request  #929710 part 2 - alignment of class and record fields has been done - the option to do this is on the Align tab. Enabling this will turn code such as
 TSomeClass = class(TPersistent)
FINIFile: string;
FMachineID: TMachineID;
FRootLoc: string;
FSystemID: TSystemID;
FSystemType: TSystemType;

... into ...

TSomeClass = class(TPersistent)
FINIFile: string;
FMachineID: TMachineID;
FRootLoc: string;
FSystemID: TSystemID;
FSystemType: TSystemType;

Feature Request #895713 - control over the line breaking between else and begin. This is found on the blocks options page. Enabling this will allow you to regularise code so that you always see

if somecond then
else begin


if somecond then

JCF 2.0: Changed Since Release Candidate 3

Changed the version number to 2.0. There are no functional changes from RC3, as no bugs have been reported.

JCF 2.0 RC3: Changed Since Release Candidate 2

Fixed Sourceforge bug 951977 - additional linebreak introduced on indented {IFDEF} {ENDIF}
Fixed Sourceforge bug 948944 - Block setting "between end and else" not working corrently
Fixed Sourceforge bug 946918 - Bracketed property asignments not parsed.
Fixed Sourceforge bug 946912 - Missing parameters in OLE obejct calls not parsed.

JCF 2.0 RC2: Changed Since Release Candidate 1

Calling it a release candidate seems to have brought out a raft of new issues.  All have been addressed:
Fixed Sourceforge bug 926926 - Parse error on complex ASM instruction, reported by TridenT
Fixed Sourceforge bug 927029 - Menu entry vanishes reported and code submitted by Juergen Kehrel - the JCF IDE menu entry is  now higher up on the tools menu as this causes less problems. Also added a Shortcut Key CTRL-ALT-F to format the current unit.
Fixed Sourceforge bug 928460 - Special EndOfLine character generates an exception, reported by TridenT. Now all chars 1-32 are read as white space.
Fixed Sourceforge bug 931526 - Single line comments are not indented.
Fixed Sourceforge bug 931529 - Bad tab order in Format Settings and remove empty comments. Many of the GUI tab orders were bad.
Fixed Sourceforge bug 939809 - Wrong formating in assembler statement.

Did rework to avoid ambiguity between char constants introduced with a "^" char and pointer dereference. e.g. if mypchar^ = ^= then... is not ambigious but the spaces are optional here - it can be written as if mypchar^= ^= then... or even as if mypchar^=^= then... these differences need to be distinguished by the parser not the lexer.

JCF 2.0 RC1: Changed since Beta 15

Fixed a minor memory leak

JCF 2.0 B15: Changed since Beta 14

Fixed old-style char escape sequences, Sourceforge bug #913439

JCF 2.0 B14: Changed since Beta 13

Somewhat faster (10-20%) due to further optimisations.
Now using JCL  1.9 and JVCL 1.9.

JCF 2.0 B13: Changed since Beta 12

Added a consistency check when editing format settings: When linebreaking is turned off, "remove returns in expressions" will also be turned off. This prevents long expressions being put onto one very long line, and subsequent bug reports and queries. This helps with Sourceforge bug # 887727

Made some max lengths on the integer edits on settings frames - mostly 2 or 3 digits. You won't need to enter numbers longer than that.

Supported obsolete Turbo-Pascal syntax for inline. This should fix Sourceforge bug #888862.
Supported old-tyle char escape sequences. This fixes Sourceforge bug #901126.

Adem Baba has contributed code revisions to eliminate performance bottlenecks. In some cases, particularly with very large files, beta 13 will run ten times faster than Beta 12.

JCF 2.0 B12: Changed since Beta 11

Following a suggestion from Marcus Fuchs in Sourceforge bug #853898, added an option to remove consecutive spaces in code. There are more details in the help file.
Fixed Sourceforge bug #870495 - added tabs to spaces and spaces to tabs to main processing.
Fixed Sourceforge bug #878836 "extra indent option not working".
Did a try..except around settings saving to try to mitigate Sourceforge bug #879713. Also related to this:
- Added a rudimentary dirty state flag to settings. Only if the settings are dirty they will be written on exit. Opening the settings dialog and clicking OK will set the settings to be dirty.
- Added a registry setting to manually turn off settings file writing on exit entirely if need be. You can find this under Settings | Registry | General
Implemented the suggestion from Dan Miser in Sourceforge bug #883114 - Tab to Spaces and Spaces To Tabs now also convertes tabs to spaces and vice versa in comments.
Fixed Sourceforge bug #883144 Parser error on set declaration reported by Dan Miser.
Fixed Sourceforge bug #883182 DLL exports clause doesn't handle qualifed references reported by Dan Miser.

JCF 2.0 B11: Changed since Beta 10

Tweaked the linebreaker a bit.
Found a place or two where the obfucator could remove even more white space.
Added Harley Pebley's fix to do IDE plugin registration with actions, which apparently plays better with GExperts. Also added Harley's Delphi 6 project build file.
Added a block style for case statement else cases, and made test cases for this. This adresses some aspects of Sourceforge bug #853898, reported by Marcus F. Hopefully this sorts out case statement else cases, and the rest can be treated as a feature request.

JCF 2.0 B10: Changed since Beta 9

New features:

Implemented two items from sourceforge feature request 528556:
Implemented the feature request to remove empty comments. Did this for both // comments and { } comments. there was no settings category or settings dialog page that seemed appropriate for these, so I made a new one called "comments".
Implemented the feature request to remove blank lines when there's lots of them in a row. This made the "returns" configuration page too big, so I split it into "Returns" and "Blank lines". both of these frames talk to the same existing class and thereby the same section of the settings file. this may change later.

Fixed Bugs:

Fixed a parse bug reported by Adem Baba where complex property access (e.g. Property Erx: LongWord Read FDummy[0].ERX Write FDummy[0].ERX;) was not working.
Sourceforge bug #843993 and #844624 problem with a newline being removed by block styles after a // comment, which is a very bad idea as working code is then commented out.
Sourceforge bug #844563 - arbitrary text after the unit's final end not processed.

JCF 2.0 B9: Changed since Beta 8

New Features:

Added the uses clause add, remove and replace processes

Fixed bugs:

Sourceforge bug #813966 Spurious warning on calling "inherited destroy" in a destructor.
Sourceforge bug #820437 Keith Jürgens reported that the Str function with two colon specifiers (e.g. Str(number:20:1,tmp)) failed to parse. Fixed.
Sourceforge bug #823470 Jacco Kulman reported a parse failure in a comple expression, e.g. (FieldByName('P_GESLACHT').AsString + #32)[1]. Fixed.
Sourceforge bug #831381 Wrong enclosing procedure name being shown when reporting calls to destroy.

Fixed Adem Baba's latest round of parse failures.
Fixed some shortcomings in preprocessor parsing. 

JCF 2.0 B8: Changed since Beta 7

New Features:

Revamped the JcfGui interface a bit. No more obfuscate setting on the main form. You can still get it in the format settings if you want it. The messages are accumulated in a memo not shown in a status bar.

Added a line Y,X position indicator to the status bar of the JCF notepad. It works a lot like the one in the Delphi editor, showing current caret postion with the line number first.
Sourceforge feature request 667811: Added option to add returns after each item in the uses clause.
Added FindReplace process, as was in 0.x series and on the settings dialogs and help.
Made some engine code to use the setting "number of returns after the end. of the unit".

Fixed bugs:

Sourceforge bug #802532 Fixed - was using DecimalSeperator when it should have been  '.' in BuildTokenList.pas. Should not localise this.
Sourceforge bug #802994 Fixed - couldn't parse numeric labels or two labels in sucession.
Sourceforge bug #809110 Fixed - couldn't parse pointer to file types.

Fixed around 4 parse failures in esoteric code as reported by Adem Baba in the Sourceforge Forums in the message entitled "b7, Few more left".

JCF 2.0 B7: Changed since Beta 6

Did some of  Ralf Steinhaeusser's suggestions to make F1 help work on the registry settings form. Also used his Str2Float and Float2Str function so that the settings file is read and written in a locale-independant way - the decimal seprator char is apparently a ',' in germany, so he couldn't read a settings file there that was written here, and vice versa.

Sourceforeg bug #793411 Did Walter Prins' suggestions on relative paths and warning supression to help the JCF projects compile out of the box with no warnings.

Asm parameter parsing is much improved.
Took a first stab at conditional compilation parsing, can now handle some simple {$IFDEF} and {$IFOPT} stuff, and a bit of the more complex newer {$IF} syntax.

The result of this is that the state of play with parsing Delphi source is as follows:
Files sucessfully parsed: 33.0Mb in 1188 files
Files over 1Mb in size. These files are too large to parse in reasonable time, and are not interesting as they are all generated from MS office type libraries and are fairly repetitive, containing mostly interface definitions and proxy classes: 22.6 Mb in 14 files
Files that could not be parsed: 0 files

Sourceforge bug #793443 Walter Prins found and fixed a  serious error in the IDE pluggin, where due to an overshoot in reading in the IDE source, junk could be appended to the formatted source, or in Beta 5, an assertion falure would result.

JCF 2.0 B6: Changed since Beta 5

Fixed bugs:

Many more parser fixes gleaned from parsing Delphi source, in fact I didn't keep track of them all. The state of play with the test parse of files that ship with Delphi is that the files can be divided into three categories:

Files sucessfully parsed: 26.2Mb in 1074 files
Files not parsed due to {$IFDEF ...} conditional compilation used therein: 6.83 Mb in 114 Files.
Files over 1Mb in size. These files are too large to parse in reasonable time, and are not interesting as they are all generated from MS office type libraries and are fairly repetitive, containing mostly interface definitions and proxy classes: 22.6 Mb in 14 files
So this activity is basically finished, until the conditional compilation can be tackled.
I don't epect that all parse errors are fixed. The error rate had dropped off a lot by the end, but was not yet zero. There will still be a few obscure and little-used Delphi constructs that the formatter cannot parse.

Also fixed a couple of minor memory leaks that Memcheck spotted.

The help file is back in action thanks to Ralf Steinhaeusser.

JCF 2.0 B5: Changed since Beta 4

Fixed bugs:

George Tasker pointed out that the log file path was hardcoded to c:\temp, which is not a good idea on machines that do not possess this directory. There is actually a registry setting for this, and a default of the system temp folder, which may or may not be c:\temp.

Default settings file name is now JCF2Settings.cfg to avoid a name clash with the (slightly incompatible) settings file for the 0.x series.

A couple of issues that arose during a test run on Mike Lischke's VirtualTrees.pas.
Following Adem Baba's lead, found and fixed the following parser deficiencies while test parsing some of the source files that are installed with Delphi. I haven't done them all, but I suspect that more than half the bugs that will be found have been found, since the majority occurred near the start of the process.
Sourceforge bug #762354 reported by Adem Baba, deficiency in parsing the syntax to raise property visibility.
Sourceforge bug #766677 reported by Marcus Fuchs, enabled/disabled settings for capitalisation (and others) not being used.
Sourceforge bug #775653 reported by Tom Hansen, is affected and maybe even fixed inamongst the above items.
Sourceforge bug #770948 reported by Walter Prins (bytejuggler) parser failed on a class function after var declaration.

JCF 2.0 B4: Changed since Beta 3

Fixed bugs:

Sourceforge's bug tracker is really useful.

Sourceforge bug #526184 reported by anon. ">-" being parsed as one token e.g. in "if b>-1" .
Sourceforge bug #748436 reported by anon. Inability to parse simple clases with fields called "name".
Sourceforge bug #753897 reported by Daniel Gerhard. Bug with parsing of de-reference of function call return value, e.g. qry.fieldbyname('line').AsInteger := 1; .
Sourceforge bug #674738 reported by Marcus F. Wanted a linebreak between else and if. This was actually a feature request but it's done. See below.

New features:

Test harness relative paths
the DUnit Test harness now calculates path to the test files relative to exe dir, these used to be constants, which will save you a fix and compile if you are running the test harness. This is at request of George Tasker.

Merging internal enumerations
The enumerations TWordType and TTokenType have been merged into a new enumeration TTokenType in Tokens.pas. This is a fairly major internal reorganisation, but was overdue and results in simpler code in many places. There are now about 160 items in this enumeration. There must be <256 otherwise we lose the ability to make sets over it, which is much used. This means that the enumeration has room to grow to a few dozen new keywords if need be, but that will not be merged with the types or parse tree interior nodes as enumerated in ParseTreeNodeType.pas

Capitalisation for unit names
Caps for unit names is a new process, to try to subdivide the any-word capitalisation. This process capitalises unit names where they appear in uses clause and in expressions. Like the any-word caps, capitalisation of unit names is as per a list of supplied correctly-capitalised names.

Able to break between else and if
Bug #674738 counts as a feature: setting and code to specify line-breaking in else if this can now  have line breaks between the else and the if never, always or as is.