74f4572d6afa47a85b20d69c03c4b5818229508b 2.6 KB

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