|
|
@@ -26,6 +26,20 @@ func (o *Store) String() string { |
|
|
return fmt.Sprintf("Store %v: %v", o.Key, o.Var) |
|
|
return fmt.Sprintf("Store %v: %v", o.Key, o.Var) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type StoreConst struct { |
|
|
|
|
|
Key string |
|
|
|
|
|
Value exec.VarValue |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (o *StoreConst) Execute(ctx *exec.ExecContext, e *exec.Executor) error { |
|
|
|
|
|
e.Store(o.Key, o.Value) |
|
|
|
|
|
return nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (o *StoreConst) String() string { |
|
|
|
|
|
return fmt.Sprintf("StoreConst %v: %v", o.Key, o.Value) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
type StoreNode struct { |
|
|
type StoreNode struct { |
|
|
dag.NodeBase |
|
|
dag.NodeBase |
|
|
Key string |
|
|
Key string |
|
|
@@ -53,3 +67,28 @@ func (t *StoreNode) GenerateOp() (exec.Op, error) { |
|
|
// func (t *StoreType) String() string { |
|
|
// func (t *StoreType) String() string { |
|
|
// return fmt.Sprintf("Store[%s]%v%v", t.StoreKey, formatStreamIO(node), formatValueIO(node)) |
|
|
// return fmt.Sprintf("Store[%s]%v%v", t.StoreKey, formatStreamIO(node), formatValueIO(node)) |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
type StoreConstNode struct { |
|
|
|
|
|
dag.NodeBase |
|
|
|
|
|
Key string |
|
|
|
|
|
Value exec.VarValue |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (b *GraphNodeBuilder) NewStoreConst(key string, value exec.VarValue) *StoreConstNode { |
|
|
|
|
|
node := &StoreConstNode{ |
|
|
|
|
|
Key: key, |
|
|
|
|
|
Value: value, |
|
|
|
|
|
} |
|
|
|
|
|
b.AddNode(node) |
|
|
|
|
|
return node |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (t *StoreConstNode) GenerateOp() (exec.Op, error) { |
|
|
|
|
|
return &StoreConst{ |
|
|
|
|
|
Key: t.Key, |
|
|
|
|
|
Value: t.Value, |
|
|
|
|
|
}, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// func (t *StoreConstType) String() string { |
|
|
|
|
|
// return fmt.Sprintf("StoreConst[%s]%v%v", t.StoreKey, formatStreamIO(node), formatValueIO(node)) |