Is anyone working on a D source code formatting tool?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 11 11:50:55 PST 2015


On 1/11/15 10:48 AM, Walter Bright wrote:
> On 1/11/2015 9:45 AM, Stefan Koch wrote:
>> I'm  powerful writing a parser-generator, that will be able to
>> transform the
>> generated parse-tree back into source automatically.
>> writing a rule-based formatter should be pretty doable.
>
> Formatting the AST into text is straightforward, dmd already does that
> for .di file generation.
>
> The main problem is what to do about comments, which don't fit into the
> grammar.

In the first version comments might go through unchanged.

> A secondary problem is what to do when the line length limit is
> exceeded, such as for long expressions.

I think that's problem #1.


Andrei


More information about the Digitalmars-d mailing list