Showing with 16 additions and 3 deletions.
  1. +0 −1 src/magicport.json
  2. +16 −2 src/magicport/dprinter.d
1 change: 0 additions & 1 deletion src/magicport.json
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,6 @@
],
"extra" :
[
"enum ASYNCREAD = false;"
],
"members" :
[
Expand Down
18 changes: 16 additions & 2 deletions src/magicport/dprinter.d
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ class DPrinter : Visitor
override void visit(VarDeclaration ast)
{
if (ast.stc & STCextern) return;
if (ast.id == "ASYNCREAD") return;
if (ast.id == "ASYNCREAD")
{
print("enum ASYNCREAD = false");
return;
}
bool manifest;
auto at = cast(ArrayType)ast.type;
if (!D2)
Expand Down Expand Up @@ -1070,7 +1074,6 @@ class DPrinter : Visitor

override void visit(DeleteExpr ast)
{
print("/*delete*/");
}

override void visit(NotExpr ast)
Expand Down Expand Up @@ -1449,11 +1452,19 @@ class DPrinter : Visitor
if (ast.e)
{
bool skipsemi;
bool skipnl;
if (auto de = cast(DeclarationExpr)ast.e)
{
if (cast(StructDeclaration)de.d ||
cast(MacroDeclaration)de.d)
skipsemi = true;
if (cast(MacroUnDeclaration)de.d)
skipnl = true;
}
if (auto de = cast(DeleteExpr)ast.e)
{
skipsemi = true;
skipnl = true;
}
visitX(ast.e);
if (ast.trailingcomment)
Expand All @@ -1462,6 +1473,9 @@ class DPrinter : Visitor
print("; ");
println(ast.trailingcomment.strip);
}
else if (skipnl)
{
}
else if (skipsemi)
println("");
else
Expand Down