[nem-en] indentation syntax ideas
Kamil Skalski
kamil.skalski at gmail.com
Sun Oct 30 21:35:42 CET 2005
2005/10/28, Michal Moskal <michal.moskal at gmail.com>:
>
> 2. similarly for
> [SomeAttribute]
> class Something ...
> it adds ; after ].
So it works now for every kind of [] ? Maybe the more "safe" way to
do this is to allow
code like
[Foo];
class A { }
in standard parser?
>
> 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).
The worst thing about -i is that it can introduce strange bugs into
normal {}-programs... So I'm not so sure if mixing styles is a good
thing. Having ability to specify exactly files with indentation
support would be quite nice and #pragma seems to be the cleanest
design for me. I guess it is even worth the unelegant lexer-change
implementation, though we could force users to specify the mode at the
very beginning of file. So PreParser could have something like "parse
preludium" and then maybe change the lexer.
The proposal of Philippe looks like an universal solution, which would
give us what we need in an easy way. I still don't really like the
design in which ordering of command line parameters change the
semantics... As for now, I would vote against, but if others like it?
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list