File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package op
2
+
3
+ import (
4
+ "context"
5
+
6
+ "github.com/vim-volt/volt/dsl/types"
7
+ )
8
+
9
+ func init () {
10
+ s := expandMacroOp ("$expand-macro" )
11
+ ExpandMacroOp = & s
12
+ macroMap [string (* ExpandMacroOp )] = ExpandMacroOp
13
+ }
14
+
15
+ type expandMacroOp string
16
+
17
+ // ExpandMacroOp is "$expand-macro" operation
18
+ var ExpandMacroOp * expandMacroOp
19
+
20
+ // String returns "$expand-macro"
21
+ func (* expandMacroOp ) String () string {
22
+ return string (* ArrayOp )
23
+ }
24
+
25
+ // Execute executes "$expand-macro" operation
26
+ func (* expandMacroOp ) Expand (args []types.Value ) (types.Value , func (), error ) {
27
+ if err := signature (types .AnyValue ).check (args ); err != nil {
28
+ return nil , noRollback , err
29
+ }
30
+ return args [0 ].Eval (context .Background ())
31
+ }
You can’t perform that action at this time.
0 commit comments