Skip to content

Helper class for generating code concisely.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

UnioGame/UniGame.CodeWriter

 
 

Repository files navigation

CodeWriter

NuGet Status Build status Coverage Status Coverity Status

CodeWriter is a small helper class for generating code concisely. It helps writing neat code which generates code dynamically.

Following code generates C# code on the fly:

var w = new CodeWriter.CodeWriter(CodeWriterSettings.CSharpDefault);
using (w.B("class Test"))
{
    using (w.B("public static int Sum(int a, int b)"))
    {
        w._("var r = a + b;",
            "return r;");
    }
}
Console.Write(w.ToString());

Output:

class Test
{
    public static int Sum(int a, int b)
    {
        var r = a + b;
        return r;
    }
}

Where can I get it?

PM> Install-Package CodeWriter

About

Helper class for generating code concisely.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C# 100.0%