semantics_handle_codeblock.cpp 658 B

123456789101112131415161718192021
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/semantics/semantics_context.h"
  5. namespace Carbon::Check {
  6. auto HandleCodeBlockStart(Context& context, Parse::Node parse_node) -> bool {
  7. context.node_stack().Push(parse_node);
  8. context.PushScope();
  9. return true;
  10. }
  11. auto HandleCodeBlock(Context& context, Parse::Node /*parse_node*/) -> bool {
  12. context.PopScope();
  13. context.node_stack().PopForSoloParseNode<Parse::NodeKind::CodeBlockStart>();
  14. return true;
  15. }
  16. } // namespace Carbon::Check