625b7bfd93cbc6ff7a3c8224e64a4ed8505589c1 2.8 KB

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