lang: ast, interfaces, interpret: Table should be a well-known type

We use this in enough places, that it's nice to have it as a well-known
alias.
This commit is contained in:
James Shubin
2025-07-07 20:46:13 -04:00
parent 73e641120f
commit d113fcb6d7
4 changed files with 21 additions and 19 deletions

View File

@@ -37,7 +37,6 @@ import (
"github.com/purpleidea/mgmt/engine"
engineUtil "github.com/purpleidea/mgmt/engine/util"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/pgraph"
"github.com/purpleidea/mgmt/util/errwrap"
)
@@ -74,7 +73,7 @@ type Interpreter struct {
// requires an AST, and the table of values required to populate that AST. Type
// unification, and earlier steps should obviously be run first so that you can
// actually get a useful resource graph out of this instead of an error!
func (obj *Interpreter) Interpret(ast interfaces.Stmt, table map[interfaces.Func]types.Value) (*pgraph.Graph, error) {
func (obj *Interpreter) Interpret(ast interfaces.Stmt, table interfaces.Table) (*pgraph.Graph, error) {
// build the kind,name -> res mapping
obj.lookup = make(map[engine.ResPtrUID]engine.Res)