basic.carbon 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. fn F() {
  7. if (a) {
  8. if (b) {
  9. if (c) {
  10. d;
  11. }
  12. }
  13. }
  14. }
  15. // CHECK:STDOUT: - filename: basic.carbon
  16. // CHECK:STDOUT: parse_tree: [
  17. // CHECK:STDOUT: {kind: 'FileStart', text: ''},
  18. // CHECK:STDOUT: {kind: 'FunctionIntroducer', text: 'fn'},
  19. // CHECK:STDOUT: {kind: 'IdentifierName', text: 'F'},
  20. // CHECK:STDOUT: {kind: 'ParamListStart', text: '('},
  21. // CHECK:STDOUT: {kind: 'ParamList', text: ')', subtree_size: 2},
  22. // CHECK:STDOUT: {kind: 'FunctionDefinitionStart', text: '{', subtree_size: 5},
  23. // CHECK:STDOUT: {kind: 'IfConditionStart', text: '('},
  24. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'a'},
  25. // CHECK:STDOUT: {kind: 'IfCondition', text: ')', subtree_size: 3},
  26. // CHECK:STDOUT: {kind: 'CodeBlockStart', text: '{'},
  27. // CHECK:STDOUT: {kind: 'IfConditionStart', text: '('},
  28. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'b'},
  29. // CHECK:STDOUT: {kind: 'IfCondition', text: ')', subtree_size: 3},
  30. // CHECK:STDOUT: {kind: 'CodeBlockStart', text: '{'},
  31. // CHECK:STDOUT: {kind: 'IfConditionStart', text: '('},
  32. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'c'},
  33. // CHECK:STDOUT: {kind: 'IfCondition', text: ')', subtree_size: 3},
  34. // CHECK:STDOUT: {kind: 'CodeBlockStart', text: '{'},
  35. // CHECK:STDOUT: {kind: 'IdentifierNameExpr', text: 'd'},
  36. // CHECK:STDOUT: {kind: 'ExprStatement', text: ';', subtree_size: 2},
  37. // CHECK:STDOUT: {kind: 'CodeBlock', text: '}', subtree_size: 4},
  38. // CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 8},
  39. // CHECK:STDOUT: {kind: 'CodeBlock', text: '}', subtree_size: 10},
  40. // CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 14},
  41. // CHECK:STDOUT: {kind: 'CodeBlock', text: '}', subtree_size: 16},
  42. // CHECK:STDOUT: {kind: 'IfStatement', text: 'if', subtree_size: 20},
  43. // CHECK:STDOUT: {kind: 'FunctionDefinition', text: '}', subtree_size: 26},
  44. // CHECK:STDOUT: {kind: 'FileEnd', text: ''},
  45. // CHECK:STDOUT: ]