[nem-en] change to MainParser

Michal Moskal michal.moskal at gmail.com
Mon Nov 20 15:09:53 CET 2006


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ł


More information about the devel-en mailing list