Wopslang / Wops

Wops programming language
https://wops.dev/
Apache License 2.0
26 stars 3 forks source link

Critical errors on the connections between if family statements (if, elif, else) #43

Closed redocmath closed 2 years ago

redocmath commented 2 years ago

Needs to check the evident error.

redocmath commented 2 years ago

Checked error: there are critical errors on the connections between if family statements (if, elif, else)

Example case

for i in range(1, n+1, 1) { out(tostring(i)+": ") if (i % 15 == 0) { out("fizzbuzz") } else { if (i % 3 == 0) { out("fizz") } elif (i % 5 == 0) { out("buzz") } else { out("none") } } out("\n") }

- in

30

- output

1: none 2: none 3: fizz 4: none 5: buzz 6: fizz 7: none 8: none 9: fizz 10: buzz 11: none 12: fizz 13: none 14: none 15: fizzbuzz 16: none 17: none 18: fizz 19: none 20: buzz 21: fizz 22: none 23: none 24: fizz 25: buzz 26: none 27: fizz 28: none 29: none 30: fizzbuzz


- reported issue: the flow is strange
redocmath commented 2 years ago

Fixed. 🚀