MCPcopy Create free account
hub / github.com/goplus/py / CompileFile

Function CompileFile

code.go:76–91  ·  view source on GitHub ↗
(name string, start StartToken)

Source from the content-addressed store, hash-verified

74}
75
76func CompileFile(name string, start StartToken) (*Code, error) {
77 fn := C.CString(name)
78 defer C.free(unsafe.Pointer(fn))
79
80 file, err := C.openFile(fn)
81 if file == nil {
82 return nil, err
83 }
84 defer C.fclose(file)
85
86 ret := C.compileFile(file, fn, C.int(start))
87 if ret == nil {
88 return nil, exception()
89 }
90 return newCode(ret), nil
91}
92
93// Return value: New reference.
94func (code *Code) Eval(globals, locals *Base) (*Base, error) {

Callers

nothing calls this directly

Calls 2

exceptionFunction · 0.85
newCodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…