[fpc-pascal] FPC coding standards

Dwight Schauer das at teegra.net
Wed Aug 19 02:12:09 CEST 2020


On Wed, 2020-08-19 at 02:03 +0200, Michael Van Canneyt wrote:
> 
> On Tue, 18 Aug 2020, Dwight Schauer via fpc-pascal wrote:
> As long as the code only gets alterned into something logically
> > equivalaent, and as long as I can retreive the contents of comments
> > formatted as they were originally, I'm not concerned. (Other than
> > enforcing so many so many spaces after something like // and before
> > it,
> > lining up // on adjacent lines in a configurable manner, etc.)
> 
> You cannot easily do this with the current fcl-passrc. In fact, I
> would
> not recommend it.
> 
> The comments are not kept and do not appear in the AST built by the
> parser.
> There is a way to keep the comments, but all info as to where they
> should be
> inserted is lost. There are ways to solve this, but you will never be
> able
> to insert all comments again; only some constructs can be recognized
> and
> reproduced.
> 
> A second problem is that if you use IFDEFS, you will only see the
> part of
> your code that corresponds to the conditional branches taken in the
> code.
> 
> If you are concerned with reformatting only, then ptop is the better
> way to go.
> It just cares about tokens, and will process all branches of
> conditional
> code.

Thank you! This is why I asked on on this email list.
ptop it will need to be then...

I'm not sure if I can get function/procedure modifiers to work without
source code changes (to ptop), but I'll find out...
It seems like most everything else works with config tweaks, but I'll
need to verify that.

Once again, thanks.

Sincerely,
Dwight Schauer




More information about the fpc-pascal mailing list