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