diff options
| author | Mel <einebeere@gmail.com> | 2022-08-11 01:26:09 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-08-11 01:26:09 +0000 |
| commit | 8193e5c590177b91b51acd818e8a365ab6845988 (patch) | |
| tree | 24716cf6ff5fbc9b34dca416350f93da90a6ed21 /cmd/compmod/compiled.tmpl | |
| parent | 86f31acf6789be116dcc54ed85b069a37c0f7aa8 (diff) | |
| download | jinx-8193e5c590177b91b51acd818e8a365ab6845988.tar.zst jinx-8193e5c590177b91b51acd818e8a365ab6845988.zip | |
Add compmod tool to compile built-in modules
Diffstat (limited to 'cmd/compmod/compiled.tmpl')
| -rw-r--r-- | cmd/compmod/compiled.tmpl | 22 |
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}} + }, +) |
