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 ?

 

Maybe this

.         "After an opening '{', if the following token is not preceded by
an implied close brace position, it starts a layout item. The column number
of this token defines the layout item sequence indent level for the
containing layout item sequence. A stack of such indent levels associated
with the opening and closing of curly braces is maintained by the lexer. 

States the lexer tracks the indent but not what about additional white
space. .

 

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 ?

 

 

Ben 

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Jonathan S. Shapiro
Sent: Saturday, August 14, 2010 8:26 AM
To: Discussions about the BitC language
Subject: [bitc-dev] Proposed layout rules for BitC

 

For comment...

Rules

.      The term column number, as used here, is defined as the number of
preceding UCS4 code points that occur to the left of the token on the same
line, without regard to comments. 

.      At any point where a left curly brace is required by the grammar, one
will be inserted by the lexer if the expected '{' is missing. A '{' inserted
in this fashion is said to be implicit. A '{' obtained from the input stream
is said to explicit. 

An opening '{' signals the beginning of a layout item sequence, which is a
sequence of layout items separated by semicolons (';'). 

.      At any implied close brace position: 

o  If the current open brace was implicit, a '}' is inserted. 

o  If the current open brace was explicit and the last token processed was
not '}', an error is signalled. 

.      Lines consisting entirely of white space and lines whose first
non-whitespace token occurs at an indentation greater than the current item
indent level are treated as continuation lines; no special processing for
these lines occurs. 

.      Lines whose first non-whitespace token occurs at a column equal to
the current layout item, and whose first token is not ';' or '}', will have
a semicolon inserted unless the previously encountered token was a
semicolon, this has the effect of terminating the current layout item and
starting a new one. 

.      Lines whose first non-whitespace token occurs at a column less than
the current item indent level, and whose first token is not '}', are deemed
to be preceded by an implied close brace position for as long as the current
indent level is greater than that of the token. The implied close brace
processing occurs before this token is consumed. 

.      When a '}' (whether or not inserted) is encountered, the current item
indent level reverts to the item indent level that was in effect prior to
the matching '{' 

.      An implicit '{' must be matched by an implicit '}'. Similarly, an
explicit '{' must be matched by an explicit '}'. If this requirement is
violated, an error is signalled. 

These rules are applied iteratively until no action is taken. For example,
an out-dented line can potentially cause multiple implicit '}' insertions
and a ';' insertion. 

Syntactically Implied Close Brace Positions

The token in is preceded by a syntactically implied close brace position.
there may turn out to be other such examples, but this is the only one I
have identified so far.

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3060 - Release Date: 08/14/10
02:34:00

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

Reply via email to