fail_modifiers.carbon 1.6 KB

123456789101112131415161718192021222324252627282930313233
  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/namespace/fail_modifiers.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_modifiers.carbon
  10. virtual namespace B
  11. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: ERROR: `namespace` declarations must end with a `;`.
  12. // CHECK:STDERR: impl namespace
  13. // CHECK:STDERR: ^~~~
  14. // CHECK:STDERR:
  15. // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: ERROR: `namespace` introducer should be followed by a name.
  16. // CHECK:STDERR: impl namespace
  17. // CHECK:STDERR: ^~~~~~~~~
  18. impl namespace
  19. // CHECK:STDOUT: - filename: fail_modifiers.carbon
  20. // CHECK:STDOUT: parse_tree: [
  21. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  22. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  23. // CHECK:STDOUT: {kind: 'VirtualModifier', text: 'virtual'},
  24. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'B'},
  25. // CHECK:STDOUT: {kind: 'Namespace', text: 'impl', has_error: yes, subtree_size: 4},
  26. // CHECK:STDOUT: {kind: 'NamespaceStart', text: 'namespace'},
  27. // CHECK:STDOUT: {kind: 'InvalidParse', text: '', has_error: yes},
  28. // CHECK:STDOUT: {kind: 'Namespace', text: 'namespace', has_error: yes, subtree_size: 3},
  29. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  30. // CHECK:STDOUT: ]