[nem-en] indentation syntax ideas
Kamil Skalski
kamil.skalski at gmail.com
Mon Oct 31 10:53:37 CET 2005
2005/10/30, Michal Moskal <michal.moskal at gmail.com>:
> On 10/30/05, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> > >
> > > As for the second suggestion (the next email), I'm happy with ignoring
> > > Semicolon (true) at the top-level, if it's possible.
> > >
> >
> > Actually it would be better to not generate it...
>
> But the pre-parser doesn't know where is the top-level. This needs to
> be done at the parser level?
Unfortunately..
>
> > But this seems quite
> > near in ease of implementation as ignoring the existing ones. Though
> > maybe the syntax extensions parser could be intelligent here and
> > totally ignore the generated tokens (even in all places)
>
> But sometimes the semicolons are needed here. For example:
>
> class C
> foo = 13
> bar : string
> baz : bool
>
> (though I'm not sure if they are properly added here anyway).
They are added. And we cannot easily distinguish between this and
getfoo (i : int) : int \
requires i >= 0 && i < 5 otherwise throw
System.ArgumentOutOfRangeException (i.ToString ())
def x = array [1,2,3,4];
printf ("%d\n", x [i]);
x [i]
I don't know what would be the rule allowing to ommit \ in above example.
BTW. it works quite nice beside this problem with multiline headers,
where \ is needed.
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list