lang: ast, interfaces, interpret: Change the Output sig

This plumbs through the new Output method signature that accepts a table
of function pointers to values and relies on the previous storing of the
function pointers to be used for the lookup right now. This has the
elegant side-effect that Output generation could run in parallel with
the graph engine, as the engine only needs to pause to take a snapshot
of the current values tables.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
James Shubin
2023-08-11 15:56:10 -04:00
parent 9175d26b3b
commit 31c7144fff
3 changed files with 102 additions and 59 deletions

View File

@@ -76,8 +76,9 @@ type Stmt interface {
Graph() (*pgraph.Graph, error)
// Output returns the output that this "program" produces. This output
// is what is used to build the output graph.
Output() (*Output, error)
// is what is used to build the output graph. It requires the input
// table of values that are used to populate each function.
Output(map[Func]types.Value) (*Output, error)
}
// Expr represents an expression in the language. Expr implementations must have