75bf07b0ccfce55eb53f712ddb01b97724ec0fe8 2.3 KB

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