6506dca4030d6950129d63f064289299d3caaf39 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "I"
  10. }
  11. members {
  12. function {
  13. name {
  14. name: "F"
  15. }
  16. param_pattern {
  17. }
  18. return_term {
  19. kind: Expression
  20. type {
  21. int_type_literal {
  22. }
  23. }
  24. }
  25. }
  26. }
  27. members {
  28. function {
  29. name {
  30. name: "M"
  31. }
  32. self_pattern {
  33. binding_pattern {
  34. name: "self"
  35. type {
  36. expression_pattern {
  37. expression {
  38. identifier {
  39. name: "Self"
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. param_pattern {
  47. }
  48. return_term {
  49. kind: Expression
  50. type {
  51. int_type_literal {
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. declarations {
  60. class_declaration {
  61. name {
  62. name: "A"
  63. }
  64. members {
  65. variable {
  66. binding {
  67. name: "n"
  68. type {
  69. expression_pattern {
  70. expression {
  71. int_type_literal {
  72. }
  73. }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. members {
  80. impl {
  81. kind: InternalImpl
  82. impl_type {
  83. identifier {
  84. name: "Self"
  85. }
  86. }
  87. interface {
  88. identifier {
  89. name: "I"
  90. }
  91. }
  92. members {
  93. function {
  94. name {
  95. name: "F"
  96. }
  97. param_pattern {
  98. }
  99. return_term {
  100. kind: Expression
  101. type {
  102. int_type_literal {
  103. }
  104. }
  105. }
  106. body {
  107. statements {
  108. return_expression_statement {
  109. expression {
  110. int_literal {
  111. value: 1
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. members {
  120. function {
  121. name {
  122. name: "M"
  123. }
  124. self_pattern {
  125. binding_pattern {
  126. name: "self"
  127. type {
  128. expression_pattern {
  129. expression {
  130. identifier {
  131. name: "Self"
  132. }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. param_pattern {
  139. }
  140. return_term {
  141. kind: Expression
  142. type {
  143. int_type_literal {
  144. }
  145. }
  146. }
  147. body {
  148. statements {
  149. return_expression_statement {
  150. expression {
  151. int_literal {
  152. value: 2
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }
  162. members {
  163. function {
  164. name {
  165. name: "G"
  166. }
  167. self_pattern {
  168. binding_pattern {
  169. name: "self"
  170. type {
  171. expression_pattern {
  172. expression {
  173. identifier {
  174. name: "Self"
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. param_pattern {
  182. }
  183. return_term {
  184. kind: Expression
  185. type {
  186. int_type_literal {
  187. }
  188. }
  189. }
  190. body {
  191. statements {
  192. return_expression_statement {
  193. expression {
  194. int_literal {
  195. value: 3
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. declarations {
  206. impl {
  207. kind: InternalImpl
  208. impl_type {
  209. int_type_literal {
  210. }
  211. }
  212. interface {
  213. identifier {
  214. name: "I"
  215. }
  216. }
  217. members {
  218. function {
  219. name {
  220. name: "F"
  221. }
  222. param_pattern {
  223. }
  224. return_term {
  225. kind: Expression
  226. type {
  227. int_type_literal {
  228. }
  229. }
  230. }
  231. body {
  232. statements {
  233. return_expression_statement {
  234. expression {
  235. int_literal {
  236. value: 4
  237. }
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. members {
  245. function {
  246. name {
  247. name: "M"
  248. }
  249. self_pattern {
  250. binding_pattern {
  251. name: "self"
  252. type {
  253. expression_pattern {
  254. expression {
  255. identifier {
  256. name: "Self"
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. param_pattern {
  264. }
  265. return_term {
  266. kind: Expression
  267. type {
  268. int_type_literal {
  269. }
  270. }
  271. }
  272. body {
  273. statements {
  274. return_expression_statement {
  275. expression {
  276. int_literal {
  277. value: 5
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. }
  286. }
  287. declarations {
  288. alias {
  289. name {
  290. name: "IF"
  291. }
  292. target {
  293. simple_member_access {
  294. field: "F"
  295. object {
  296. identifier {
  297. name: "I"
  298. }
  299. }
  300. }
  301. }
  302. }
  303. }
  304. declarations {
  305. alias {
  306. name {
  307. name: "IM"
  308. }
  309. target {
  310. simple_member_access {
  311. field: "M"
  312. object {
  313. identifier {
  314. name: "I"
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. declarations {
  322. alias {
  323. name {
  324. name: "AIF"
  325. }
  326. target {
  327. compound_member_access {
  328. object {
  329. identifier {
  330. name: "A"
  331. }
  332. }
  333. path {
  334. identifier {
  335. name: "IF"
  336. }
  337. }
  338. }
  339. }
  340. }
  341. }
  342. declarations {
  343. alias {
  344. name {
  345. name: "AIM"
  346. }
  347. target {
  348. compound_member_access {
  349. object {
  350. identifier {
  351. name: "A"
  352. }
  353. }
  354. path {
  355. identifier {
  356. name: "IM"
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. declarations {
  364. alias {
  365. name {
  366. name: "AG"
  367. }
  368. target {
  369. simple_member_access {
  370. field: "G"
  371. object {
  372. identifier {
  373. name: "A"
  374. }
  375. }
  376. }
  377. }
  378. }
  379. }
  380. declarations {
  381. alias {
  382. name {
  383. name: "i32IF"
  384. }
  385. target {
  386. compound_member_access {
  387. object {
  388. int_type_literal {
  389. }
  390. }
  391. path {
  392. identifier {
  393. name: "IF"
  394. }
  395. }
  396. }
  397. }
  398. }
  399. }
  400. declarations {
  401. alias {
  402. name {
  403. name: "i32IM"
  404. }
  405. target {
  406. compound_member_access {
  407. object {
  408. int_type_literal {
  409. }
  410. }
  411. path {
  412. identifier {
  413. name: "IM"
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. declarations {
  421. function {
  422. name {
  423. name: "Main"
  424. }
  425. param_pattern {
  426. }
  427. return_term {
  428. kind: Expression
  429. type {
  430. int_type_literal {
  431. }
  432. }
  433. }
  434. body {
  435. statements {
  436. variable_definition {
  437. pattern {
  438. binding_pattern {
  439. name: "a"
  440. type {
  441. expression_pattern {
  442. expression {
  443. identifier {
  444. name: "A"
  445. }
  446. }
  447. }
  448. }
  449. }
  450. }
  451. init {
  452. struct_literal {
  453. fields {
  454. name: "n"
  455. expression {
  456. int_literal {
  457. value: 0
  458. }
  459. }
  460. }
  461. }
  462. }
  463. is_returned: false
  464. }
  465. }
  466. statements {
  467. if_statement {
  468. condition {
  469. operator {
  470. op: NotEq
  471. arguments {
  472. call {
  473. function {
  474. compound_member_access {
  475. object {
  476. identifier {
  477. name: "A"
  478. }
  479. }
  480. path {
  481. identifier {
  482. name: "IF"
  483. }
  484. }
  485. }
  486. }
  487. argument {
  488. tuple_literal {
  489. }
  490. }
  491. }
  492. }
  493. arguments {
  494. int_literal {
  495. value: 1
  496. }
  497. }
  498. }
  499. }
  500. then_block {
  501. statements {
  502. return_expression_statement {
  503. expression {
  504. int_literal {
  505. value: 1
  506. }
  507. }
  508. }
  509. }
  510. }
  511. }
  512. }
  513. statements {
  514. if_statement {
  515. condition {
  516. operator {
  517. op: NotEq
  518. arguments {
  519. call {
  520. function {
  521. compound_member_access {
  522. object {
  523. identifier {
  524. name: "a"
  525. }
  526. }
  527. path {
  528. identifier {
  529. name: "IF"
  530. }
  531. }
  532. }
  533. }
  534. argument {
  535. tuple_literal {
  536. }
  537. }
  538. }
  539. }
  540. arguments {
  541. int_literal {
  542. value: 1
  543. }
  544. }
  545. }
  546. }
  547. then_block {
  548. statements {
  549. return_expression_statement {
  550. expression {
  551. int_literal {
  552. value: 2
  553. }
  554. }
  555. }
  556. }
  557. }
  558. }
  559. }
  560. statements {
  561. if_statement {
  562. condition {
  563. operator {
  564. op: NotEq
  565. arguments {
  566. call {
  567. function {
  568. compound_member_access {
  569. object {
  570. identifier {
  571. name: "a"
  572. }
  573. }
  574. path {
  575. identifier {
  576. name: "IM"
  577. }
  578. }
  579. }
  580. }
  581. argument {
  582. tuple_literal {
  583. }
  584. }
  585. }
  586. }
  587. arguments {
  588. int_literal {
  589. value: 2
  590. }
  591. }
  592. }
  593. }
  594. then_block {
  595. statements {
  596. return_expression_statement {
  597. expression {
  598. int_literal {
  599. value: 3
  600. }
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. statements {
  608. if_statement {
  609. condition {
  610. operator {
  611. op: NotEq
  612. arguments {
  613. call {
  614. function {
  615. compound_member_access {
  616. object {
  617. identifier {
  618. name: "a"
  619. }
  620. }
  621. path {
  622. compound_member_access {
  623. object {
  624. identifier {
  625. name: "A"
  626. }
  627. }
  628. path {
  629. identifier {
  630. name: "IM"
  631. }
  632. }
  633. }
  634. }
  635. }
  636. }
  637. argument {
  638. tuple_literal {
  639. }
  640. }
  641. }
  642. }
  643. arguments {
  644. int_literal {
  645. value: 2
  646. }
  647. }
  648. }
  649. }
  650. then_block {
  651. statements {
  652. return_expression_statement {
  653. expression {
  654. int_literal {
  655. value: 4
  656. }
  657. }
  658. }
  659. }
  660. }
  661. }
  662. }
  663. statements {
  664. if_statement {
  665. condition {
  666. operator {
  667. op: NotEq
  668. arguments {
  669. call {
  670. function {
  671. identifier {
  672. name: "AIF"
  673. }
  674. }
  675. argument {
  676. tuple_literal {
  677. }
  678. }
  679. }
  680. }
  681. arguments {
  682. int_literal {
  683. value: 1
  684. }
  685. }
  686. }
  687. }
  688. then_block {
  689. statements {
  690. return_expression_statement {
  691. expression {
  692. int_literal {
  693. value: 5
  694. }
  695. }
  696. }
  697. }
  698. }
  699. }
  700. }
  701. statements {
  702. if_statement {
  703. condition {
  704. operator {
  705. op: NotEq
  706. arguments {
  707. call {
  708. function {
  709. compound_member_access {
  710. object {
  711. identifier {
  712. name: "a"
  713. }
  714. }
  715. path {
  716. identifier {
  717. name: "AIM"
  718. }
  719. }
  720. }
  721. }
  722. argument {
  723. tuple_literal {
  724. }
  725. }
  726. }
  727. }
  728. arguments {
  729. int_literal {
  730. value: 2
  731. }
  732. }
  733. }
  734. }
  735. then_block {
  736. statements {
  737. return_expression_statement {
  738. expression {
  739. int_literal {
  740. value: 6
  741. }
  742. }
  743. }
  744. }
  745. }
  746. }
  747. }
  748. statements {
  749. if_statement {
  750. condition {
  751. operator {
  752. op: NotEq
  753. arguments {
  754. call {
  755. function {
  756. compound_member_access {
  757. object {
  758. identifier {
  759. name: "a"
  760. }
  761. }
  762. path {
  763. identifier {
  764. name: "AG"
  765. }
  766. }
  767. }
  768. }
  769. argument {
  770. tuple_literal {
  771. }
  772. }
  773. }
  774. }
  775. arguments {
  776. int_literal {
  777. value: 3
  778. }
  779. }
  780. }
  781. }
  782. then_block {
  783. statements {
  784. return_expression_statement {
  785. expression {
  786. int_literal {
  787. value: 7
  788. }
  789. }
  790. }
  791. }
  792. }
  793. }
  794. }
  795. statements {
  796. if_statement {
  797. condition {
  798. operator {
  799. op: NotEq
  800. arguments {
  801. call {
  802. function {
  803. compound_member_access {
  804. object {
  805. int_type_literal {
  806. }
  807. }
  808. path {
  809. identifier {
  810. name: "IF"
  811. }
  812. }
  813. }
  814. }
  815. argument {
  816. tuple_literal {
  817. }
  818. }
  819. }
  820. }
  821. arguments {
  822. int_literal {
  823. value: 4
  824. }
  825. }
  826. }
  827. }
  828. then_block {
  829. statements {
  830. return_expression_statement {
  831. expression {
  832. int_literal {
  833. value: 8
  834. }
  835. }
  836. }
  837. }
  838. }
  839. }
  840. }
  841. statements {
  842. if_statement {
  843. condition {
  844. operator {
  845. op: NotEq
  846. arguments {
  847. call {
  848. function {
  849. compound_member_access {
  850. object {
  851. int_literal {
  852. value: 0
  853. }
  854. }
  855. path {
  856. identifier {
  857. name: "IF"
  858. }
  859. }
  860. }
  861. }
  862. argument {
  863. tuple_literal {
  864. }
  865. }
  866. }
  867. }
  868. arguments {
  869. int_literal {
  870. value: 4
  871. }
  872. }
  873. }
  874. }
  875. then_block {
  876. statements {
  877. return_expression_statement {
  878. expression {
  879. int_literal {
  880. value: 9
  881. }
  882. }
  883. }
  884. }
  885. }
  886. }
  887. }
  888. statements {
  889. if_statement {
  890. condition {
  891. operator {
  892. op: NotEq
  893. arguments {
  894. call {
  895. function {
  896. compound_member_access {
  897. object {
  898. int_literal {
  899. value: 0
  900. }
  901. }
  902. path {
  903. identifier {
  904. name: "IM"
  905. }
  906. }
  907. }
  908. }
  909. argument {
  910. tuple_literal {
  911. }
  912. }
  913. }
  914. }
  915. arguments {
  916. int_literal {
  917. value: 5
  918. }
  919. }
  920. }
  921. }
  922. then_block {
  923. statements {
  924. return_expression_statement {
  925. expression {
  926. int_literal {
  927. value: 10
  928. }
  929. }
  930. }
  931. }
  932. }
  933. }
  934. }
  935. statements {
  936. if_statement {
  937. condition {
  938. operator {
  939. op: NotEq
  940. arguments {
  941. call {
  942. function {
  943. compound_member_access {
  944. object {
  945. int_literal {
  946. value: 0
  947. }
  948. }
  949. path {
  950. compound_member_access {
  951. object {
  952. int_type_literal {
  953. }
  954. }
  955. path {
  956. identifier {
  957. name: "IM"
  958. }
  959. }
  960. }
  961. }
  962. }
  963. }
  964. argument {
  965. tuple_literal {
  966. }
  967. }
  968. }
  969. }
  970. arguments {
  971. int_literal {
  972. value: 5
  973. }
  974. }
  975. }
  976. }
  977. then_block {
  978. statements {
  979. return_expression_statement {
  980. expression {
  981. int_literal {
  982. value: 11
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. }
  990. statements {
  991. if_statement {
  992. condition {
  993. operator {
  994. op: NotEq
  995. arguments {
  996. call {
  997. function {
  998. identifier {
  999. name: "i32IF"
  1000. }
  1001. }
  1002. argument {
  1003. tuple_literal {
  1004. }
  1005. }
  1006. }
  1007. }
  1008. arguments {
  1009. int_literal {
  1010. value: 4
  1011. }
  1012. }
  1013. }
  1014. }
  1015. then_block {
  1016. statements {
  1017. return_expression_statement {
  1018. expression {
  1019. int_literal {
  1020. value: 12
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. }
  1027. }
  1028. statements {
  1029. if_statement {
  1030. condition {
  1031. operator {
  1032. op: NotEq
  1033. arguments {
  1034. call {
  1035. function {
  1036. compound_member_access {
  1037. object {
  1038. int_literal {
  1039. value: 0
  1040. }
  1041. }
  1042. path {
  1043. identifier {
  1044. name: "i32IM"
  1045. }
  1046. }
  1047. }
  1048. }
  1049. argument {
  1050. tuple_literal {
  1051. }
  1052. }
  1053. }
  1054. }
  1055. arguments {
  1056. int_literal {
  1057. value: 5
  1058. }
  1059. }
  1060. }
  1061. }
  1062. then_block {
  1063. statements {
  1064. return_expression_statement {
  1065. expression {
  1066. int_literal {
  1067. value: 13
  1068. }
  1069. }
  1070. }
  1071. }
  1072. }
  1073. }
  1074. }
  1075. statements {
  1076. return_expression_statement {
  1077. expression {
  1078. int_literal {
  1079. value: 0
  1080. }
  1081. }
  1082. }
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }