fail_dot_string_equals.carbon 1.7 KB

12345678910111213141516171819202122232425262728293031
  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: '"hello"', has_error: yes},
  11. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  12. // CHECK:STDOUT: {kind: 'Literal', text: '0'},
  13. // CHECK:STDOUT: {kind: 'StructFieldUnknown', text: '=', has_error: yes},
  14. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  15. // CHECK:STDOUT: {kind: 'Name', text: 'y'},
  16. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  17. // CHECK:STDOUT: {kind: 'Literal', text: '4'},
  18. // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
  19. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 11},
  20. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 13},
  21. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  22. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  23. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 2},
  24. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 18},
  25. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  26. // CHECK:STDOUT: ]
  27. // CHECK:STDERR: fail_dot_string_equals.carbon:[[@LINE+3]]:10: Expected identifier after `.`.
  28. // CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {};
  29. // CHECK:STDERR: ^
  30. var x: {."hello" = 0, .y = 4} = {};