Recent

Author Topic: JEDI Code Formatting on .inc files (Exception TEParseError)  (Read 3029 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
JEDI Code Formatting on .inc files (Exception TEParseError)
« on: August 04, 2017, 04:33:59 pm »
hi All,
please advise if JEDI code formatting would work on .inc files. please advise what i am missing.
as per attached code i am getting error: 'unit2.inc(1,1) Error: Exception TEParseError  Expected program, package, library, unit, got "ttConst"
Near CONST'
when trying to format it with Ctrl+D.

thank you
Lazarus 2.0.2 64b on Debian LXDE 10

nooitgedacht

  • Newbie
  • Posts: 4
Re: JEDI Code Formatting on .inc files (Exception TEParseError)
« Reply #1 on: September 22, 2017, 08:11:19 pm »
Sorry for a late replay.

No, Jedi Code Formatter (JCF) can't handle .inc(lude) file's, as you can see the error.

JCF expect at first a program, package, library or unit statement.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: JEDI Code Formatting on .inc files (Exception TEParseError)
« Reply #2 on: September 22, 2017, 08:53:54 pm »
The JCF parser is not actively maintained by Lazarus developers. That's why I created this issue a long time ago:
 https://bugs.freepascal.org/view.php?id=19754
However we have got many patches to improve it. As you see most related issues are already fixed.
More patches are welcome.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

timppl

  • Jr. Member
  • **
  • Posts: 80
Re: JEDI Code Formatting on .inc files (Exception TEParseError)
« Reply #3 on: September 28, 2017, 01:29:04 pm »
It is possible, it just needs a little manual intervention.

At the beginning of the .inc file add
Code: Pascal  [Select][+][-]
  1. (** Uncomment for formatting
  2. unit XXX;
  3.  
  4. interface
  5.  
  6. implementation
  7.  
  8. begin
  9. **)

and at the end add

Code: Pascal  [Select][+][-]
  1. // end.
  2.  

This will enable fpc to compile your code; before you run jcf on the file uncomment the stuff shown above. This will make the file look like a pascal unit, which is what JCF expects.

HTH

Tim
Mageia 8 Linux on x86

julkas

  • Guest
Re: JEDI Code Formatting on .inc files (Exception TEParseError)
« Reply #4 on: October 06, 2019, 10:48:09 am »
Any update(s)?
I got
Code: Text  [Select][+][-]
  1. JCF, Errors: 1
  2. UG_CLR.INC(7,3) Error: Exception TEParseError  Expected program, package, library, unit, got "ttIdentifier"
  3. Near C_MAROON
  4. IDE Aborted due to error
  5.  
formatting INC file with JEDI code format.

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: JEDI Code Formatting on .inc files (Exception TEParseError)
« Reply #5 on: October 06, 2019, 01:32:32 pm »
Any update(s)?
No. Ask the Jedi developers.
Specialize a type, not a var.

 

TinyPortal © 2005-2018