fail_comma_repeat_in_value.carbon 1.5 KB

1234567891011121314151617181920212223242526272829
  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:STDOUT: [
  7. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  8. // CHECK:STDOUT: {kind: 'Name', text: 'x'},
  9. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  10. // CHECK:STDOUT: {kind: 'Name', text: 'a'},
  11. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  12. // CHECK:STDOUT: {kind: 'Literal', text: '0'},
  13. // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
  14. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  15. // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: ',', has_error: yes},
  16. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  17. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 9},
  18. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 11},
  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: 'VariableDeclaration', text: ';', subtree_size: 16},
  23. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  24. // CHECK:STDOUT: ]
  25. // CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: Expected `.field = value`.
  26. // CHECK:STDERR: var x: {.a = 0,,} = {};
  27. // CHECK:STDERR: ^
  28. var x: {.a = 0,,} = {};