handle_codeblock.cpp 685 B

123456789101112131415161718192021222324
  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/check/context.h"
  5. namespace Carbon::Check {
  6. auto HandleCodeBlockStart(Context& context, Parse::CodeBlockStartId parse_node)
  7. -> bool {
  8. context.node_stack().Push(parse_node);
  9. context.PushScope();
  10. return true;
  11. }
  12. auto HandleCodeBlock(Context& context, Parse::CodeBlockId /*parse_node*/)
  13. -> bool {
  14. context.PopScope();
  15. context.node_stack()
  16. .PopAndDiscardSoloParseNode<Parse::NodeKind::CodeBlockStart>();
  17. return true;
  18. }
  19. } // namespace Carbon::Check