nested.carbon 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // CHECK:STDOUT: [
  7. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  8. // CHECK:STDOUT: {kind: 'Name', text: 'Foo'},
  9. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 3},
  10. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  11. // CHECK:STDOUT: {kind: 'NameExpression', text: 'Foo'},
  12. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  13. // CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 3},
  14. // CHECK:STDOUT: {kind: 'Namespace', text: ';', subtree_size: 5},
  15. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  16. // CHECK:STDOUT: {kind: 'NameExpression', text: 'Foo'},
  17. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  18. // CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 3},
  19. // CHECK:STDOUT: {kind: 'Name', text: 'Baz'},
  20. // CHECK:STDOUT: {kind: 'QualifiedDeclaration', text: '.', subtree_size: 5},
  21. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  22. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
  23. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 9},
  24. // CHECK:STDOUT: {kind: 'NameExpression', text: 'Foo'},
  25. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  26. // CHECK:STDOUT: {kind: 'MemberAccessExpression', text: '.', subtree_size: 3},
  27. // CHECK:STDOUT: {kind: 'Name', text: 'Wiz'},
  28. // CHECK:STDOUT: {kind: 'MemberAccessExpression', text: '.', subtree_size: 5},
  29. // CHECK:STDOUT: {kind: 'CallExpressionStart', text: '(', subtree_size: 6},
  30. // CHECK:STDOUT: {kind: 'CallExpression', text: ')', subtree_size: 7},
  31. // CHECK:STDOUT: {kind: 'ExpressionStatement', text: ';', subtree_size: 8},
  32. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 18},
  33. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  34. // CHECK:STDOUT: ]
  35. namespace Foo;
  36. namespace Foo.Bar;
  37. fn Foo.Bar.Baz() {
  38. Foo.Bar.Wiz();
  39. }