semantics_handle_parameter_list.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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::Check {
  6. auto HandleDeducedParameterList(Context& context, Parse::Node parse_node)
  7. -> bool {
  8. return context.TODO(parse_node, "HandleDeducedParameterList");
  9. }
  10. auto HandleDeducedParameterListStart(Context& context, Parse::Node parse_node)
  11. -> bool {
  12. return context.TODO(parse_node, "HandleDeducedParameterListStart");
  13. }
  14. auto HandleParameterList(Context& context, Parse::Node parse_node) -> bool {
  15. auto refs_id = context.ParamOrArgEnd(
  16. /*for_args=*/false, Parse::NodeKind::ParameterListStart);
  17. context.PopScope();
  18. context.node_stack()
  19. .PopAndDiscardSoloParseNode<Parse::NodeKind::ParameterListStart>();
  20. context.node_stack().Push(parse_node, refs_id);
  21. return true;
  22. }
  23. auto HandleParameterListComma(Context& context, Parse::Node /*parse_node*/)
  24. -> bool {
  25. context.ParamOrArgComma(/*for_args=*/false);
  26. return true;
  27. }
  28. auto HandleParameterListStart(Context& context, Parse::Node parse_node)
  29. -> bool {
  30. context.PushScope();
  31. context.node_stack().Push(parse_node);
  32. context.ParamOrArgStart();
  33. return true;
  34. }
  35. } // namespace Carbon::Check