mzeren-vmw added a comment.
In https://reviews.llvm.org/D42036#984401, @djasper wrote:
> To me, aligning with the define seems fundamentally wrong.
we definitely have code that does that internally. It can also be seen in the
wild e.g.:
https://github.com/boostorg/config/blob/develop/include/b
djasper added a comment.
While I agree that there is probably a bug to fix, I don't (yet) agree with
what is proposed in this patch. I think a comment in between preprocessor
directives should always either:
- Be considered part of the code in between the #-lines
- Be considered to be commentin
krasimir added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1725
+ NextNonComment.Type == LT_ImportStatement) &&
+ NextNonComment.Level > 0 && !Comment.InPPDirective)
+return NextNonComment.First->Next &&
Why are we checking `NextNonC
mzeren-vmw marked 2 inline comments as done.
mzeren-vmw added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1756
+ if (Alignment == CA_Preprocessor)
+(*I)->LevelOffset = 1;
} else {
krasimir wrote:
> This feels a bit awkward: we're
mzeren-vmw updated this revision to Diff 130487.
mzeren-vmw added a comment.
Documented CommentAlignment enumerators. Documenting them suggested better
enumerator names.
Added tests for multi-line comments, block comments and trailing comments.
Repository:
rC Clang
https://reviews.llvm.org/D
krasimir added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1710
+enum CommentAlignment { CA_None, CA_Code, CA_Preprocessor };
+
Please comment these.
Comment at: lib/Format/TokenAnnotator.cpp:1756
+ if (Alignment == CA_Pre
mzeren-vmw added a comment.
In https://reviews.llvm.org/D42036#976827, @klimek wrote:
> Just from a formatting point of view, why not:
>
> //. Comment
> #.define X
(assuming the '.'s are unintentional)
There is some logic in placing `//` in column 0, since we place `#` in column
0. H
klimek added a comment.
Just from a formatting point of view, why not:
//. Comment
#.define X
Repository:
rC Clang
https://reviews.llvm.org/D42036
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/ma
mzeren-vmw created this revision.
mzeren-vmw added reviewers: euhlmann, krasimir, klimek.
Herald added a subscriber: cfe-commits.
r312125, which introduced preprocessor indentation, shipped with a known
issue where "indentation of comments immediately before indented
preprocessor lines is toggled