two_entries.carbon 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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: 'i32'},
  13. // CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
  14. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  15. // CHECK:STDOUT: {kind: 'Name', text: 'b'},
  16. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  17. // CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
  18. // CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
  19. // CHECK:STDOUT: {kind: 'StructTypeLiteral', 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: 'Name', text: 'a'},
  24. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  25. // CHECK:STDOUT: {kind: 'Literal', text: '1'},
  26. // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
  27. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  28. // CHECK:STDOUT: {kind: 'Name', text: 'b'},
  29. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  30. // CHECK:STDOUT: {kind: 'Literal', text: '2'},
  31. // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
  32. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 11},
  33. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 27},
  34. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  35. // CHECK:STDOUT: ]
  36. var x: {.a: i32, .b: i32} = {.a = 1, .b = 2};