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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241059
91177308-0d34-0410-b5e6-
96231b3b80d8
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}}");
}