[Lazarus] Using FPC parser/tokenizer for code formatting

Mattias Gärtner nc-gaertnma at netcologne.de
Mon May 31 14:00:05 CEST 2010


Zitat von Adem <listmember at letterboxes.org>:

> [...]
>> The compiler simply discards comments and it has no infrastructure to
>> link comments in any way to code.
>>
> Naturally, comments are no good for the compiler --so, I am assuming  
> that the current parser does recognise comments but does not add  
> them to the parse tree; if so, it is fine, all it will have to do is  
> to add those nodes while the compiler still ignores them. Would that  
> be too difficult to add?

I think the biggest problems are the directives. The compiler parser  
simply skips ELSE code.
A code formatter should not ignore that parts.
How do you want to format an include file for another target?
How to handle macros?


Mattias







More information about the Lazarus mailing list