mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:14:43 +01:00
For loop for arrays (#1753)
Co-authored-by: m new <michael.burzan@outlook.de> Co-authored-by: Geoff Romer <gromer@google.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
m new
Geoff Romer
Richard Smith
parent
2c921efe36
commit
f754373786
@@ -521,6 +521,16 @@ static auto StatementToProto(const Statement& statement) -> Fuzzing::Statement {
|
||||
// Initializes with the default value; there's nothing to set.
|
||||
statement_proto.mutable_continue_statement();
|
||||
break;
|
||||
|
||||
case StatementKind::For: {
|
||||
const auto& for_stmt = cast<For>(statement);
|
||||
auto* for_proto = statement_proto.mutable_for_statement();
|
||||
*for_proto->mutable_var_decl() =
|
||||
BindingPatternToProto(for_stmt.variable_declaration());
|
||||
*for_proto->mutable_target() = ExpressionToProto(for_stmt.loop_target());
|
||||
*for_proto->mutable_body() = BlockStatementToProto(for_stmt.body());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return statement_proto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user