mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
The issue of whether/how to include `ref` tags in the textual and in-memory SemIR (see discussion [here](https://discord.com/channels/655572317891461132/655578254970716160/1431316355742961805)) is left as future work. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
46 lines
2.8 KiB
Plaintext
46 lines
2.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/basics/function_call.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/function_call.carbon
|
|
|
|
// NOTE: Move to its own directory when more tests are added.
|
|
fn F() {
|
|
a.b.f(c.d, (e)).g();
|
|
}
|
|
|
|
// CHECK:STDOUT: - filename: function_call.carbon
|
|
// CHECK:STDOUT: parse_tree: [
|
|
// CHECK:STDOUT: {kind: 'FileStart', text: ''},
|
|
// CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameBeforeParams', text: 'F'},
|
|
// CHECK:STDOUT: {kind: 'ExplicitParamListStart', text: '('},
|
|
// CHECK:STDOUT: {kind: 'ExplicitParamList', text: ')', subtree_size: 2},
|
|
// CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'a'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'b'},
|
|
// CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'f'},
|
|
// CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 5},
|
|
// CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 6},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'c'},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'd'},
|
|
// CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'TupleLiteralComma', text: ','},
|
|
// CHECK:STDOUT: {kind: 'ParenExprStart', text: '('},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'e'},
|
|
// CHECK:STDOUT: {kind: 'ParenExpr', text: ')', subtree_size: 3},
|
|
// CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 14},
|
|
// CHECK:STDOUT: {kind: 'IdentifierNameNotBeforeParams', text: 'g'},
|
|
// CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 16},
|
|
// CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 17},
|
|
// CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 18},
|
|
// CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 19},
|
|
// CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 25},
|
|
// CHECK:STDOUT: {kind: 'FileEnd', text: ''},
|
|
// CHECK:STDOUT: ]
|