[nem-en] change to MainParser
Kamil Skalski
kamil.skalski at gmail.com
Mon Nov 20 21:14:24 CET 2006
Maybe a better way would be to generate Main only if it is unambiguous
which module it should be placed in. This way if you have more than
one file with plain expressions you would need to explicitly create
the Main () method.
We could also have the -main switch (I guess C# has something similar)
to specify the method, which should be main entry (so also one of the
generated methods could be chosen).
The NUnit DLS looks quite pleasant :-) I hope it could be publicized
on the wiki or compiler's standard macros once you get it to stable
form.
On 11/20/06, Michal Moskal <michal.moskal at gmail.com> wrote:
> On 11/20/06, Kamil Dworakowski <kamil.dworakowski at googlemail.com> wrote:
> > Hi all,
> >
> > I have made a DSL for NUnit tests.
>
> Great!
>
> > To make it work, however, I have slightly modified the MainParser class.
> >
> > Currently, if MainParser doesn't encounter top level declaration (e.g.,
> > class, module, etc.), but a sequence, it will create a module with a
> > static Main method to put the sequence there. I would like to extend it,
> > so that:
> > -- parser creates a class with the same name as file
> > -- the name of the method to put the sequence into would be determined
> > by the extension of the file. If it is .n file it shall put it in static
> > Main(), otherwise public static AutoMethod(): void.
> >
> > This should not brake anything.
>
> I would be rather for using this AutoMethod() thing in case some
> special compiler parameter is passed or maybe if the name ends with
> .nu. I mean it's likely people have nemerle sources ending with .nem
> or something and I don't want the semantics to change. Also it would
> be nice to quote the file name somehow (e.g. replace every non
> alpha-numeric with _).
>
> --
> Michał
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
>
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list