693eab692d17bea44af514d53bc2373d40ab0927 3.4 KB

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