297403f9670145ba84245d3db2be10ea2ae9d0bf 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. expression_pattern {
  101. expression {
  102. int_type_literal {
  103. }
  104. }
  105. }
  106. }
  107. }
  108. target {
  109. identifier {
  110. name: "ar"
  111. }
  112. }
  113. body {
  114. statements {
  115. expression_statement {
  116. expression {
  117. call {
  118. function {
  119. identifier {
  120. name: "Print"
  121. }
  122. }
  123. argument {
  124. tuple_literal {
  125. fields {
  126. string_literal {
  127. value: "HALLO WELT {0}"
  128. }
  129. }
  130. fields {
  131. identifier {
  132. name: "x"
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. }
  141. statements {
  142. assign {
  143. lhs {
  144. identifier {
  145. name: "count"
  146. }
  147. }
  148. rhs {
  149. operator {
  150. op: Add
  151. arguments {
  152. identifier {
  153. name: "count"
  154. }
  155. }
  156. arguments {
  157. int_literal {
  158. value: 1
  159. }
  160. }
  161. }
  162. }
  163. op: Plain
  164. }
  165. }
  166. }
  167. }
  168. }
  169. statements {
  170. for_statement {
  171. var_decl {
  172. name: "x"
  173. type {
  174. expression_pattern {
  175. expression {
  176. int_type_literal {
  177. }
  178. }
  179. }
  180. }
  181. }
  182. target {
  183. identifier {
  184. name: "ar"
  185. }
  186. }
  187. body {
  188. statements {
  189. expression_statement {
  190. expression {
  191. call {
  192. function {
  193. identifier {
  194. name: "Print"
  195. }
  196. }
  197. argument {
  198. tuple_literal {
  199. fields {
  200. string_literal {
  201. value: "HALLO WELT {0}"
  202. }
  203. }
  204. fields {
  205. identifier {
  206. name: "x"
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. statements {
  216. assign {
  217. lhs {
  218. identifier {
  219. name: "count"
  220. }
  221. }
  222. rhs {
  223. operator {
  224. op: Add
  225. arguments {
  226. identifier {
  227. name: "count"
  228. }
  229. }
  230. arguments {
  231. int_literal {
  232. value: 1
  233. }
  234. }
  235. }
  236. }
  237. op: Plain
  238. }
  239. }
  240. }
  241. }
  242. }
  243. statements {
  244. return_expression_statement {
  245. expression {
  246. identifier {
  247. name: "count"
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }