mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Goal is to increase type safety, though more work needs to be done (see added TODOs). Note that, after this change, check handlers corresponding to deleted parse node kinds will no longer compile. --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
25 lines
685 B
C++
25 lines
685 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/check/context.h"
|
|
|
|
namespace Carbon::Check {
|
|
|
|
auto HandleCodeBlockStart(Context& context, Parse::CodeBlockStartId parse_node)
|
|
-> bool {
|
|
context.node_stack().Push(parse_node);
|
|
context.PushScope();
|
|
return true;
|
|
}
|
|
|
|
auto HandleCodeBlock(Context& context, Parse::CodeBlockId /*parse_node*/)
|
|
-> bool {
|
|
context.PopScope();
|
|
context.node_stack()
|
|
.PopAndDiscardSoloParseNode<Parse::NodeKind::CodeBlockStart>();
|
|
return true;
|
|
}
|
|
|
|
} // namespace Carbon::Check
|