40838f5f1f5c09fadb8c3d2cf2fd228ba1e4cc52 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. expression_pattern {
  28. expression {
  29. array_type_literal {
  30. element_type {
  31. int_type_literal {
  32. }
  33. }
  34. size {
  35. int_literal {
  36. value: 2
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. init {
  46. tuple_literal {
  47. fields {
  48. int_literal {
  49. value: 0
  50. }
  51. }
  52. fields {
  53. int_literal {
  54. value: 1
  55. }
  56. }
  57. }
  58. }
  59. is_returned: false
  60. }
  61. }
  62. statements {
  63. variable_definition {
  64. pattern {
  65. binding_pattern {
  66. name: "index"
  67. type {
  68. expression_pattern {
  69. expression {
  70. int_type_literal {
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. init {
  78. int_literal {
  79. value: 1
  80. }
  81. }
  82. is_returned: false
  83. }
  84. }
  85. statements {
  86. assign {
  87. lhs {
  88. index {
  89. object {
  90. identifier {
  91. name: "x"
  92. }
  93. }
  94. offset {
  95. identifier {
  96. name: "index"
  97. }
  98. }
  99. }
  100. }
  101. rhs {
  102. int_literal {
  103. value: 0
  104. }
  105. }
  106. op: Plain
  107. }
  108. }
  109. statements {
  110. return_expression_statement {
  111. expression {
  112. operator {
  113. op: Add
  114. arguments {
  115. index {
  116. object {
  117. identifier {
  118. name: "x"
  119. }
  120. }
  121. offset {
  122. int_literal {
  123. value: 0
  124. }
  125. }
  126. }
  127. }
  128. arguments {
  129. index {
  130. object {
  131. identifier {
  132. name: "x"
  133. }
  134. }
  135. offset {
  136. int_literal {
  137. value: 1
  138. }
  139. }
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }