commit
0a351990c2
24
appveyor.yml
24
appveyor.yml
|
@ -19,18 +19,18 @@ environment:
|
||||||
- DC: dmd
|
- DC: dmd
|
||||||
DVersion: stable
|
DVersion: stable
|
||||||
arch: x86
|
arch: x86
|
||||||
- DC: ldc
|
# - DC: ldc
|
||||||
DVersion: beta
|
# DVersion: beta
|
||||||
arch: x86
|
# arch: x86
|
||||||
- DC: ldc
|
# - DC: ldc
|
||||||
DVersion: beta
|
# DVersion: beta
|
||||||
arch: x64
|
# arch: x64
|
||||||
- DC: ldc
|
# - DC: ldc
|
||||||
DVersion: stable
|
# DVersion: stable
|
||||||
arch: x86
|
# arch: x86
|
||||||
- DC: ldc
|
# - DC: ldc
|
||||||
DVersion: stable
|
# DVersion: stable
|
||||||
arch: x64
|
# arch: x64
|
||||||
|
|
||||||
skip_tags: false
|
skip_tags: false
|
||||||
branches:
|
branches:
|
||||||
|
|
|
@ -841,7 +841,8 @@ private:
|
||||||
justAddedExtraNewline = true;
|
justAddedExtraNewline = true;
|
||||||
}
|
}
|
||||||
if (config.dfmt_brace_style == BraceStyle.otbs
|
if (config.dfmt_brace_style == BraceStyle.otbs
|
||||||
&& peekIs(tok!"else") && !indents.topAre(tok!"static", tok!"if"))
|
&& peekIs(tok!"else") && !indents.topAre(tok!"static", tok!"if")
|
||||||
|
&& !indents.topIs(tok!"foreach"))
|
||||||
{
|
{
|
||||||
write(" ");
|
write(" ");
|
||||||
index++;
|
index++;
|
||||||
|
@ -852,7 +853,7 @@ private:
|
||||||
&& !peekIs(tok!";") && !peekIs(tok!"{"))
|
&& !peekIs(tok!";") && !peekIs(tok!"{"))
|
||||||
{
|
{
|
||||||
index++;
|
index++;
|
||||||
if (indents.topIs(tok!"static"))
|
if (indents.topIsOneOf(tok!"static", tok!"foreach"))
|
||||||
indents.pop();
|
indents.pop();
|
||||||
newline();
|
newline();
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,14 +159,17 @@ struct IndentStack
|
||||||
return cast(int) index;
|
return cast(int) index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/+void dump()
|
/**
|
||||||
|
* Dumps the current state of the indentation stack to `stderr`. Used for debugging.
|
||||||
|
*/
|
||||||
|
void dump()
|
||||||
{
|
{
|
||||||
import std.stdio : stderr;
|
import std.stdio : stderr;
|
||||||
import dparse.lexer : str;
|
import dparse.lexer : str;
|
||||||
import std.algorithm.iteration : map;
|
import std.algorithm.iteration : map;
|
||||||
|
|
||||||
stderr.writefln("\033[31m%(%s %)\033[0m", arr[0 .. index].map!(a => str(a)));
|
stderr.writefln("\033[31m%(%s %)\033[0m", arr[0 .. index].map!(a => str(a)));
|
||||||
}+/
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
auto d = {
|
||||||
|
if (a)
|
||||||
|
foreach (b; c)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
e();
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
auto d = {
|
||||||
|
if (a)
|
||||||
|
foreach (b; c) { }
|
||||||
|
else
|
||||||
|
e();
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
void main() {
|
||||||
|
auto d = {
|
||||||
|
if (a)
|
||||||
|
foreach (b; c) {
|
||||||
|
}
|
||||||
|
else
|
||||||
|
e();
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue