58c61db205983d75beda870ceebfa61a70fd300e 4.3 KB

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