61890b15cb
* wip * move print and JSON functions to modules * builtin functions are not replacable now * builtin functions are added for default nil symbol table * importables: builtin modules and source modules * refactoring runtime tests * fix tests * update documentation * cleanup * clean up cli * fix REPL prints
11 lines
248 B
Go
11 lines
248 B
Go
package objects
|
|
|
|
// SourceModule is an importable module that's written in Tengo.
|
|
type SourceModule struct {
|
|
Src []byte
|
|
}
|
|
|
|
// Import returns a module source code.
|
|
func (m *SourceModule) Import(_ string) (interface{}, error) {
|
|
return m.Src, nil
|
|
}
|