dfmt icon indicating copy to clipboard operation
dfmt copied to clipboard

Spacing inserted around unary operator after error

Open yebblies opened this issue 9 years ago • 2 comments

In this case at least, it's possible to know it's a unary operator despite the error.

unittest
{
    {
    }
-    else if (functionParameters(&type))
+    else if (functionParameters( & type))
    {
    }
}

yebblies avatar Mar 09 '15 06:03 yebblies

I think this requires a very different approach than using libdparse. In other words a really big change and rearchitecture of dfmt. However, the ability to format "unparseable" D code enables other features. For example, you could format diffs then.

Well, maybe libdparse can implement some clever error recovery. Then you maybe can format a few cases like this?

qznc avatar Aug 06 '15 19:08 qznc

"clever error recovery" sounds uncomfortably similar to "sufficiently smart compiler".

Hackerpilot avatar Aug 06 '15 21:08 Hackerpilot