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

Function codeToPV

imports.go:185–196  ·  view source on GitHub ↗
(i *interpreter, filename string, code string)

Source from the content-addressed store, hash-verified

183}
184
185func codeToPV(i *interpreter, filename string, code string) *cachedThunk {
186 node, err := program.SnippetToAST(ast.DiagnosticFileName(filename), "", code)
187 if err != nil {
188 // TODO(sbarzowski) we should wrap (static) error here
189 // within a RuntimeError. Because whether we get this error or not
190 // actually depends on what happens in Runtime (whether import gets
191 // evaluated).
192 // The same thinking applies to external variables.
193 return &cachedThunk{err: err}
194 }
195 return nodeToPV(i, filename, node)
196}
197
198// ImportCode imports code from a path.
199func (cache *importCache) importCode(importedFrom, importedPath string, i *interpreter) (value, error) {

Callers 1

prepareExtVarsFunction · 0.85

Calls 3

SnippetToASTFunction · 0.92
DiagnosticFileNameTypeAlias · 0.92
nodeToPVFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…