4969109f00a31dd06730d3aa44cb87b5ccbb3587 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. class_declaration {
  8. name: "Point"
  9. members {
  10. variable {
  11. binding {
  12. name: "x"
  13. type {
  14. expression_pattern {
  15. expression {
  16. int_type_literal {
  17. }
  18. }
  19. }
  20. }
  21. }
  22. }
  23. }
  24. members {
  25. variable {
  26. binding {
  27. name: "y"
  28. type {
  29. expression_pattern {
  30. expression {
  31. int_type_literal {
  32. }
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
  41. declarations {
  42. function {
  43. name: "Main"
  44. param_pattern {
  45. }
  46. return_term {
  47. kind: Expression
  48. type {
  49. int_type_literal {
  50. }
  51. }
  52. }
  53. body {
  54. statements {
  55. variable_definition {
  56. pattern {
  57. binding_pattern {
  58. name: "p"
  59. type {
  60. expression_pattern {
  61. expression {
  62. identifier {
  63. name: "Point"
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. init {
  71. struct_literal {
  72. fields {
  73. name: "x"
  74. expression {
  75. int_literal {
  76. value: 1
  77. }
  78. }
  79. }
  80. fields {
  81. name: "z"
  82. expression {
  83. int_literal {
  84. value: 2
  85. }
  86. }
  87. }
  88. }
  89. }
  90. }
  91. }
  92. statements {
  93. return_statement {
  94. expression {
  95. primitive_operator {
  96. op: Sub
  97. arguments {
  98. simple_member_access {
  99. field: "x"
  100. object {
  101. identifier {
  102. name: "p"
  103. }
  104. }
  105. }
  106. }
  107. arguments {
  108. int_literal {
  109. value: 1
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. }