lang: ast, funcs: Remove the secret channel from call

This removes the secret channel from the call function. Having it made
it more complicated to write new function engines, and it's not clear
why it was even needed in the first place. It seems that even the
current generation of function engines work just fine without it.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
James Shubin
2025-08-02 13:57:27 -04:00
parent 0a76910902
commit 86c6ee8dee
8 changed files with 226 additions and 52 deletions

View File

@@ -11000,20 +11000,36 @@ func (obj *ExprCall) Graph(env *interfaces.Env) (*pgraph.Graph, interfaces.Func,
// Add a vertex for the call itself.
edgeName := structs.CallFuncArgNameFunction
edgeNameDummy := structs.OutputFuncDummyArgName
callSubgraphOutput := &structs.OutputFunc{ // the new graph shape thing!
Textarea: obj.Textarea,
Name: "callSubgraphOutput",
Type: obj.typ,
EdgeName: structs.OutputFuncArgName,
}
graph.AddVertex(callSubgraphOutput)
callFunc := &structs.CallFunc{
Textarea: obj.Textarea,
Type: obj.typ,
FuncType: ftyp,
EdgeName: edgeName,
ArgVertices: argFuncs,
Type: obj.typ,
FuncType: ftyp,
EdgeName: edgeName,
ArgVertices: argFuncs,
OutputVertex: callSubgraphOutput,
}
graph.AddVertex(callFunc)
graph.AddEdge(funcValueFunc, callFunc, &interfaces.FuncEdge{
Args: []string{edgeName},
})
return graph, callFunc, nil
graph.AddEdge(callFunc, callSubgraphOutput, &interfaces.FuncEdge{
Args: []string{edgeNameDummy},
})
return graph, callSubgraphOutput, nil
}
// funcValueFunc is a helper function to make the code more readable. This was