Recent

Author Topic: JEDI code format does not work with operators  (Read 1771 times)

RayoGlauco

  • Jr. Member
  • **
  • Posts: 93
  • Beers: 1567
JEDI code format does not work with operators
« on: June 26, 2018, 07:27:15 pm »
Hello,

I like to use JEDI code format in the Lazarus IDE, to get my code uniformly formatted. But recently I have declared several operators in a unit, and JEDI code format no longer works in that unit, even though the unit compiles ok.

Any idea or fix?
To err is human, but to really mess things up, you need a computer.

Thaddy

  • Hero Member
  • *****
  • Posts: 9285
Re: JEDI code format does not work with operators
« Reply #1 on: June 26, 2018, 07:38:11 pm »
Jedi Code Formatter is Delphi heritage. Delphi doesn't know about that syntax. Hence it will fail. Just fix it... I won't...
also related to equus asinus.

RayoGlauco

  • Jr. Member
  • **
  • Posts: 93
  • Beers: 1567
Re: JEDI code format does not work with operators
« Reply #2 on: June 26, 2018, 07:46:49 pm »
OK thanks, Thaddy. I just don't want to reinvent the wheel.  :)
To err is human, but to really mess things up, you need a computer.

bytebites

  • Full Member
  • ***
  • Posts: 220
Re: JEDI code format does not work with operators
« Reply #3 on: June 26, 2018, 09:22:09 pm »
Please show example code.

Thaddy

  • Hero Member
  • *****
  • Posts: 9285
Re: JEDI code format does not work with operators
« Reply #4 on: June 26, 2018, 09:30:06 pm »
Please show example code.
that's easy I don't even have to test that:
Code: [Select]
        operator + (const a,b:integer):c:integer;
begin
                                                 c:=a+b;
               end;
Silly formatting isn't even necessary..... JCF breaks....
« Last Edit: June 26, 2018, 09:37:24 pm by Thaddy »
also related to equus asinus.

bytebites

  • Full Member
  • ***
  • Posts: 220
Re: JEDI code format does not work with operators
« Reply #5 on: June 27, 2018, 04:57:02 am »
Silly :c: does not compile.

This compiles
Code: Pascal  [Select]
  1.         oPerator + (cOnst a,b:integer) c:integer;
  2. beGin
  3.                                                  c:=A+b;
  4.                enD;

RayoGlauco

  • Jr. Member
  • **
  • Posts: 93
  • Beers: 1567
Re: JEDI code format does not work with operators
« Reply #6 on: June 27, 2018, 08:59:39 am »
Actually, the problem is that the code containing operators, although it compiles, is not understood by JEDI code format.
To err is human, but to really mess things up, you need a computer.