799cb0db63d5d948ca4ce3e6a438e6d03a363b07 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. variable {
  8. binding {
  9. name: "call_count"
  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: "ReturnFalse"
  30. }
  31. param_pattern {
  32. }
  33. return_term {
  34. kind: Expression
  35. type {
  36. bool_type_literal {
  37. }
  38. }
  39. }
  40. body {
  41. statements {
  42. assign {
  43. lhs {
  44. identifier {
  45. name: "call_count"
  46. }
  47. }
  48. rhs {
  49. operator {
  50. op: Add
  51. arguments {
  52. identifier {
  53. name: "call_count"
  54. }
  55. }
  56. arguments {
  57. int_literal {
  58. value: 1
  59. }
  60. }
  61. }
  62. }
  63. op: Plain
  64. }
  65. }
  66. statements {
  67. return_expression_statement {
  68. expression {
  69. bool_literal {
  70. value: false
  71. }
  72. }
  73. }
  74. }
  75. }
  76. }
  77. }
  78. declarations {
  79. function {
  80. name {
  81. name: "Main"
  82. }
  83. param_pattern {
  84. }
  85. return_term {
  86. kind: Expression
  87. type {
  88. int_type_literal {
  89. }
  90. }
  91. }
  92. body {
  93. statements {
  94. variable_definition {
  95. pattern {
  96. binding_pattern {
  97. name: "result"
  98. type {
  99. expression_pattern {
  100. expression {
  101. bool_type_literal {
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }
  108. init {
  109. operator {
  110. op: And
  111. arguments {
  112. call {
  113. function {
  114. identifier {
  115. name: "ReturnFalse"
  116. }
  117. }
  118. argument {
  119. tuple_literal {
  120. }
  121. }
  122. }
  123. }
  124. arguments {
  125. call {
  126. function {
  127. identifier {
  128. name: "ReturnFalse"
  129. }
  130. }
  131. argument {
  132. tuple_literal {
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. is_returned: false
  140. }
  141. }
  142. statements {
  143. return_expression_statement {
  144. expression {
  145. if_expression {
  146. condition {
  147. operator {
  148. op: Not
  149. arguments {
  150. identifier {
  151. name: "result"
  152. }
  153. }
  154. }
  155. }
  156. then_expression {
  157. identifier {
  158. name: "call_count"
  159. }
  160. }
  161. else_expression {
  162. operator {
  163. op: Neg
  164. arguments {
  165. int_literal {
  166. value: 1
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }