Files
carbon-lang/toolchain/parse/testdata/where_assignment/nested.carbon
T
Dana Jansens d10a566aba Flatten the where assignment decl parse subtree (#8144)
Make the `WhereAssignmentOp` node a sibling of its LHS and RHS nodes, so
that we have an opportunity in check/ to perform actions between the LHS
and RHS. Previously it was a parent of the LHS and RHS, so the two sides
would be checked one immediately after the other without any
where-assignment-specific checking in between.
2026-11-16 17:29:04 +00:00

38 lines
1.8 KiB
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/where_assignment/nested.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/where_assignment/nested.carbon
impl C as Z {
where Z2 = (Y where .Y1 = Z1);
}
// CHECK:STDOUT: - filename: nested.carbon
// CHECK:STDOUT: ╭─FileStart ''
// CHECK:STDOUT: │ ╭─ImplIntroducer 'impl'
// CHECK:STDOUT: │ │ ╭─IdentifierNameExpr 'C'
// CHECK:STDOUT: │ ├─ImplTypeAs 'as'
// CHECK:STDOUT: │ ├─IdentifierNameExpr 'Z'
// CHECK:STDOUT: │ ╭─ImplDefinitionStart '{'
// CHECK:STDOUT: │ │ ╭─WhereAssignmentIntroducer 'where'
// CHECK:STDOUT: │ │ ├─IdentifierNameNotBeforeSignature 'Z2'
// CHECK:STDOUT: │ │ ├─WhereAssignmentOperator '='
// CHECK:STDOUT: │ │ │ ╭─ParenExprStart '('
// CHECK:STDOUT: │ │ │ │ ╭─IdentifierNameExpr 'Y'
// CHECK:STDOUT: │ │ │ │ ╭─WhereOperand 'where'
// CHECK:STDOUT: │ │ │ │ │ ╭─IdentifierNameNotBeforeSignature 'Y1'
// CHECK:STDOUT: │ │ │ │ │ ╭─DesignatorExpr '.'
// CHECK:STDOUT: │ │ │ │ │ ├─IdentifierNameExpr 'Z1'
// CHECK:STDOUT: │ │ │ │ ├─RequirementEqual '='
// CHECK:STDOUT: │ │ │ ├─WhereExpr 'where'
// CHECK:STDOUT: │ │ ├─ParenExpr ')'
// CHECK:STDOUT: │ ├─WhereAssignmentDecl ';'
// CHECK:STDOUT: ├─ImplDefinition '}'
// CHECK:STDOUT: ├─FileEnd ''
// CHECK:STDOUT: (root)