basic.carbon 1.3 KB

1234567891011121314151617181920212223242526272829
  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: 'FunctionIntroducer', text: 'fn'},
  11. // CHECK:STDOUT: {kind: 'Name', text: 'Bar'},
  12. // CHECK:STDOUT: {kind: 'ParameterListStart', text: '('},
  13. // CHECK:STDOUT: {kind: 'ParameterList', text: ')', subtree_size: 2},
  14. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
  15. // CHECK:STDOUT: {kind: 'NameExpression', text: 'Foo'},
  16. // CHECK:STDOUT: {kind: 'Name', text: 'Baz'},
  17. // CHECK:STDOUT: {kind: 'MemberAccessExpression', text: '.', subtree_size: 3},
  18. // CHECK:STDOUT: {kind: 'CallExpressionStart', text: '(', subtree_size: 4},
  19. // CHECK:STDOUT: {kind: 'CallExpression', text: ')', subtree_size: 5},
  20. // CHECK:STDOUT: {kind: 'ExpressionStatement', text: ';', subtree_size: 6},
  21. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 12},
  22. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  23. // CHECK:STDOUT: ]
  24. namespace Foo;
  25. fn Bar() {
  26. Foo.Baz();
  27. }