From ffbb9af45e3dcf7a96286e337b70bf8ca65f8fc1 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 24 Sep 2023 13:50:59 +0800 Subject: [PATCH] ... --- docs/features/goto.md | 4 ++++ tests/27_goto.py | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/features/goto.md b/docs/features/goto.md index e5c77fd2..acd4e45f 100644 --- a/docs/features/goto.md +++ b/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 ``` diff --git a/tests/27_goto.py b/tests/27_goto.py index f884730f..f0e764ba 100644 --- a/tests/27_goto.py +++ b/tests/27_goto.py @@ -19,4 +19,15 @@ for i in range(10): # [1] -> out b = True == out == -assert not b \ No newline at end of file +assert not b + +sum = 0 +i = 1 + +== loop == +sum += i +i += 1 +if i <= 100: + -> loop + +assert sum == 5050 \ No newline at end of file