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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user