[Lazarus] Using FPC parser/tokenizer for code formatting
Michael Van Canneyt
michael at freepascal.org
Fri May 28 16:26:06 CEST 2010
On Fri, 28 May 2010, Adem wrote:
> On 2010-05-28 16:32, Michael Van Canneyt wrote:
>>> I'd also like to hear opinions whether I should spend time on this, or
>>> even whether it is a good idea to use FPC's parser/tokenizer engine for
>>> code formatter.
>> IMHO: No. The FPC parser/tokenizer is not very forgiving about errors in
>> the code.
>> That means that as soon as an error is encountered, the parser stops
>> parsing. That in turn means that everything below the error will not be
>> formatted.
> I am aware of that.
>
> But, I am hoping to modify the FPC parser/tokenizer so that instead of it
> deciding whether to stop, it should do a callback and let the caller decide
> whether it should stop.
>
> Is this likely to be unworthy of the effort?
No, but it is hard to do in a meaningful way.
Michael.
More information about the Lazarus
mailing list