handle_paren_expr.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/check/context.h"
  5. #include "toolchain/check/handle.h"
  6. namespace Carbon::Check {
  7. auto HandleParseNode(Context& /*context*/, Parse::ParenExprStartId /*node_id*/)
  8. -> bool {
  9. // The open paren is unused.
  10. return true;
  11. }
  12. auto HandleParseNode(Context& context, Parse::ParenExprId node_id) -> bool {
  13. // We re-push because the ParenExpr is valid for member expressions, whereas
  14. // the child expression might not be.
  15. context.node_stack().Push(node_id, context.node_stack().PopExpr());
  16. return true;
  17. }
  18. } // namespace Carbon::Check