[cfe-dev] Getting around LibFormat

Jessica Hamilton via cfe-dev cfe-dev at lists.llvm.org
Sun Apr 9 16:42:17 PDT 2017


Hi,

I'm working on trying to make changes to LibFormat to support Haiku's
coding style [1], but I'm having some trouble trying to figure out
where indentation gets calculated. I've tried various things, but
everything I've tried so far only affects some lines and not others.

For example, I'm trying to format comments with an extra indent if the
line above at what would be same indent without the extra tab for
comment is not whitespace in a function:

if (someCondition) {
    DoSomething();
        // Comments that only affect a single line are usually
        // written after it, and are indented by a single tab
    DoSomethingElse();
} else if (someOtherCondition) {
    DoSomethingElse();
    DoSomething();
}

At the moment, I'm just trying to indent comments an extra tab
unconditionally to identify what might be the right approach, but as
stated above, I've only managed to affect a partial set of what I
want. Finding the documentation just a little too sparse to see how it
all fits together. Some changes are definitely simpler than others...
some pointers would be very much appreciated :-)

Jessica

[1] https://www.haiku-os.org/development/coding-guidelines



More information about the cfe-dev mailing list