[Lazarus] New constref parameter-type support in codetools

Joost van der Sluis joost at cnoc.nl
Mon Oct 11 22:17:05 CEST 2010


On Mon, 2010-10-11 at 01:46 +0200, Mattias Gaertner wrote:
> On Sun, 10 Oct 2010 15:53:43 +0200
> Joost van der Sluis <joost at cnoc.nl> wrote:
> 
> > Hi all,
> > 
> > There is a xpcom-branch which adds the 'constref' parameter type to Free
> > Pascal. This can be useful for connecting to external api's
> > (http://bugs.freepascal.org/view.php?id=7612)
> > 
> > Normally I would ask Mattias to add the 'constref' parsing to the
> > codetools and in most cases it's done within a few hours. But this case
> > I though: I can do this myself.
> 
> When is constref a keyword and when not?

Only in the declaration of the parameters of a
function/procedure/method:

function/procedure test(constref param: integer);

No-where else.
 
> > Attached patch works for me, but I doubt it is ok. Why are there two
> > lists for keywords? (WordIsKeyword and WordIsDelphiKeyword) Is that for
> > the different fpc-compilation mode's?
> 
> Yes.
> WordIsKeyword should probably better be named WordIsObjFPCKeyWord.
> 
>  
> > And what is AllKeyWords for? 
> 
> It is used by the simple beautifier.
> 
> 
> > And why is 'END' added to it, it is already in WordIsKeyword?
> 
> Thanks for the hint. I removed it.

And isn't it the case that all delphi-keywords are also ObjFpc-keywords?
So the ObjFpc list can be defined as the delphi list + some extra
keywords? 
 
> > Maybe if some explanation for all these keywords-lists is added, someone
> > else can also have a look at them and fix/change somethings?
> 
> Please create a feature request, so I don't forget it.

I'll do.

Joost






More information about the Lazarus mailing list