63857ff19609e08af0207d8b1dab6e4de65dbbde 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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: "x"
  26. type {
  27. expression_pattern {
  28. expression {
  29. int_type_literal {
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. is_returned: false
  37. }
  38. }
  39. statements {
  40. variable_definition {
  41. pattern {
  42. binding_pattern {
  43. name: "y"
  44. type {
  45. expression_pattern {
  46. expression {
  47. int_type_literal {
  48. }
  49. }
  50. }
  51. }
  52. }
  53. }
  54. is_returned: false
  55. }
  56. }
  57. statements {
  58. if_statement {
  59. condition {
  60. operator {
  61. op: Eq
  62. arguments {
  63. int_literal {
  64. value: 0
  65. }
  66. }
  67. arguments {
  68. int_literal {
  69. value: 1
  70. }
  71. }
  72. }
  73. }
  74. then_block {
  75. statements {
  76. assign {
  77. lhs {
  78. identifier {
  79. name: "x"
  80. }
  81. }
  82. rhs {
  83. int_literal {
  84. value: 0
  85. }
  86. }
  87. op: Plain
  88. }
  89. }
  90. }
  91. }
  92. }
  93. statements {
  94. assign {
  95. lhs {
  96. identifier {
  97. name: "y"
  98. }
  99. }
  100. rhs {
  101. identifier {
  102. name: "x"
  103. }
  104. }
  105. op: Plain
  106. }
  107. }
  108. statements {
  109. return_expression_statement {
  110. expression {
  111. identifier {
  112. name: "y"
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. }
  120. }