semantics_handle_codeblock.cpp 668 B

12345678910111213141516171819202122
  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, ParseTree::Node parse_node)
  7. -> bool {
  8. context.node_stack().Push(parse_node);
  9. context.PushScope();
  10. return true;
  11. }
  12. auto HandleCodeBlock(Context& context, ParseTree::Node /*parse_node*/) -> bool {
  13. context.PopScope();
  14. context.node_stack().PopForSoloParseNode<ParseNodeKind::CodeBlockStart>();
  15. return true;
  16. }
  17. } // namespace Carbon::Check