match.gd 282 B

123456789101112131415161718
  1. func test():
  2. var i = "Hello"
  3. match i:
  4. "Hello":
  5. print("hello")
  6. # This will fall through to the default case below.
  7. continue
  8. "Good bye":
  9. print("bye")
  10. _:
  11. print("default")
  12. var j = 25
  13. match j:
  14. 26:
  15. print("This won't match")
  16. _:
  17. print("This will match")