Fold creates a fold comprehension instruction. - iterVar is the iteration variable name. - iterRange represents the expression that resolves to a list or map where the elements or keys (respectively) will be iterated over. - accuVar is the accumulation variable name, typically parser.AccumulatorNam
(iterVar string, iterRange *exprpb.Expr, accuVar string, accuInit *exprpb.Expr, condition *exprpb.Expr, step *exprpb.Expr, result *exprpb.Expr)
| 467 | // environment in the step and condition expressions. Presently, the name __result__ is commonly |
| 468 | // used by built-in macros but this may change in the future. |
| 469 | func (ah *adaptingHelper) Fold(iterVar string, |
| 470 | iterRange *exprpb.Expr, |
| 471 | accuVar string, |
| 472 | accuInit *exprpb.Expr, |
| 473 | condition *exprpb.Expr, |
| 474 | step *exprpb.Expr, |
| 475 | result *exprpb.Expr) *exprpb.Expr { |
| 476 | return mustAdaptToProto( |
| 477 | ah.modernHelper.NewComprehension( |
| 478 | mustAdaptToExpr(iterRange), |
| 479 | iterVar, |
| 480 | accuVar, |
| 481 | mustAdaptToExpr(accuInit), |
| 482 | mustAdaptToExpr(condition), |
| 483 | mustAdaptToExpr(step), |
| 484 | mustAdaptToExpr(result), |
| 485 | ), |
| 486 | ) |
| 487 | } |
| 488 | |
| 489 | // Ident creates an identifier Expr value. |
| 490 | func (ah *adaptingHelper) Ident(name string) *exprpb.Expr { |
nothing calls this directly
no test coverage detected