a6cbb1c4cbbae44391bce60832b7f9b034f3839e 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "Apple"
  10. }
  11. members {
  12. function {
  13. name {
  14. name: "F"
  15. }
  16. self_pattern {
  17. binding_pattern {
  18. name: "self"
  19. type {
  20. expression_pattern {
  21. expression {
  22. identifier {
  23. name: "Self"
  24. }
  25. }
  26. }
  27. }
  28. }
  29. }
  30. param_pattern {
  31. }
  32. return_term {
  33. kind: Expression
  34. type {
  35. identifier {
  36. name: "T"
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. declarations {
  45. interface {
  46. name {
  47. name: "Banana"
  48. }
  49. members {
  50. interface_extends {
  51. base {
  52. call {
  53. function {
  54. identifier {
  55. name: "Apple"
  56. }
  57. }
  58. argument {
  59. tuple_literal {
  60. fields {
  61. int_type_literal {
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. members {
  71. function {
  72. name {
  73. name: "G"
  74. }
  75. self_pattern {
  76. binding_pattern {
  77. name: "self"
  78. type {
  79. expression_pattern {
  80. expression {
  81. identifier {
  82. name: "Self"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }
  89. param_pattern {
  90. }
  91. return_term {
  92. kind: Omitted
  93. }
  94. }
  95. }
  96. }
  97. }
  98. declarations {
  99. class_declaration {
  100. name {
  101. name: "Carrot"
  102. }
  103. members {
  104. variable {
  105. binding {
  106. name: "n"
  107. type {
  108. expression_pattern {
  109. expression {
  110. int_type_literal {
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. }
  120. declarations {
  121. impl {
  122. kind: ExternalImpl
  123. impl_type {
  124. identifier {
  125. name: "Carrot"
  126. }
  127. }
  128. interface {
  129. identifier {
  130. name: "Banana"
  131. }
  132. }
  133. members {
  134. function {
  135. name {
  136. name: "F"
  137. }
  138. self_pattern {
  139. binding_pattern {
  140. name: "self"
  141. type {
  142. expression_pattern {
  143. expression {
  144. identifier {
  145. name: "Self"
  146. }
  147. }
  148. }
  149. }
  150. }
  151. }
  152. param_pattern {
  153. }
  154. return_term {
  155. kind: Expression
  156. type {
  157. int_type_literal {
  158. }
  159. }
  160. }
  161. body {
  162. statements {
  163. return_expression_statement {
  164. expression {
  165. simple_member_access {
  166. field: "n"
  167. object {
  168. identifier {
  169. name: "self"
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. members {
  180. function {
  181. name {
  182. name: "G"
  183. }
  184. self_pattern {
  185. binding_pattern {
  186. name: "self"
  187. type {
  188. expression_pattern {
  189. expression {
  190. identifier {
  191. name: "Self"
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. param_pattern {
  199. }
  200. return_term {
  201. kind: Omitted
  202. }
  203. body {
  204. statements {
  205. expression_statement {
  206. expression {
  207. call {
  208. function {
  209. identifier {
  210. name: "Print"
  211. }
  212. }
  213. argument {
  214. tuple_literal {
  215. fields {
  216. string_literal {
  217. value: "Carrot.G"
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. }
  231. declarations {
  232. function {
  233. name {
  234. name: "Main"
  235. }
  236. param_pattern {
  237. }
  238. return_term {
  239. kind: Expression
  240. type {
  241. int_type_literal {
  242. }
  243. }
  244. }
  245. body {
  246. statements {
  247. variable_definition {
  248. pattern {
  249. binding_pattern {
  250. name: "c"
  251. type {
  252. expression_pattern {
  253. expression {
  254. identifier {
  255. name: "Carrot"
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. init {
  263. struct_literal {
  264. fields {
  265. name: "n"
  266. expression {
  267. int_literal {
  268. value: 5
  269. }
  270. }
  271. }
  272. }
  273. }
  274. is_returned: false
  275. }
  276. }
  277. statements {
  278. expression_statement {
  279. expression {
  280. call {
  281. function {
  282. compound_member_access {
  283. object {
  284. identifier {
  285. name: "c"
  286. }
  287. }
  288. path {
  289. simple_member_access {
  290. field: "G"
  291. object {
  292. identifier {
  293. name: "Banana"
  294. }
  295. }
  296. }
  297. }
  298. }
  299. }
  300. argument {
  301. tuple_literal {
  302. }
  303. }
  304. }
  305. }
  306. }
  307. }
  308. statements {
  309. return_expression_statement {
  310. expression {
  311. call {
  312. function {
  313. compound_member_access {
  314. object {
  315. identifier {
  316. name: "c"
  317. }
  318. }
  319. path {
  320. simple_member_access {
  321. field: "F"
  322. object {
  323. call {
  324. function {
  325. identifier {
  326. name: "Apple"
  327. }
  328. }
  329. argument {
  330. tuple_literal {
  331. fields {
  332. int_type_literal {
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. }
  341. }
  342. }
  343. argument {
  344. tuple_literal {
  345. }
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. }