mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 21:10:29 +00:00
Collapse Sequence into Block. (#927)
This commit is contained in:
1 parent
e69ec3f528
commit
904774fbb8
7 files changed
+60
-131
No files matched your search
@@ -51,18 +51,10 @@ static void ResolveControlFlow(
|
||||
}
|
||||
return;
|
||||
}
|
||||
case Statement::Kind::Sequence: {
|
||||
auto& seq = cast<Sequence>(*statement);
|
||||
ResolveControlFlow(&seq.statement(), function, loop);
|
||||
if (seq.next().has_value()) {
|
||||
ResolveControlFlow(*seq.next(), function, loop);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case Statement::Kind::Block: {
|
||||
auto& block = cast<Block>(*statement);
|
||||
if (block.sequence().has_value()) {
|
||||
ResolveControlFlow(*block.sequence(), function, loop);
|
||||
for (auto* block_statement : block.statements()) {
|
||||
ResolveControlFlow(block_statement, function, loop);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user