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

Function Compile

code.go:62–74  ·  view source on GitHub ↗
(text, filename string, start StartToken)

Source from the content-addressed store, hash-verified

60}
61
62func Compile(text, filename string, start StartToken) (*Code, error) {
63 t := C.CString(text)
64 defer C.free(unsafe.Pointer(t))
65
66 fn := C.CString(filename)
67 defer C.free(unsafe.Pointer(fn))
68
69 ret := C.compileString(t, fn, C.int(start))
70 if ret == nil {
71 return nil, exception()
72 }
73 return newCode(ret), nil
74}
75
76func CompileFile(name string, start StartToken) (*Code, error) {
77 fn := C.CString(name)

Callers 4

TestCompileFunction · 0.85
_TestEvalLocalGlobalsFunction · 0.85
TestModuleFunction · 0.85
TestGoModuleFunction · 0.85

Calls 2

exceptionFunction · 0.85
newCodeFunction · 0.85

Tested by 4

TestCompileFunction · 0.68
_TestEvalLocalGlobalsFunction · 0.68
TestModuleFunction · 0.68
TestGoModuleFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…