handle.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef CARBON_TOOLCHAIN_CHECK_HANDLE_H_
  5. #define CARBON_TOOLCHAIN_CHECK_HANDLE_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/check/function.h"
  8. #include "toolchain/parse/node_ids.h"
  9. namespace Carbon::Check {
  10. // Parse node handlers. Returns false for unrecoverable errors.
  11. #define CARBON_PARSE_NODE_KIND(Name) \
  12. auto HandleParseNode(Context& context, Parse::Name##Id node_id) -> bool;
  13. #include "toolchain/parse/node_kind.def"
  14. // Handle suspending the definition of a function. This is used for inline
  15. // methods, which are processed out of the normal lexical order. This plus
  16. // HandleFunctionDefinitionResume carry out the same actions as
  17. // HandleFunctionDefinitionStart, except that the various context stacks are
  18. // cleared out in between.
  19. auto HandleFunctionDefinitionSuspend(Context& context,
  20. Parse::FunctionDefinitionStartId node_id)
  21. -> SuspendedFunction;
  22. // Handle resuming the definition of a function, after a previous suspension.
  23. auto HandleFunctionDefinitionResume(Context& context,
  24. Parse::FunctionDefinitionStartId node_id,
  25. SuspendedFunction suspended_fn) -> void;
  26. } // namespace Carbon::Check
  27. #endif // CARBON_TOOLCHAIN_CHECK_HANDLE_H_