2917ec9747dbfa35f67d9d61bb71d5d4d0fb4385 10 KB

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