semantics_handle_codeblock.cpp 751 B

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