fail_identifier_in_statements.carbon 1.2 KB

123456789101112131415161718192021222324252627
  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. fn F() {
  7. // Note: this might become valid depending on the expression syntax. This test
  8. // shouldn't be taken as a sign it should remain invalid.
  9. bar
  10. // CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: ERROR: Expected `;` after expression statement.
  11. // CHECK:STDERR: }
  12. // CHECK:STDERR: ^
  13. }
  14. // CHECK:STDOUT: - filename: fail_identifier_in_statements.carbon
  15. // CHECK:STDOUT: parse_tree: [
  16. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  17. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  18. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'F'},
  19. // CHECK:STDOUT: {kind: 'ParamListStart', text: '('},
  20. // CHECK:STDOUT: {kind: 'ParamList', text: ')', subtree_size: 2},
  21. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
  22. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'bar'},
  23. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', has_error: yes, subtree_size: 7},
  24. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  25. // CHECK:STDOUT: ]