d59a7e060c3b84f4c824a1eb73e6e8251e4d85e5 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. if_statement {
  41. condition {
  42. operator {
  43. op: Eq
  44. arguments {
  45. int_literal {
  46. value: 0
  47. }
  48. }
  49. arguments {
  50. int_literal {
  51. value: 1
  52. }
  53. }
  54. }
  55. }
  56. then_block {
  57. statements {
  58. assign {
  59. lhs {
  60. identifier {
  61. name: "x"
  62. }
  63. }
  64. rhs {
  65. int_literal {
  66. value: 0
  67. }
  68. }
  69. op: Plain
  70. }
  71. }
  72. }
  73. }
  74. }
  75. statements {
  76. return_expression_statement {
  77. expression {
  78. identifier {
  79. name: "x"
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }