semi_before.carbon 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  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. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/parse/testdata/packages/import/semi_before.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/semi_before.carbon
  10. // We allow an empty declaration in the initial sequence of imports.
  11. ;
  12. import library "foo";
  13. ;
  14. import Bar;
  15. ;
  16. // CHECK:STDOUT: - filename: semi_before.carbon
  17. // CHECK:STDOUT: parse_tree: [
  18. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  19. // CHECK:STDOUT: {kind: 'EmptyDecl', text: ';'},
  20. // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'},
  21. // CHECK:STDOUT: {kind: 'LibraryName', text: '"foo"'},
  22. // CHECK:STDOUT: {kind: 'LibrarySpecifier', text: 'library', subtree_size: 2},
  23. // CHECK:STDOUT: {kind: 'ImportDecl', text: ';', subtree_size: 4},
  24. // CHECK:STDOUT: {kind: 'EmptyDecl', text: ';'},
  25. // CHECK:STDOUT: {kind: 'ImportIntroducer', text: 'import'},
  26. // CHECK:STDOUT: {kind: 'PackageName', text: 'Bar'},
  27. // CHECK:STDOUT: {kind: 'ImportDecl', text: ';', subtree_size: 3},
  28. // CHECK:STDOUT: {kind: 'EmptyDecl', text: ';'},
  29. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  30. // CHECK:STDOUT: ]