[nem-en] Re: indentation syntax ideas

Michal Moskal michal.moskal at gmail.com
Sun Oct 30 15:04:22 CET 2005


Talking to myself again ;-)

On 10/28/05, Michal Moskal <michal.moskal at gmail.com> wrote:
> I'm not very happy with the exception for the indented-operator rule made
> for |.

I killed it.

> Also I guess the \ processing should be changed, that if it is proceeded
> by the newline, the newline is ignored. This should be done at the
> lexer level.

This shouldn't be done at the lexer level. PreParser does this, it
seems to work.

> Now the syntax is activated by the -i switch. Maybe it would be good
> to provide something like #pragma indent or #indent to activate it
> on file-by-file basis (that is no mixture of syntaxes within a file,
> just when the traditional lexer sees #indent, it aborts and creates a
> new indentaion lexer for this file).

Not yet done, need some comment -- is it good idea to change the lexer
depending on file contents?

> I'm not sure how to handle 1. Probably if the next line begins with {,
> don't add { nor ;.

So it was done.

I updated the webpage about it:
  http://nemerle.org/Indentation-based_syntax

Now the compiler can compile itself with the -i option enabled, so
it's fairly compatible (i.e. when it sees { ... } it turns itself
off).

--
   Michal Moskal,
   http://nemerle.org/~malekith/



More information about the devel-en mailing list