handle_codeblock.cpp 731 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. #include "toolchain/check/handle.h"
  6. namespace Carbon::Check {
  7. auto HandleParseNode(Context& context, Parse::CodeBlockStartId node_id)
  8. -> bool {
  9. context.node_stack().Push(node_id);
  10. context.scope_stack().PushForSameRegion();
  11. return true;
  12. }
  13. auto HandleParseNode(Context& context, Parse::CodeBlockId /*node_id*/) -> bool {
  14. context.scope_stack().Pop();
  15. context.node_stack()
  16. .PopAndDiscardSoloNodeId<Parse::NodeKind::CodeBlockStart>();
  17. return true;
  18. }
  19. } // namespace Carbon::Check