File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
13
13
// 1. Split to operation and its arguments
14
14
// 2. Do semantic analysis recursively for its arguments
15
15
// 3. Convert to *Expr
16
- func Parse (content []byte ) (types.Value , error ) {
16
+ func Parse (content []byte ) (* types.Expr , error ) {
17
17
var value interface {}
18
18
if err := json .Unmarshal (content , value ); err != nil {
19
19
return nil , err
@@ -22,13 +22,14 @@ func Parse(content []byte) (types.Value, error) {
22
22
if ! ok {
23
23
return nil , errors .New ("top-level must be an array" )
24
24
}
25
- expr , err := parseArray (array )
25
+ arrayValue , err := parseArray (array )
26
26
if err != nil {
27
27
return nil , err
28
28
}
29
29
// If expression's operator is a macro, return value may not be an array
30
30
// (e.g. ["macro", 1, 2])
31
- if _ , ok := expr .(* types.Expr ); ! ok {
31
+ expr , ok := arrayValue .(* types.Expr )
32
+ if ! ok {
32
33
return nil , errors .New ("the result must be an expression" )
33
34
}
34
35
return expr , nil
You can’t perform that action at this time.
0 commit comments