4fa346a44b96db2ad5cfe3c2ad505d893114843c 4.0 KB

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