26db64985a757f7b85a8dec0687537da313e3ab9 8.6 KB

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