Skip to content

Commit 514df4e

Browse files
Update list
1 parent 5e29da1 commit 514df4e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

_tests/test_code_blocks.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@
5353
r'|SemanticAnalyzer\(|ASTPrinter\(\)|\.generate_rust\('
5454
)
5555

56+
# Blocks using syntax not yet supported by ProgramExecutor, or continuation
57+
# fragments that depend on variables/names defined in a prior block.
58+
UNSUPPORTED_OR_ORPHAN_RE = re.compile(
59+
r'^\s*match\s+\S' # match/case statement — target variable from prior block
60+
r'|:=' # walrus operator (:= not yet supported)
61+
r'|^\s*@\w+\d', # decorator with digit suffix (@decorator1) — from prior block
62+
re.MULTILINE,
63+
)
64+
5665

5766
# ---------------------------------------------------------------------------
5867
# Block collection
@@ -80,7 +89,7 @@ def _collect_blocks():
8089
code = m.group(2).strip()
8190
if lang in NON_EXECUTABLE or not code:
8291
continue
83-
if HOST_PY_RE.search(code) or PYTHON_API_RE.search(code):
92+
if HOST_PY_RE.search(code) or PYTHON_API_RE.search(code) or UNSUPPORTED_OR_ORPHAN_RE.search(code):
8493
continue
8594
if 'print(' not in code:
8695
continue

0 commit comments

Comments
 (0)