6219bbd6eb7e0d3fa7e8bc5fa554e2e2aff95733 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "Main"
  10. }
  11. param_pattern {
  12. }
  13. return_term {
  14. kind: Expression
  15. type {
  16. int_type_literal {
  17. }
  18. }
  19. }
  20. body {
  21. statements {
  22. variable_definition {
  23. pattern {
  24. binding_pattern {
  25. name: "x"
  26. type {
  27. auto_pattern {
  28. }
  29. }
  30. }
  31. }
  32. init {
  33. struct_literal {
  34. fields {
  35. name: "x"
  36. expression {
  37. int_literal {
  38. value: 10
  39. }
  40. }
  41. }
  42. fields {
  43. name: "y"
  44. expression {
  45. int_literal {
  46. value: 1
  47. }
  48. }
  49. }
  50. }
  51. }
  52. is_returned: false
  53. }
  54. }
  55. statements {
  56. variable_definition {
  57. pattern {
  58. binding_pattern {
  59. name: "p"
  60. type {
  61. expression_pattern {
  62. expression {
  63. operator {
  64. op: Ptr
  65. arguments {
  66. int_type_literal {
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. init {
  76. operator {
  77. op: AddressOf
  78. arguments {
  79. simple_member_access {
  80. field: "x"
  81. object {
  82. identifier {
  83. name: "x"
  84. }
  85. }
  86. }
  87. }
  88. }
  89. }
  90. is_returned: false
  91. }
  92. }
  93. statements {
  94. assign {
  95. lhs {
  96. operator {
  97. op: Deref
  98. arguments {
  99. identifier {
  100. name: "p"
  101. }
  102. }
  103. }
  104. }
  105. rhs {
  106. int_literal {
  107. value: 0
  108. }
  109. }
  110. op: Plain
  111. }
  112. }
  113. statements {
  114. return_expression_statement {
  115. expression {
  116. simple_member_access {
  117. field: "x"
  118. object {
  119. identifier {
  120. name: "x"
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }