mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 22:38:14 +00:00
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.
42 lines
2.0 KiB
Plaintext
42 lines
2.0 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/basic.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/where_assignment/basic.carbon
|
|
|
|
impl C as Z {
|
|
where Z1 = D.(Y.Y1);
|
|
where Z2 = Z1;
|
|
}
|
|
|
|
// CHECK:STDOUT: - filename: basic.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 'Z1'
|
|
// CHECK:STDOUT: │ │ ├─WhereAssignmentOperator '='
|
|
// CHECK:STDOUT: │ │ │ ╭─IdentifierNameExpr 'D'
|
|
// CHECK:STDOUT: │ │ │ │ ╭─ParenExprStart '('
|
|
// CHECK:STDOUT: │ │ │ │ │ ╭─IdentifierNameExpr 'Y'
|
|
// CHECK:STDOUT: │ │ │ │ │ ├─IdentifierNameNotBeforeSignature 'Y1'
|
|
// CHECK:STDOUT: │ │ │ │ ├─MemberAccessExpr '.'
|
|
// CHECK:STDOUT: │ │ │ ├─ParenExpr ')'
|
|
// CHECK:STDOUT: │ │ ├─MemberAccessExpr '.'
|
|
// CHECK:STDOUT: │ ├─WhereAssignmentDecl ';'
|
|
// CHECK:STDOUT: │ │ ╭─WhereAssignmentIntroducer 'where'
|
|
// CHECK:STDOUT: │ │ ├─IdentifierNameNotBeforeSignature 'Z2'
|
|
// CHECK:STDOUT: │ │ ├─WhereAssignmentOperator '='
|
|
// CHECK:STDOUT: │ │ ├─IdentifierNameExpr 'Z1'
|
|
// CHECK:STDOUT: │ ├─WhereAssignmentDecl ';'
|
|
// CHECK:STDOUT: ├─ImplDefinition '}'
|
|
// CHECK:STDOUT: ├─FileEnd ''
|
|
// CHECK:STDOUT: (root)
|