@@ -9,20 +9,22 @@ import (
99func init () {
1010 opName := doOp ("do" )
1111 DoOp = & opName
12- funcMap ["do" ] = DoOp
12+ opsMap ["do" ] = DoOp
1313}
1414
1515type doOp string
1616
1717// DoOp is "do" operation
1818var DoOp * doOp
1919
20- // String returns operator name
2120func (* doOp ) String () string {
2221 return string (* DoOp )
2322}
2423
25- // Bind binds its arguments, and check if the types of values are correct.
24+ func (* doOp ) IsMacro () bool {
25+ return false
26+ }
27+
2628func (* doOp ) Bind (args ... types.Value ) (* types.Expr , error ) {
2729 sig := make ([]types.Type , 0 , len (args ))
2830 for i := 0 ; i < len (args ); i ++ {
@@ -35,9 +37,7 @@ func (*doOp) Bind(args ...types.Value) (*types.Expr, error) {
3537 return types .NewExpr (DoOp , args , retType ), nil
3638}
3739
38- // InvertExpr returns inverted expression: Call Value.Invert() for each argument,
39- // and reverse arguments order.
40- func (* doOp ) InvertExpr (args []types.Value ) (* types.Expr , error ) {
40+ func (* doOp ) InvertExpr (args []types.Value ) (types.Value , error ) {
4141 newargs := make ([]types.Value , len (args ))
4242 for i := range args {
4343 a , err := args [i ].Invert ()
@@ -49,7 +49,6 @@ func (*doOp) InvertExpr(args []types.Value) (*types.Expr, error) {
4949 return DoOp .Bind (newargs ... )
5050}
5151
52- // Execute executes "do" operation
5352func (* doOp ) Execute (ctx context.Context , args []types.Value ) (val types.Value , rollback func (), err error ) {
5453 g := funcGuard (DoOp .String ())
5554 defer func () { err = g .rollback (recover ()) }()
0 commit comments