dce8888e7cd22ca49874c3a06980ae13c0db0a56 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. }
  84. }
  85. }
  86. statements {
  87. return_expression_statement {
  88. expression {
  89. identifier {
  90. name: "x"
  91. }
  92. }
  93. }
  94. }
  95. }
  96. }
  97. }
  98. }