a3050fa0d18aecf519f74d21c344a5727f80c10a 2.8 KB

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