one_entry_with_comma.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. var z: {.n: i32,} = {.n = 4,};
  7. // CHECK:STDOUT: - filename: one_entry_with_comma.carbon
  8. // CHECK:STDOUT: parse_tree: [
  9. // CHECK:STDOUT: {kind: 'VariableIntroducer', text: 'var'},
  10. // CHECK:STDOUT: {kind: 'Name', text: 'z'},
  11. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  12. // CHECK:STDOUT: {kind: 'Name', text: 'n'},
  13. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  14. // CHECK:STDOUT: {kind: 'Literal', text: 'i32'},
  15. // CHECK:STDOUT: {kind: 'StructFieldType', text: ':', subtree_size: 4},
  16. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  17. // CHECK:STDOUT: {kind: 'StructTypeLiteral', text: '}', subtree_size: 7},
  18. // CHECK:STDOUT: {kind: 'PatternBinding', text: ':', subtree_size: 9},
  19. // CHECK:STDOUT: {kind: 'VariableInitializer', text: '='},
  20. // CHECK:STDOUT: {kind: 'StructLiteralOrStructTypeLiteralStart', text: '{'},
  21. // CHECK:STDOUT: {kind: 'Name', text: 'n'},
  22. // CHECK:STDOUT: {kind: 'StructFieldDesignator', text: '.', subtree_size: 2},
  23. // CHECK:STDOUT: {kind: 'Literal', text: '4'},
  24. // CHECK:STDOUT: {kind: 'StructFieldValue', text: '=', subtree_size: 4},
  25. // CHECK:STDOUT: {kind: 'StructComma', text: ','},
  26. // CHECK:STDOUT: {kind: 'StructLiteral', text: '}', subtree_size: 7},
  27. // CHECK:STDOUT: {kind: 'VariableDeclaration', text: ';', subtree_size: 19},
  28. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  29. // CHECK:STDOUT: ]