fail_identifier_colon.carbon 1.2 KB

12345678910111213141516171819202122
  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. // RUN: %{not} %{carbon-run-parser}
  7. // CHECK:STDOUT: [
  8. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  9. // CHECK:STDOUT: {kind: 'DeclaredName', text: 'x'},
  10. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  11. // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: 'a', has_error: yes},
  12. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 3},
  13. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 5},
  14. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  15. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  16. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
  17. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 10},
  18. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  19. // CHECK:STDOUT: ]
  20. // CHECK:STDERR: {{.*}}/toolchain/parser/testdata/struct/fail_identifier_colon.carbon:[[@LINE+1]]:9: Expected `.field: field_type` or `.field = value`.
  21. var x: {a:} = {};