ae84a74278fbcaf0a9526002d80d7d688071f830 3.0 KB

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