mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
I think there's more we can do here, but this seemed like a good checkpoint to make sure the path I'm going down is roughly what you expected. There's one actual edit in if expression structure to match the increased enforcement.
25 lines
799 B
C++
25 lines
799 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "toolchain/semantics/semantics_context.h"
|
|
#include "toolchain/semantics/semantics_node.h"
|
|
|
|
namespace Carbon {
|
|
|
|
auto SemanticsHandleCodeBlockStart(SemanticsContext& context,
|
|
ParseTree::Node parse_node) -> bool {
|
|
context.node_stack().Push(parse_node);
|
|
context.PushScope();
|
|
return true;
|
|
}
|
|
|
|
auto SemanticsHandleCodeBlock(SemanticsContext& context,
|
|
ParseTree::Node /*parse_node*/) -> bool {
|
|
context.PopScope();
|
|
context.node_stack().PopForSoloParseNode<ParseNodeKind::CodeBlockStart>();
|
|
return true;
|
|
}
|
|
|
|
} // namespace Carbon
|