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