4ee954ee8c71e3023e3855608bd6c60185453505 8.7 KB

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