fail_identifier_colon.carbon 1.3 KB

1234567891011121314151617181920212223242526
  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:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
  7. // CHECK:STDERR: var x: {a:} = {};
  8. // CHECK:STDERR: ^
  9. var x: {a:} = {};
  10. // CHECK:STDOUT: - filename: fail_identifier_colon.carbon
  11. // CHECK:STDOUT: parse_tree: [
  12. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  13. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  14. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'x'},
  15. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  16. // CHECK:STDOUT: {kind: 'InvalidParse', text: 'a', has_error: yes},
  17. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
  18. // CHECK:STDOUT: {kind: 'BindingPattern', text: ':', subtree_size: 5},
  19. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  20. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  21. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
  22. // CHECK:STDOUT: {kind: 'VariableDecl', text: ';', subtree_size: 10},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]