[bitc-dev] Proposed layout rules for BitC

Jonathan S. Shapiro shap at eros-os.org
Fri Aug 13 22:55:06 PDT 2010


On Fri, Aug 13, 2010 at 6:58 PM, Ben Kloosterman <bklooste at gmail.com> wrote:

>  I like it..
>
>
>
> What about mixed layouts if you write with a brace and on the next line
> later space indentations ( as they are line based ) will be treated as
> further braces (closing the first brace will be an error) .  Should this
>  white space indentation layout be suspend until the current  brace is
> explicitly closed ?
>

Additional indentation only creates a new block at points where the grammar
provides explicitly and unambiguously for *compulsory* sequence
introduction. In all other circumstances, additional indentation gets
treated as continuation lines.

So with underlines showing insertions:

let *{* x = 5 *}* in *{*
  x
  *;*4
    y  // continuation line
    4  // continuation line
*}*

The indented "y" does not introduce a curly brace because there is no
compulsory sequence here. While { y ; 4} would be a valid expression, other
tokens are possible at the position of the '{', so it cannot be implicitly
inserted.

For tabs  , I see no issue with them when using C style notation.  When
> using the indent notation will it be converted to a set amount of white
> spaces  to match non tabbed indents ?
>

I intentionally omitted leading tabs, because there is no convention across
editors concerning tab stops. The intent is that tabs should not be used in
properly formed input (outside of strings, of course).


shap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.coyotos.org/pipermail/bitc-dev/attachments/20100813/4ee8307b/attachment-0001.html 


More information about the bitc-dev mailing list