about summary refs log tree commit diff
path: root/cmd/compmod/compiled.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/compmod/compiled.tmpl')
-rw-r--r--cmd/compmod/compiled.tmpl22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmd/compmod/compiled.tmpl b/cmd/compmod/compiled.tmpl
new file mode 100644
index 0000000..2070749
--- /dev/null
+++ b/cmd/compmod/compiled.tmpl
@@ -0,0 +1,22 @@
+package {{.Module}}
+
+import (
+	"jinx/pkg/lang/modules"
+	"jinx/pkg/lang/vm/code"
+)
+
+var moduleCompiled = []byte{
+	{{.Bytes}}
+}
+
+var moduleCode = code.New(code.Raw(moduleCompiled), code.NewDebugInfo("{{.Module}}"))
+
+var Module = modules.NewModule(
+	"",
+	"{{.Module}}",
+	&moduleCode,
+	[]modules.ModuleRef{},
+	[]string{
+		{{range .Globals}}"{{.}}", {{end}}
+	},
+)