b273f6d89c4098dddc6a17fc2200950b2a1ca8b2 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. interface {
  8. name {
  9. name: "A"
  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: "G"
  31. }
  32. param_pattern {
  33. }
  34. return_term {
  35. kind: Expression
  36. type {
  37. int_type_literal {
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. declarations {
  46. interface {
  47. name {
  48. name: "B"
  49. }
  50. members {
  51. function {
  52. name {
  53. name: "H"
  54. }
  55. param_pattern {
  56. }
  57. return_term {
  58. kind: Expression
  59. type {
  60. int_type_literal {
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. declarations {
  69. function {
  70. name {
  71. name: "Get1"
  72. }
  73. deduced_parameters {
  74. name: "T"
  75. type {
  76. operator {
  77. op: BitwiseAnd
  78. arguments {
  79. identifier {
  80. name: "A"
  81. }
  82. }
  83. arguments {
  84. identifier {
  85. name: "B"
  86. }
  87. }
  88. }
  89. }
  90. }
  91. param_pattern {
  92. fields {
  93. binding_pattern {
  94. name: "n"
  95. type {
  96. expression_pattern {
  97. expression {
  98. identifier {
  99. name: "T"
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. return_term {
  108. kind: Expression
  109. type {
  110. int_type_literal {
  111. }
  112. }
  113. }
  114. body {
  115. statements {
  116. return_expression_statement {
  117. expression {
  118. operator {
  119. op: Add
  120. arguments {
  121. call {
  122. function {
  123. simple_member_access {
  124. field: "F"
  125. object {
  126. identifier {
  127. name: "n"
  128. }
  129. }
  130. }
  131. }
  132. argument {
  133. tuple_literal {
  134. }
  135. }
  136. }
  137. }
  138. arguments {
  139. call {
  140. function {
  141. simple_member_access {
  142. field: "H"
  143. object {
  144. identifier {
  145. name: "n"
  146. }
  147. }
  148. }
  149. }
  150. argument {
  151. tuple_literal {
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }
  162. }
  163. declarations {
  164. function {
  165. name {
  166. name: "Get2"
  167. }
  168. deduced_parameters {
  169. name: "T"
  170. type {
  171. operator {
  172. op: BitwiseAnd
  173. arguments {
  174. identifier {
  175. name: "B"
  176. }
  177. }
  178. arguments {
  179. identifier {
  180. name: "A"
  181. }
  182. }
  183. }
  184. }
  185. }
  186. param_pattern {
  187. fields {
  188. binding_pattern {
  189. name: "n"
  190. type {
  191. expression_pattern {
  192. expression {
  193. identifier {
  194. name: "T"
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. return_term {
  203. kind: Expression
  204. type {
  205. int_type_literal {
  206. }
  207. }
  208. }
  209. body {
  210. statements {
  211. return_expression_statement {
  212. expression {
  213. call {
  214. function {
  215. simple_member_access {
  216. field: "G"
  217. object {
  218. identifier {
  219. name: "n"
  220. }
  221. }
  222. }
  223. }
  224. argument {
  225. tuple_literal {
  226. }
  227. }
  228. }
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. declarations {
  236. function {
  237. name {
  238. name: "Get3"
  239. }
  240. deduced_parameters {
  241. name: "T"
  242. type {
  243. operator {
  244. op: BitwiseAnd
  245. arguments {
  246. operator {
  247. op: BitwiseAnd
  248. arguments {
  249. operator {
  250. op: BitwiseAnd
  251. arguments {
  252. operator {
  253. op: BitwiseAnd
  254. arguments {
  255. identifier {
  256. name: "B"
  257. }
  258. }
  259. arguments {
  260. identifier {
  261. name: "A"
  262. }
  263. }
  264. }
  265. }
  266. arguments {
  267. identifier {
  268. name: "A"
  269. }
  270. }
  271. }
  272. }
  273. arguments {
  274. identifier {
  275. name: "B"
  276. }
  277. }
  278. }
  279. }
  280. arguments {
  281. identifier {
  282. name: "A"
  283. }
  284. }
  285. }
  286. }
  287. }
  288. param_pattern {
  289. fields {
  290. binding_pattern {
  291. name: "n"
  292. type {
  293. expression_pattern {
  294. expression {
  295. identifier {
  296. name: "T"
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. }
  304. return_term {
  305. kind: Expression
  306. type {
  307. int_type_literal {
  308. }
  309. }
  310. }
  311. body {
  312. statements {
  313. return_expression_statement {
  314. expression {
  315. operator {
  316. op: Add
  317. arguments {
  318. call {
  319. function {
  320. simple_member_access {
  321. field: "G"
  322. object {
  323. identifier {
  324. name: "n"
  325. }
  326. }
  327. }
  328. }
  329. argument {
  330. tuple_literal {
  331. }
  332. }
  333. }
  334. }
  335. arguments {
  336. call {
  337. function {
  338. simple_member_access {
  339. field: "H"
  340. object {
  341. identifier {
  342. name: "n"
  343. }
  344. }
  345. }
  346. }
  347. argument {
  348. tuple_literal {
  349. }
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. }
  359. }
  360. declarations {
  361. impl {
  362. kind: InternalImpl
  363. impl_type {
  364. int_type_literal {
  365. }
  366. }
  367. interface {
  368. identifier {
  369. name: "A"
  370. }
  371. }
  372. members {
  373. function {
  374. name {
  375. name: "F"
  376. }
  377. param_pattern {
  378. }
  379. return_term {
  380. kind: Expression
  381. type {
  382. int_type_literal {
  383. }
  384. }
  385. }
  386. body {
  387. statements {
  388. return_expression_statement {
  389. expression {
  390. int_literal {
  391. value: 1
  392. }
  393. }
  394. }
  395. }
  396. }
  397. }
  398. }
  399. members {
  400. function {
  401. name {
  402. name: "G"
  403. }
  404. param_pattern {
  405. }
  406. return_term {
  407. kind: Expression
  408. type {
  409. int_type_literal {
  410. }
  411. }
  412. }
  413. body {
  414. statements {
  415. return_expression_statement {
  416. expression {
  417. int_literal {
  418. value: 2
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. }
  426. }
  427. }
  428. declarations {
  429. impl {
  430. kind: InternalImpl
  431. impl_type {
  432. int_type_literal {
  433. }
  434. }
  435. interface {
  436. identifier {
  437. name: "B"
  438. }
  439. }
  440. members {
  441. function {
  442. name {
  443. name: "H"
  444. }
  445. param_pattern {
  446. }
  447. return_term {
  448. kind: Expression
  449. type {
  450. int_type_literal {
  451. }
  452. }
  453. }
  454. body {
  455. statements {
  456. return_expression_statement {
  457. expression {
  458. int_literal {
  459. value: 4
  460. }
  461. }
  462. }
  463. }
  464. }
  465. }
  466. }
  467. }
  468. }
  469. declarations {
  470. function {
  471. name {
  472. name: "Main"
  473. }
  474. param_pattern {
  475. }
  476. return_term {
  477. kind: Expression
  478. type {
  479. int_type_literal {
  480. }
  481. }
  482. }
  483. body {
  484. statements {
  485. variable_definition {
  486. pattern {
  487. binding_pattern {
  488. name: "z"
  489. type {
  490. expression_pattern {
  491. expression {
  492. int_type_literal {
  493. }
  494. }
  495. }
  496. }
  497. }
  498. }
  499. init {
  500. int_literal {
  501. value: 0
  502. }
  503. }
  504. is_returned: false
  505. }
  506. }
  507. statements {
  508. return_expression_statement {
  509. expression {
  510. operator {
  511. op: Add
  512. arguments {
  513. operator {
  514. op: Add
  515. arguments {
  516. operator {
  517. op: Mul
  518. arguments {
  519. call {
  520. function {
  521. identifier {
  522. name: "Get1"
  523. }
  524. }
  525. argument {
  526. tuple_literal {
  527. fields {
  528. identifier {
  529. name: "z"
  530. }
  531. }
  532. }
  533. }
  534. }
  535. }
  536. arguments {
  537. int_literal {
  538. value: 100
  539. }
  540. }
  541. }
  542. }
  543. arguments {
  544. operator {
  545. op: Mul
  546. arguments {
  547. call {
  548. function {
  549. identifier {
  550. name: "Get2"
  551. }
  552. }
  553. argument {
  554. tuple_literal {
  555. fields {
  556. identifier {
  557. name: "z"
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564. arguments {
  565. int_literal {
  566. value: 10
  567. }
  568. }
  569. }
  570. }
  571. }
  572. }
  573. arguments {
  574. call {
  575. function {
  576. identifier {
  577. name: "Get3"
  578. }
  579. }
  580. argument {
  581. tuple_literal {
  582. fields {
  583. identifier {
  584. name: "z"
  585. }
  586. }
  587. }
  588. }
  589. }
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. }
  597. }
  598. }