5a006fff8e99d72fc86aa8545e73e10c13603f6c 2.6 KB

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