(expr ast.Expr)
| 85 | } |
| 86 | |
| 87 | func (p *planBuilder) plan(expr ast.Expr) (InterpretableV2, error) { |
| 88 | switch expr.Kind() { |
| 89 | case ast.CallKind: |
| 90 | return p.decorate(p.planCall(expr)) |
| 91 | case ast.IdentKind: |
| 92 | return p.decorate(p.planIdent(expr)) |
| 93 | case ast.LiteralKind: |
| 94 | return p.decorate(p.planConst(expr)) |
| 95 | case ast.SelectKind: |
| 96 | return p.decorate(p.planSelect(expr)) |
| 97 | case ast.ListKind: |
| 98 | return p.decorate(p.planCreateList(expr)) |
| 99 | case ast.MapKind: |
| 100 | return p.decorate(p.planCreateMap(expr)) |
| 101 | case ast.StructKind: |
| 102 | return p.decorate(p.planCreateStruct(expr)) |
| 103 | case ast.ComprehensionKind: |
| 104 | return p.decorate(p.planComprehension(expr)) |
| 105 | } |
| 106 | return nil, fmt.Errorf("unsupported expr: %v", expr) |
| 107 | } |
| 108 | |
| 109 | // decorate applies the InterpretableDecorator functions to the given Interpretable. |
| 110 | // Both the Interpretable and error generated by a Plan step are accepted as arguments |
no test coverage detected