lua-CodeGen
a template engine

Reference

Just an alternate implementation using LPeg (instead of pattern matching from string library).

Examples

local CodeGen = require 'CodeGen.lpeg'

tmpl = CodeGen {    -- instanciation
    tarball = "${name}-${version}.tar.gz",
    name = 'lua',
}
tmpl.version = 5.1
output = tmpl 'tarball'     -- interpolation
print(output) --> lua-5.1.tar.gz