nested.carbon 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. //
  5. // AUTOUPDATE
  6. namespace Foo;
  7. namespace Foo.Bar;
  8. fn Foo.Bar.Baz() {
  9. Foo.Bar.Wiz();
  10. }
  11. // CHECK:STDOUT: - filename: nested.carbon
  12. // CHECK:STDOUT: parse_tree: [
  13. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  14. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  15. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  16. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 3},
  17. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  18. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  19. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  20. // CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 3},
  21. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 5},
  22. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  23. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  24. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  25. // CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 3},
  26. // CHECK:STDOUT: {kind: 'Name', text: 'Baz'},
  27. // CHECK:STDOUT: {kind: 'QualifiedDecl', text: '.', subtree_size: 5},
  28. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  29. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
  30. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 9},
  31. // CHECK:STDOUT: {kind: 'NameExpr', text: 'Foo'},
  32. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  33. // CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 3},
  34. // CHECK:STDOUT: {kind: 'Name', text: 'Wiz'},
  35. // CHECK:STDOUT: {kind: 'MemberAccessExpr', text: '.', subtree_size: 5},
  36. // CHECK:STDOUT: {kind: 'CallExprStart', text: '(', subtree_size: 6},
  37. // CHECK:STDOUT: {kind: 'CallExpr', text: ')', subtree_size: 7},
  38. // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 8},
  39. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18},
  40. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  41. // CHECK:STDOUT: ]