13dcb5a00f09e0ec0a7fd03fb720bdad03c495f1 2.7 KB

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