[Lazarus] JEDI Code Format

Juha Manninen juha.manninen62 at gmail.com
Sat Oct 23 12:18:55 CEST 2010


On Saturday 23 October 2010 02:10:15 Bernd Kreuss wrote:
> It has its own parser (separate sourceforge project) and sometimes
> cannot parse new or seldom used language features or dialect variations
> that it does not (yet) know or that trigger a bug in its parser. I have
> seen this happen already. Try to identify the offending language
> construct that it cannot parse and file a bug report.

Did you implement the integration with Lazarus? Nice.

I happened to always test it with "too difficult" code. The small example I 
tried contained generics tests. So, it seems to fail with generics.

Then one code has this odd use of IFNDEF and ELSE:

procedure TForm1.PrintPreview1Click(Sender: TObject);
{$IFNDEF LCL}
var
  pf: TPreviewForm;
  Viewer: ThtmlViewer;
  Abort: boolean;
begin
  Viewer := FrameViewer.ActiveViewer;
  if Assigned(Viewer) then
  begin
    pf := TPreviewForm.CreateIt(Self, Viewer, Abort);
    try
      if not Abort then
        pf.ShowModal;
    finally
      pf.Free;
    end;
  end;
{$ELSE}
begin
{$ENDIF}
end;

I removed ELSE and the extra "begin", and used 2 IFNDEF blocks and then Jedi 
formatter accepted it.

There is no proper error message to locate the problem. I had to guess it from 
the parse tree. The error should mention the line number at least, and 
preferably jump to it when clicked.

I must figure out myself for Delphi converter how to jump to the error location 
by clicking. It is on a ToDo list.

Juha




More information about the Lazarus mailing list