MCPcopy
hub / github.com/google/go-jsonnet / buildInterpreter

Function buildInterpreter

interpreter.go:1278–1297  ·  view source on GitHub ↗
(ext vmExtMap, nativeFuncs map[string]*NativeFunction, maxStack int, ic *importCache, traceOut io.Writer, evalHook EvalHook)

Source from the content-addressed store, hash-verified

1276}
1277
1278func buildInterpreter(ext vmExtMap, nativeFuncs map[string]*NativeFunction, maxStack int, ic *importCache, traceOut io.Writer, evalHook EvalHook) (*interpreter, error) {
1279 i := interpreter{
1280 stack: makeCallStack(maxStack),
1281 importCache: ic,
1282 traceOut: traceOut,
1283 nativeFuncs: nativeFuncs,
1284 evalHook: evalHook,
1285 }
1286
1287 stdObj, err := buildStdObject(&i)
1288 if err != nil {
1289 return nil, err
1290 }
1291
1292 i.baseStd = stdObj
1293
1294 i.extVars = prepareExtVars(&i, ext, "extvar")
1295
1296 return &i, nil
1297}
1298
1299func makeInitialEnv(filename string, baseStd *valueObject) environment {
1300 fileSpecific := buildObject(ast.ObjectFieldHidden, map[string]value{

Callers 1

Calls 3

makeCallStackFunction · 0.85
buildStdObjectFunction · 0.85
prepareExtVarsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…