semantics_handle_codeblock.cpp 797 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/semantics/semantics_context.h"
  5. #include "toolchain/semantics/semantics_node.h"
  6. namespace Carbon {
  7. auto SemanticsHandleCodeBlockStart(SemanticsContext& context,
  8. ParseTree::Node parse_node) -> bool {
  9. context.node_stack().Push(parse_node);
  10. context.PushScope();
  11. return true;
  12. }
  13. auto SemanticsHandleCodeBlock(SemanticsContext& context,
  14. ParseTree::Node /*parse_node*/) -> bool {
  15. context.PopScope();
  16. context.node_stack().PopForSoloParseNode(ParseNodeKind::CodeBlockStart);
  17. return true;
  18. }
  19. } // namespace Carbon