Generate C# syntax not directly supported by Haxe. Use only at low-level when specific target-specific code-generation is required.

Static methods

staticcode(code:String, args:Rest<Dynamic>):Dynamic

Inject code directly into generated source.

code must be a string constant.

Additional args are supported to provide code interpolation, for example:

Syntax.code("System.Console.WriteLine({0} + {1})", "hi", 42);

will generate

System.Console.WriteLine("hi" + 42);

Emits a compilation error if the count of args does not match the count of placeholders in code.


Inject code directly into generated source. The same as cs.Syntax.code except this one does not provide code interpolation.