Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:
SomeFunction({MACRO({ return output; }), b});
where MACRO could e.g. expand to a lambda.
llvm-svn: 241059
FormatTok->BlockKind = BK_BracedInit;
parseBracedList();
break;
- case tok::r_paren:
+ case tok::l_paren:
+ parseParens();
// JavaScript can just have free standing methods and getters/setters in
// object literals. Detect them by a "{" following ")".
if (Style.Language == FormatStyle::LK_JavaScript) {
- nextToken();
if (FormatTok->is(tok::l_brace))
parseChildBlock();
break;
}
- nextToken();
break;
case tok::r_brace:
nextToken();
"}, a);",
Style);
+ verifyFormat("SomeFunction({MACRO({ return output; }), b});");
+
verifyNoCrash("^{v^{a}}");
}