feat: add `dfmt_compact_labeled_statements`
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
parent
07bfe5c208
commit
14024a5725
|
@ -1896,6 +1896,9 @@ extern (C++) class FormatVisitor : SemanticTimeTransitiveVisitor
|
||||||
{
|
{
|
||||||
write(s.ident.toString());
|
write(s.ident.toString());
|
||||||
write(':');
|
write(':');
|
||||||
|
if (config.dfmt_compact_labeled_statements)
|
||||||
|
write(' ');
|
||||||
|
else
|
||||||
newline();
|
newline();
|
||||||
if (s.statement)
|
if (s.statement)
|
||||||
writeStatement(s.statement);
|
writeStatement(s.statement);
|
||||||
|
|
|
@ -33,9 +33,9 @@ bool format(string source_desc, ubyte[] buffer, File.LockingTextWriter output,
|
||||||
Config* formatterConfig)
|
Config* formatterConfig)
|
||||||
{
|
{
|
||||||
initDMD();
|
initDMD();
|
||||||
auto module_ = parseModule(source_desc);
|
auto module_ = parseModule(source_desc)[0];
|
||||||
scope v = new FormatVisitor(output, formatterConfig);
|
scope v = new FormatVisitor(output, formatterConfig);
|
||||||
v.visit(module_[0]);
|
v.visit(module_);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue