blueloveTH 2 лет назад
Родитель
Сommit
ffbb9af45e
2 измененных файлов с 16 добавлено и 1 удалено
  1. 4 0
      docs/features/goto.md
  2. 12 1
      tests/27_goto.py

+ 4 - 0
docs/features/goto.md

@@ -5,6 +5,10 @@ title: Goto Statement
 
 pkpy supports goto/label just like C. You are allowed to **change the control flow unconditionally**.
 
+!!!
+This feature is stable after v1.2.2.
+!!!
+
 ## Define a label
 
 ```

+ 12 - 1
tests/27_goto.py

@@ -19,4 +19,15 @@ for i in range(10):         # [1]
         -> out
         b = True
 == out ==
-assert not b
+assert not b
+
+sum = 0
+i = 1
+
+== loop ==
+sum += i
+i += 1
+if i <= 100:
+    -> loop
+
+assert sum == 5050