27ef47d1362933a6bff7e03fc14e5c5fcd23e2fa 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "f"
  10. }
  11. param_pattern {
  12. fields {
  13. binding_pattern {
  14. name: "x"
  15. type {
  16. expression_pattern {
  17. expression {
  18. int_type_literal {
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. fields {
  26. binding_pattern {
  27. name: "y"
  28. type {
  29. expression_pattern {
  30. expression {
  31. int_type_literal {
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. return_term {
  40. kind: Expression
  41. type {
  42. int_type_literal {
  43. }
  44. }
  45. }
  46. body {
  47. statements {
  48. return_expression_statement {
  49. expression {
  50. operator {
  51. op: Add
  52. arguments {
  53. identifier {
  54. name: "x"
  55. }
  56. }
  57. arguments {
  58. identifier {
  59. name: "y"
  60. }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. declarations {
  70. function {
  71. name {
  72. name: "Main"
  73. }
  74. param_pattern {
  75. }
  76. return_term {
  77. kind: Expression
  78. type {
  79. int_type_literal {
  80. }
  81. }
  82. }
  83. body {
  84. statements {
  85. variable_definition {
  86. pattern {
  87. binding_pattern {
  88. name: "xy"
  89. type {
  90. expression_pattern {
  91. expression {
  92. tuple_literal {
  93. fields {
  94. int_type_literal {
  95. }
  96. }
  97. fields {
  98. int_type_literal {
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. init {
  108. tuple_literal {
  109. fields {
  110. int_literal {
  111. value: 1
  112. }
  113. }
  114. fields {
  115. int_literal {
  116. value: 2
  117. }
  118. }
  119. }
  120. }
  121. is_returned: false
  122. }
  123. }
  124. statements {
  125. return_expression_statement {
  126. expression {
  127. call {
  128. function {
  129. identifier {
  130. name: "f"
  131. }
  132. }
  133. argument {
  134. tuple_literal {
  135. fields {
  136. identifier {
  137. name: "xy"
  138. }
  139. }
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }