fix: allow yaegi command to interpret itself

Since the introduction of restricted stdlib and syscall symbols, the
capability of yaegi to interpret itself was broken.
The use of unrestricted symbols is now also controlled by environment
variables, to allow propagation accross nested interpreters.
The interpreter Panic symbol was not wrapped, this is fixed now.
the import path resolution was failing if the working directory was
outside of GOPATH.
The documentation and readme have been ajusted.

Fixes #890.
This commit is contained in:
Marc Vertes
2020-10-09 11:48:04 +02:00
committed by GitHub
parent 155ca4e6ad
commit a83ec1f925
8 changed files with 49 additions and 26 deletions

View File

@@ -2037,7 +2037,7 @@ func doCompositeBinStruct(n *node, hasType bool) {
}
} else {
fieldIndex[i] = []int{i}
if c.typ.cat == funcT {
if c.typ.cat == funcT && len(c.child) > 1 {
convertLiteralValue(c.child[1], typ.Field(i).Type)
values[i] = genFunctionWrapper(c.child[1])
} else {