handle_paren_expr.cpp 742 B

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