[cfe-dev] Getting around LibFormat

Jessica Hamilton via cfe-dev cfe-dev at lists.llvm.org
Mon Apr 10 19:36:07 PDT 2017


That seems to have done the trick! Somehow managed to miss this with
all my grepping :-)

On 10 April 2017 at 22:12, Krasimir Georgiev <krasimir at google.com> wrote:
> Hi!
>
> Unfortunately comment formatting is all over the place. For your use case,
> it might be worth looking at TokenAnnotator::setCommentLineLevels: it
> computes the Level-s of comment tokens based on the next non-comment token.
> So I'd say that an additional level there might work, but haven't really
> tried.
>
> Best regards,
> Krasimir
>
> On Mon, Apr 10, 2017 at 11:33 AM, Eric Liu <ioeric at google.com> wrote:
>>
>> + Krasimir
>>
>> On Mon, Apr 10, 2017 at 1:42 AM Jessica Hamilton via cfe-dev
>> <cfe-dev at lists.llvm.org> wrote:
>>>
>>> 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
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>



More information about the cfe-dev mailing list