[PATCH] Revamp indentation behavior for complex binary expressions.
Manuel Klimek
klimek at google.com
Mon Apr 8 12:00:54 PDT 2013
- Previous message: [libcxx] r179041 - Change <cwchar> and <cstring> to look out for flags which may or may not be set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there.
- Next message: [PATCH] Revamp indentation behavior for complex binary expressions.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
================
Comment at: lib/Format/Format.cpp:874
@@ -886,1 +873,3 @@
+ // If return is "part" of a binary expression, align after it.
+ if (Current.is(tok::kw_return) && !Current.FakeLParens.empty())
----------------
As discussed offline, change comment.
================
Comment at: lib/Format/Format.cpp:886
@@ +885,3 @@
+ // Don't add extra indentation for the first fake parenthesis after
+ // 'return', assignements or opening <({[. The indendtation for these cases
+ // is special cased.
----------------
*indentation
================
Comment at: lib/Format/Format.cpp:903
@@ +902,3 @@
+ // the 'operator' is ',', ';' or an assignment as those have different
+ // indentation rules.
+ if (*I == prec::Conditional ||
----------------
Why does SkipFirstExtraIndent only apply to the latter?
================
Comment at: lib/Format/TokenAnnotator.cpp:787
@@ -789,2 +786,3 @@
// Eagerly consume trailing comments.
- while (isTrailingComment(Current)) {
+ while (Current && Current->FormatTok.NewlinesBefore == 0 &&
+ isTrailingComment(Current)) {
----------------
Is this independent of newline escaping? (NewlinesBefore includes escaped newlines)
================
Comment at: lib/Format/TokenAnnotator.cpp:803
@@ -804,4 +802,3 @@
CurrentPrecedence = 1 + (int) prec::Conditional;
- else if (Current->is(tok::semi) || Current->Type == TT_InlineASMColon ||
- Current->Type == TT_CtorInitializerColon)
+ else if (Current->is(tok::semi) || Current->Type == TT_InlineASMColon)
CurrentPrecedence = 1;
----------------
Why did this change?
http://llvm-reviews.chandlerc.com/D631
- Previous message: [libcxx] r179041 - Change <cwchar> and <cstring> to look out for flags which may or may not be set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there.
- Next message: [PATCH] Revamp indentation behavior for complex binary expressions.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cfe-commits
mailing list