8b3b56d79337df581f59f424f87fa05b9d3b9b9f 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. choice {
  8. name {
  9. name: "A"
  10. }
  11. alternatives {
  12. name: "Value"
  13. signature {
  14. fields {
  15. int_type_literal {
  16. }
  17. }
  18. }
  19. }
  20. }
  21. }
  22. declarations {
  23. impl {
  24. kind: InternalImpl
  25. impl_type {
  26. int_type_literal {
  27. }
  28. }
  29. interface {
  30. call {
  31. function {
  32. identifier {
  33. name: "ImplicitAs"
  34. }
  35. }
  36. argument {
  37. tuple_literal {
  38. fields {
  39. identifier {
  40. name: "A"
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. members {
  48. function {
  49. name {
  50. name: "Convert"
  51. }
  52. self_pattern {
  53. binding_pattern {
  54. name: "self"
  55. type {
  56. expression_pattern {
  57. expression {
  58. identifier {
  59. name: "Self"
  60. }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. param_pattern {
  67. }
  68. return_term {
  69. kind: Expression
  70. type {
  71. identifier {
  72. name: "A"
  73. }
  74. }
  75. }
  76. body {
  77. statements {
  78. return_expression_statement {
  79. expression {
  80. call {
  81. function {
  82. simple_member_access {
  83. field: "Value"
  84. object {
  85. identifier {
  86. name: "A"
  87. }
  88. }
  89. }
  90. }
  91. argument {
  92. tuple_literal {
  93. fields {
  94. operator {
  95. op: Add
  96. arguments {
  97. identifier {
  98. name: "self"
  99. }
  100. }
  101. arguments {
  102. int_literal {
  103. value: 1
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. declarations {
  120. function {
  121. name {
  122. name: "Main"
  123. }
  124. param_pattern {
  125. }
  126. return_term {
  127. kind: Expression
  128. type {
  129. int_type_literal {
  130. }
  131. }
  132. }
  133. body {
  134. statements {
  135. variable_definition {
  136. pattern {
  137. alternative_pattern {
  138. choice_type {
  139. identifier {
  140. name: "A"
  141. }
  142. }
  143. alternative_name: "Value"
  144. arguments {
  145. fields {
  146. binding_pattern {
  147. name: "n"
  148. type {
  149. expression_pattern {
  150. expression {
  151. int_type_literal {
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. init {
  162. int_literal {
  163. value: 2
  164. }
  165. }
  166. is_returned: false
  167. }
  168. }
  169. statements {
  170. return_expression_statement {
  171. expression {
  172. identifier {
  173. name: "n"
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. }