parent
b227c66146
commit
a163eb105f
|
@ -895,6 +895,20 @@ private:
|
||||||
indents.push(tok!"if");
|
indents.push(tok!"if");
|
||||||
formatLeftBrace();
|
formatLeftBrace();
|
||||||
}
|
}
|
||||||
|
else if (currentIs(tok!"{") && indents.topAre(tok!"static", tok!"foreach"))
|
||||||
|
{
|
||||||
|
indents.pop();
|
||||||
|
indents.pop();
|
||||||
|
indents.push(tok!"foreach");
|
||||||
|
formatLeftBrace();
|
||||||
|
}
|
||||||
|
else if (currentIs(tok!"{") && indents.topAre(tok!"static", tok!"foreach_reverse"))
|
||||||
|
{
|
||||||
|
indents.pop();
|
||||||
|
indents.pop();
|
||||||
|
indents.push(tok!"foreach_reverse");
|
||||||
|
formatLeftBrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void formatElse()
|
void formatElse()
|
||||||
|
|
|
@ -197,7 +197,8 @@ private:
|
||||||
immutable currentIsNonWrapTemp = !isWrapIndent(arr[i])
|
immutable currentIsNonWrapTemp = !isWrapIndent(arr[i])
|
||||||
&& isTempIndent(arr[i]) && arr[i] != tok!")" && arr[i] != tok!"!";
|
&& isTempIndent(arr[i]) && arr[i] != tok!")" && arr[i] != tok!"!";
|
||||||
if (arr[i] == tok!"static" && (arr[i + 1] == tok!"if"
|
if (arr[i] == tok!"static" && (arr[i + 1] == tok!"if"
|
||||||
|| arr[i + 1] == tok!"else") && (i + 2 >= index || arr[i + 2] != tok!"{"))
|
|| arr[i + 1] == tok!"else" || arr[i + 1] == tok!"foreach"
|
||||||
|
|| arr[i + 1] == tok!"foreach_reverse") && (i + 2 >= index || arr[i + 2] != tok!"{"))
|
||||||
{
|
{
|
||||||
parenCount = pc;
|
parenCount = pc;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
static foreach (thing; things)
|
||||||
|
{
|
||||||
|
doStuff();
|
||||||
|
}
|
||||||
|
static foreach_reverse (thing; things)
|
||||||
|
{
|
||||||
|
doStuff();
|
||||||
|
}
|
||||||
|
static foreach (thing; things)
|
||||||
|
doStuff();
|
||||||
|
static foreach_reverse (thing; things)
|
||||||
|
doStuff();
|
|
@ -0,0 +1,4 @@
|
||||||
|
static foreach (thing; things){doStuff();}
|
||||||
|
static foreach_reverse (thing; things){doStuff();}
|
||||||
|
static foreach (thing; things) doStuff();
|
||||||
|
static foreach_reverse (thing; things) doStuff();
|
|
@ -0,0 +1,10 @@
|
||||||
|
static foreach (thing; things) {
|
||||||
|
doStuff();
|
||||||
|
}
|
||||||
|
static foreach_reverse (thing; things) {
|
||||||
|
doStuff();
|
||||||
|
}
|
||||||
|
static foreach (thing; things)
|
||||||
|
doStuff();
|
||||||
|
static foreach_reverse (thing; things)
|
||||||
|
doStuff();
|
Loading…
Reference in New Issue