b474e2aac0787cafe1ab33ed25b46bb23f885722 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. binding_pattern {
  41. name: "x"
  42. type {
  43. expression_pattern {
  44. expression {
  45. int_type_literal {
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }
  52. is_returned: false
  53. }
  54. }
  55. statements {
  56. if_statement {
  57. condition {
  58. operator {
  59. op: Eq
  60. arguments {
  61. call {
  62. function {
  63. identifier {
  64. name: "Foo"
  65. }
  66. }
  67. argument {
  68. tuple_literal {
  69. }
  70. }
  71. }
  72. }
  73. arguments {
  74. int_literal {
  75. value: 0
  76. }
  77. }
  78. }
  79. }
  80. then_block {
  81. statements {
  82. return_expression_statement {
  83. expression {
  84. int_literal {
  85. value: 0
  86. }
  87. }
  88. }
  89. }
  90. }
  91. else_block {
  92. statements {
  93. return_expression_statement {
  94. expression {
  95. identifier {
  96. name: "x"
  97. }
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. }
  106. }
  107. }