7e3b1ea1f2b40cfe7dd4ce72a43cd8b5e00637f0 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "test"
  10. }
  11. param_pattern {
  12. fields {
  13. binding_pattern {
  14. name: "para"
  15. type {
  16. expression_pattern {
  17. expression {
  18. int_type_literal {
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. return_term {
  27. kind: Expression
  28. type {
  29. bool_type_literal {
  30. }
  31. }
  32. }
  33. body {
  34. statements {
  35. return_expression_statement {
  36. expression {
  37. bool_literal {
  38. value: true
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. declarations {
  47. function {
  48. name {
  49. name: "Main"
  50. }
  51. param_pattern {
  52. }
  53. return_term {
  54. kind: Expression
  55. type {
  56. int_type_literal {
  57. }
  58. }
  59. }
  60. body {
  61. statements {
  62. variable_definition {
  63. pattern {
  64. binding_pattern {
  65. name: "i"
  66. type {
  67. expression_pattern {
  68. expression {
  69. int_type_literal {
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }
  76. init {
  77. call {
  78. function {
  79. identifier {
  80. name: "Rand"
  81. }
  82. }
  83. argument {
  84. tuple_literal {
  85. fields {
  86. int_literal {
  87. value: 0
  88. }
  89. }
  90. fields {
  91. int_literal {
  92. value: 100
  93. }
  94. }
  95. }
  96. }
  97. }
  98. }
  99. is_returned: false
  100. }
  101. }
  102. statements {
  103. variable_definition {
  104. pattern {
  105. binding_pattern {
  106. name: "j"
  107. type {
  108. expression_pattern {
  109. expression {
  110. int_type_literal {
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. init {
  118. call {
  119. function {
  120. identifier {
  121. name: "Rand"
  122. }
  123. }
  124. argument {
  125. tuple_literal {
  126. fields {
  127. int_literal {
  128. value: 0
  129. }
  130. }
  131. fields {
  132. int_literal {
  133. value: 100
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. is_returned: false
  141. }
  142. }
  143. statements {
  144. if_statement {
  145. condition {
  146. operator {
  147. op: Eq
  148. arguments {
  149. identifier {
  150. name: "i"
  151. }
  152. }
  153. arguments {
  154. identifier {
  155. name: "j"
  156. }
  157. }
  158. }
  159. }
  160. then_block {
  161. statements {
  162. expression_statement {
  163. expression {
  164. call {
  165. function {
  166. identifier {
  167. name: "Print"
  168. }
  169. }
  170. argument {
  171. tuple_literal {
  172. fields {
  173. string_literal {
  174. value: "HALLO WELT"
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. else_block {
  185. statements {
  186. expression_statement {
  187. expression {
  188. call {
  189. function {
  190. identifier {
  191. name: "Print"
  192. }
  193. }
  194. argument {
  195. tuple_literal {
  196. fields {
  197. string_literal {
  198. value: "Nice!"
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. statements {
  211. return_expression_statement {
  212. expression {
  213. int_literal {
  214. value: 0
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. }