Files
natalieee.net/www/src/data/thoughts/python-goto/limitations.py

50 lines
660 B
Python

from goto_label import *
gaurd = 0
#LABEL say_hi
print('hi')
#LABEL loop_start
gaurd += 1
if gaurd > 2: goto &call_b
def a():
global gaurd
goto &a_skip
#LABEL a_label
print('inside a_label')
goto &loop_start
if gaurd:
return
#LABEL a_skip
print('a')
if gaurd < 2:
goto &say_hi
goto &a_label
...
def b():
global gaurd
goto &b_skip
#LABEL b_label
print('inside b_label')
goto &say_hi
goto &a_label
if gaurd > 2:
return
#LABEL b_skip
print('b')
goto &a_label
a()
goto &b_label
...
a()
print('done with a()')
goto &say_hi
...
#LABEL call_b
b()