(factory ExprFactory, id int64, comp *exprpb.Expr_Comprehension)
| 168 | } |
| 169 | |
| 170 | func exprComprehension(factory ExprFactory, id int64, comp *exprpb.Expr_Comprehension) (Expr, error) { |
| 171 | iterRange, err := exprInternal(factory, comp.GetIterRange()) |
| 172 | if err != nil { |
| 173 | return nil, err |
| 174 | } |
| 175 | accuInit, err := exprInternal(factory, comp.GetAccuInit()) |
| 176 | if err != nil { |
| 177 | return nil, err |
| 178 | } |
| 179 | loopCond, err := exprInternal(factory, comp.GetLoopCondition()) |
| 180 | if err != nil { |
| 181 | return nil, err |
| 182 | } |
| 183 | loopStep, err := exprInternal(factory, comp.GetLoopStep()) |
| 184 | if err != nil { |
| 185 | return nil, err |
| 186 | } |
| 187 | result, err := exprInternal(factory, comp.GetResult()) |
| 188 | if err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | return factory.NewComprehensionTwoVar(id, |
| 192 | iterRange, |
| 193 | comp.GetIterVar(), |
| 194 | comp.GetIterVar2(), |
| 195 | comp.GetAccuVar(), |
| 196 | accuInit, |
| 197 | loopCond, |
| 198 | loopStep, |
| 199 | result), nil |
| 200 | } |
| 201 | |
| 202 | func exprLiteral(factory ExprFactory, id int64, c *exprpb.Constant) (Expr, error) { |
| 203 | val, err := ConstantToVal(c) |
no test coverage detected