问题描述
我正在尝试为if和else块实现以下clang格式:
1。对于空块,我想将它们(单行)与条件结尾处保持在同一行上,或者紧接在其他条件之后,例如
1.1
if (true) {}
else {}
1.2
if (true
) {}
else {}
1.3
if (true
) {}
else {}
2。非空块应始终在控制语句之后,在else之前和之后包装
2.1
if (true)
{
;
}
else
{
;
}
2.2
if (true) {}
else
{
;
}
2.3
if (true)
{
;
}
else {}
2.4
if (true)
{
// is this true
}
else
{
/* this might be false */
}
3. 但从不
3.1.1
if (true) {
;
}
else {
;
}
3.1.2
if (true) {
;
} else {
;
}
3.1.3
if (true)
{
;
} else
{
;
}
3.1.4
if (true)
{
;
} else
{
;
}
3.2.1
if (true) {
}
else {
}
3.2.2
if (true) {
} else {
}
3.2.3
if (true)
{
} else
{
}
3.2.4
if (true)
{
} else
{
}
我找不到空块的解决方案。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)