(i *interpreter, filename string, code string)
| 183 | } |
| 184 | |
| 185 | func 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. |
| 199 | func (cache *importCache) importCode(importedFrom, importedPath string, i *interpreter) (value, error) { |
no test coverage detected
searching dependent graphs…