9d40d743d76f2b406047513146ca9db3d2af7550 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. function {
  8. name {
  9. name: "AssignIntTo"
  10. }
  11. param_pattern {
  12. fields {
  13. binding_pattern {
  14. name: "x"
  15. type {
  16. expression_pattern {
  17. expression {
  18. int_type_literal {
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. fields {
  26. binding_pattern {
  27. name: "destination"
  28. type {
  29. expression_pattern {
  30. expression {
  31. operator {
  32. op: Ptr
  33. arguments {
  34. int_type_literal {
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. return_term {
  45. kind: Omitted
  46. }
  47. body {
  48. statements {
  49. assign {
  50. lhs {
  51. operator {
  52. op: Deref
  53. arguments {
  54. identifier {
  55. name: "destination"
  56. }
  57. }
  58. }
  59. }
  60. rhs {
  61. identifier {
  62. name: "x"
  63. }
  64. }
  65. op: Plain
  66. }
  67. }
  68. }
  69. }
  70. }
  71. declarations {
  72. function {
  73. name {
  74. name: "Main"
  75. }
  76. param_pattern {
  77. }
  78. return_term {
  79. kind: Expression
  80. type {
  81. int_type_literal {
  82. }
  83. }
  84. }
  85. body {
  86. statements {
  87. variable_definition {
  88. pattern {
  89. binding_pattern {
  90. name: "y"
  91. type {
  92. expression_pattern {
  93. expression {
  94. int_type_literal {
  95. }
  96. }
  97. }
  98. }
  99. }
  100. }
  101. is_returned: false
  102. }
  103. }
  104. statements {
  105. expression_statement {
  106. expression {
  107. call {
  108. function {
  109. identifier {
  110. name: "AssignIntTo"
  111. }
  112. }
  113. argument {
  114. tuple_literal {
  115. fields {
  116. int_literal {
  117. value: 42
  118. }
  119. }
  120. fields {
  121. operator {
  122. op: AddressOf
  123. arguments {
  124. identifier {
  125. name: "y"
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. }
  133. }
  134. }
  135. }
  136. statements {
  137. return_expression_statement {
  138. expression {
  139. identifier {
  140. name: "y"
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }