86538c458c4469fd4394a2cf09c5d38bf06dde01 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. class_declaration {
  8. name {
  9. name: "A"
  10. }
  11. members {
  12. variable {
  13. binding {
  14. name: "n"
  15. type {
  16. expression_pattern {
  17. expression {
  18. int_type_literal {
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
  28. declarations {
  29. impl {
  30. kind: InternalImpl
  31. impl_type {
  32. int_type_literal {
  33. }
  34. }
  35. interface {
  36. call {
  37. function {
  38. identifier {
  39. name: "ImplicitAs"
  40. }
  41. }
  42. argument {
  43. tuple_literal {
  44. fields {
  45. identifier {
  46. name: "A"
  47. }
  48. }
  49. }
  50. }
  51. }
  52. }
  53. members {
  54. function {
  55. name {
  56. name: "Convert"
  57. }
  58. self_pattern {
  59. binding_pattern {
  60. name: "self"
  61. type {
  62. expression_pattern {
  63. expression {
  64. identifier {
  65. name: "Self"
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. param_pattern {
  73. }
  74. return_term {
  75. kind: Expression
  76. type {
  77. identifier {
  78. name: "A"
  79. }
  80. }
  81. }
  82. body {
  83. statements {
  84. return_expression_statement {
  85. expression {
  86. struct_literal {
  87. fields {
  88. name: "n"
  89. expression {
  90. identifier {
  91. name: "self"
  92. }
  93. }
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. declarations {
  105. variable {
  106. binding {
  107. name: "a"
  108. type {
  109. expression_pattern {
  110. expression {
  111. identifier {
  112. name: "A"
  113. }
  114. }
  115. }
  116. }
  117. }
  118. initializer {
  119. int_literal {
  120. value: 5
  121. }
  122. }
  123. }
  124. }
  125. declarations {
  126. function {
  127. name {
  128. name: "Main"
  129. }
  130. param_pattern {
  131. }
  132. return_term {
  133. kind: Expression
  134. type {
  135. int_type_literal {
  136. }
  137. }
  138. }
  139. body {
  140. statements {
  141. return_expression_statement {
  142. expression {
  143. simple_member_access {
  144. field: "n"
  145. object {
  146. identifier {
  147. name: "a"
  148. }
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }