8f560dc1a60532489b6c400e1efcb7d6a8941388 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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_impl {
  51. impl_type {
  52. identifier {
  53. name: "Self"
  54. }
  55. }
  56. constraint {
  57. call {
  58. function {
  59. identifier {
  60. name: "Apple"
  61. }
  62. }
  63. argument {
  64. tuple_literal {
  65. fields {
  66. int_type_literal {
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. members {
  76. function {
  77. name {
  78. name: "G"
  79. }
  80. self_pattern {
  81. binding_pattern {
  82. name: "self"
  83. type {
  84. expression_pattern {
  85. expression {
  86. identifier {
  87. name: "Self"
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
  94. param_pattern {
  95. }
  96. return_term {
  97. kind: Omitted
  98. }
  99. }
  100. }
  101. }
  102. }
  103. declarations {
  104. class_declaration {
  105. name {
  106. name: "Carrot"
  107. }
  108. members {
  109. variable {
  110. binding {
  111. name: "n"
  112. type {
  113. expression_pattern {
  114. expression {
  115. int_type_literal {
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. }
  125. declarations {
  126. impl {
  127. kind: ExternalImpl
  128. impl_type {
  129. identifier {
  130. name: "Carrot"
  131. }
  132. }
  133. interface {
  134. call {
  135. function {
  136. identifier {
  137. name: "Apple"
  138. }
  139. }
  140. argument {
  141. tuple_literal {
  142. fields {
  143. int_type_literal {
  144. }
  145. }
  146. }
  147. }
  148. }
  149. }
  150. members {
  151. function {
  152. name {
  153. name: "F"
  154. }
  155. self_pattern {
  156. binding_pattern {
  157. name: "self"
  158. type {
  159. expression_pattern {
  160. expression {
  161. identifier {
  162. name: "Self"
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. param_pattern {
  170. }
  171. return_term {
  172. kind: Expression
  173. type {
  174. int_type_literal {
  175. }
  176. }
  177. }
  178. body {
  179. statements {
  180. return_expression_statement {
  181. expression {
  182. simple_member_access {
  183. field: "n"
  184. object {
  185. identifier {
  186. name: "self"
  187. }
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }
  198. declarations {
  199. impl {
  200. kind: ExternalImpl
  201. impl_type {
  202. identifier {
  203. name: "Carrot"
  204. }
  205. }
  206. interface {
  207. identifier {
  208. name: "Banana"
  209. }
  210. }
  211. members {
  212. function {
  213. name {
  214. name: "G"
  215. }
  216. self_pattern {
  217. binding_pattern {
  218. name: "self"
  219. type {
  220. expression_pattern {
  221. expression {
  222. identifier {
  223. name: "Self"
  224. }
  225. }
  226. }
  227. }
  228. }
  229. }
  230. param_pattern {
  231. }
  232. return_term {
  233. kind: Omitted
  234. }
  235. body {
  236. statements {
  237. expression_statement {
  238. expression {
  239. call {
  240. function {
  241. identifier {
  242. name: "Print"
  243. }
  244. }
  245. argument {
  246. tuple_literal {
  247. fields {
  248. string_literal {
  249. value: "Carrot.G"
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. declarations {
  264. function {
  265. name {
  266. name: "H"
  267. }
  268. deduced_parameters {
  269. name: "T"
  270. type {
  271. identifier {
  272. name: "Banana"
  273. }
  274. }
  275. }
  276. param_pattern {
  277. fields {
  278. binding_pattern {
  279. name: "x"
  280. type {
  281. expression_pattern {
  282. expression {
  283. identifier {
  284. name: "T"
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. }
  292. return_term {
  293. kind: Expression
  294. type {
  295. int_type_literal {
  296. }
  297. }
  298. }
  299. body {
  300. statements {
  301. expression_statement {
  302. expression {
  303. call {
  304. function {
  305. simple_member_access {
  306. field: "G"
  307. object {
  308. identifier {
  309. name: "x"
  310. }
  311. }
  312. }
  313. }
  314. argument {
  315. tuple_literal {
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. statements {
  323. return_expression_statement {
  324. expression {
  325. call {
  326. function {
  327. compound_member_access {
  328. object {
  329. identifier {
  330. name: "x"
  331. }
  332. }
  333. path {
  334. simple_member_access {
  335. field: "F"
  336. object {
  337. call {
  338. function {
  339. identifier {
  340. name: "Apple"
  341. }
  342. }
  343. argument {
  344. tuple_literal {
  345. fields {
  346. int_type_literal {
  347. }
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. argument {
  358. tuple_literal {
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. declarations {
  369. function {
  370. name {
  371. name: "Main"
  372. }
  373. param_pattern {
  374. }
  375. return_term {
  376. kind: Expression
  377. type {
  378. int_type_literal {
  379. }
  380. }
  381. }
  382. body {
  383. statements {
  384. variable_definition {
  385. pattern {
  386. binding_pattern {
  387. name: "c"
  388. type {
  389. expression_pattern {
  390. expression {
  391. identifier {
  392. name: "Carrot"
  393. }
  394. }
  395. }
  396. }
  397. }
  398. }
  399. init {
  400. struct_literal {
  401. fields {
  402. name: "n"
  403. expression {
  404. int_literal {
  405. value: 5
  406. }
  407. }
  408. }
  409. }
  410. }
  411. is_returned: false
  412. }
  413. }
  414. statements {
  415. return_expression_statement {
  416. expression {
  417. call {
  418. function {
  419. identifier {
  420. name: "H"
  421. }
  422. }
  423. argument {
  424. tuple_literal {
  425. fields {
  426. identifier {
  427. name: "c"
  428. }
  429. }
  430. }
  431. }
  432. }
  433. }
  434. }
  435. }
  436. }
  437. }
  438. }
  439. }