▲ | jcul 7 months ago | |
It's just using the python match statement. https://docs.python.org/3/tutorial/controlflow.html#match-st... It's like switch in C / C++. And then it's just looking for the strings "while" or "end". It's the same as if he had written:
Then depending on the statement, in the while, if it evaluates to true, it scans forward to find end and continues the program from there.
If the statement is true it evaluates the lines one by one, until hitting end and then scans back to the start of the while to evaluate it again.The `pc` variable is the line number that is currently being evaluated. |