eb9859dd8a2ab2a66b93655aeb5f01090a55978d 3.6 KB

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