Python Forum
must the if statement in the following tutorial be nested? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: must the if statement in the following tutorial be nested? (/thread-1328.html)



must the if statement in the following tutorial be nested? - hsunteik - Dec-24-2016

in this tutorial series on creating a programming language:
https://www.youtube.com/watch?v=pWAxiKdJF0c  (the first episode in the video tutorial series)

he uses nested if statement,but can i use many if elif else statement instead.(especially the lexer)


RE: must the if statement in the following tutorial be nested? - Mekire - Dec-24-2016

If you could post the code in question here it would help a lot.


RE: must the if statement in the following tutorial be nested? - hsunteik - Dec-24-2016

Tomorrow or the day after tomorrow because I am not at home now and my computer is at home.


RE: must the if statement in the following tutorial be nested? - Yoriz - Dec-24-2016

At the point the elif checks tok to equal \ and then inside of that condition checks state to be 0 or 1
To not nest it could be replaced with two elif that check for tok and state at the same time.