Lartu / ldpl

COBOL-like programming language that compiles to C++. With serious dinosaurs with neckties and briefcases 🦕💼
https://www.ldpl-lang.org/
Apache License 2.0
161 stars 24 forks source link

No ELSE or ELSE IF after ELSE #76

Closed dgarroDC closed 5 years ago

dgarroDC commented 5 years ago

Now we check for things like this:

PROCEDURE:

if 0 is equal to 0 then
    display 0
else
    display 1
else
    display 2
else if 0 is equal to 0 then
    display 3
end if
Lartu commented 5 years ago

Hahaha great! Have you tested that this pr works fine for WHILEs and IFs and nested combinations of the two? As far as I see this could also be used to implement FOR loops, am I right?

Thank you very much! 😄

dgarroDC commented 5 years ago

Yes, that is working correctly. And yes, the block stack could be useful in a FOR implementation!

Lartu commented 5 years ago

Great! Merged! Thank you very much for your contribution!