return.ion 813 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. fn ex
  2. let a = 1
  3. if true
  4. if true
  5. if true
  6. while true
  7. return $a
  8. echo should not be printed
  9. end
  10. echo should not be printed
  11. end
  12. echo should not be printed
  13. end
  14. echo should not be printed
  15. end
  16. echo should not be printed
  17. end
  18. fn test_for
  19. while true
  20. return
  21. echo should not be printed
  22. end
  23. echo should not be printed
  24. end
  25. fn ex_wrapper
  26. if ex
  27. echo should not be printed
  28. else
  29. echo should be printed
  30. end
  31. if test_for
  32. echo should be printed
  33. else
  34. echo should not be printed
  35. end
  36. end
  37. ex_wrapper
  38. echo should$(if true; return; else printf ' not'; end) be printed
  39. echo should be printed