On Fri, Aug 13, 2010 at 11:04 PM, Jonathan S. Shapiro <[email protected]>wrote:

>
> My statement was mistaken. I should have said that what is necessary to
> avoid auto-semi is (a) to insert the appropriate curly braces and semicolons
> where they belong, and (b) to avoid indenting a *continuation* line with
> the same indentation as the line it continues.
>

That being said, I think that a piece of code that reads:

{
      x := 1 +
  3;
}

should be viewed as fairly suspect, and the absence of a closing curly brace
before the implied closing position to the left of "3" is probably cause for
issuing a diagnostic - and perhaps an error rather than a warning. On the
rare occasion where something this horrible is actually needed, one could
use:

{
      x := 1 +  \
  3;
}

where the "\" indicates that newline does not end the line. The motivating
use case for this is something like:

{
  printf("abc %s def %d", \
"a very long diagnostic string here that would line wrap", \
5)
}


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to