a63969e9231d175a9a38e210ddd976ddd91320a0 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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: "ar"
  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: 4
  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. fields {
  58. int_literal {
  59. value: 2
  60. }
  61. }
  62. fields {
  63. int_literal {
  64. value: 3
  65. }
  66. }
  67. }
  68. }
  69. is_returned: false
  70. }
  71. }
  72. statements {
  73. variable_definition {
  74. pattern {
  75. binding_pattern {
  76. name: "count"
  77. type {
  78. expression_pattern {
  79. expression {
  80. int_type_literal {
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }
  87. init {
  88. int_literal {
  89. value: 0
  90. }
  91. }
  92. is_returned: false
  93. }
  94. }
  95. statements {
  96. for_statement {
  97. var_decl {
  98. name: "x"
  99. type {
  100. auto_pattern {
  101. }
  102. }
  103. }
  104. target {
  105. identifier {
  106. name: "ar"
  107. }
  108. }
  109. body {
  110. statements {
  111. expression_statement {
  112. expression {
  113. call {
  114. function {
  115. identifier {
  116. name: "Print"
  117. }
  118. }
  119. argument {
  120. tuple_literal {
  121. fields {
  122. string_literal {
  123. value: "HALLO WELT {0}"
  124. }
  125. }
  126. fields {
  127. identifier {
  128. name: "x"
  129. }
  130. }
  131. }
  132. }
  133. }
  134. }
  135. }
  136. }
  137. statements {
  138. assign {
  139. lhs {
  140. identifier {
  141. name: "count"
  142. }
  143. }
  144. rhs {
  145. operator {
  146. op: Add
  147. arguments {
  148. identifier {
  149. name: "count"
  150. }
  151. }
  152. arguments {
  153. int_literal {
  154. value: 1
  155. }
  156. }
  157. }
  158. }
  159. op: Plain
  160. }
  161. }
  162. }
  163. }
  164. }
  165. statements {
  166. return_expression_statement {
  167. expression {
  168. identifier {
  169. name: "count"
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }