GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
GoogleStyle.ColumnLimit = 100;
GoogleStyle.SpaceAfterCStyleCast = true;
+ GoogleStyle.SpacesBeforeTrailingComments = 1;
} else if (Language == FormatStyle::LK_JavaScript) {
GoogleStyle.BreakBeforeTernaryOperators = false;
GoogleStyle.MaxEmptyLinesToKeep = 3;
next();
return true;
}
- if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace,
- tok::colon))
- return false;
if (CurrentToken->is(tok::question) &&
- Style.Language != FormatStyle::LK_Java)
+ Style.Language == FormatStyle::LK_Java) {
+ next();
+ continue;
+ }
+ if (CurrentToken->isOneOf(tok::r_paren, tok::r_square, tok::r_brace,
+ tok::colon, tok::question))
return false;
// If a && or || is found and interpreted as a binary operator, this set
// of angles is likely part of something like "a < b && c > d". If the
}
bool parseConditional() {
- if (Style.Language == FormatStyle::LK_Java &&
- CurrentToken->isOneOf(tok::comma, tok::greater))
- return true; // This is a generic "?".
-
while (CurrentToken) {
if (CurrentToken->is(tok::colon)) {
CurrentToken->Type = TT_ConditionalExpr;
verifyFormat("public static <R> ArrayList<R> get() {\n}");
verifyFormat("<T extends B> T getInstance(Class<T> type);");
+ verifyFormat("Function<F, ? extends T> function;");
}
TEST_F(FormatTestJava, StringConcatenation) {