HaxeFoundation/haxe — pull request #3309 by Simn (2014-09-03 09:21:28+00:00)
Title: add `--eval "module code"`

This pull requests adds the command line option `--eval "module code"` which parses the supplied code, resolves the main class if available and types the declarations. If no class containing `main` is found the module path defaults to the path of the first defined module.

My goal is to have a way of passing arbitrary code to Haxe without having to specify `-main` manually and without having to generate temp files in the first place.

I want to use this to automatically validate the code examples in the Haxe manual. Resolving the main class is the only way to avoid conventions (I could resolve it before passing it to Haxe, but then there's the issue that we do not allow `-main Module.Type`).