Baseline: tree as shared

This commit is contained in:
alexm committed 2026-10-05 03:03:38 +00:00
commit 31f2fb8a5a
1679 files changed
+1024562

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
# probe: with over a struct with __enter__ and __exit__, normal and failing
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: begin load
# expect-stdout: loading
# expect-stdout: end load
# expect-stdout: begin parse
# expect-stdout: inside parse
# expect-stdout: end parse after error: bad token
# expect-stdout: done
@fieldwise_init
struct Section(Copyable, Movable):
var name: String
def __enter__(self) -> Self:
print("begin", self.name)
return self.copy()
def __exit__(self):
print("end", self.name)
def __exit__(self, err: Error) -> Bool:
print("end", self.name, "after error:", err)
return True
def main() raises:
with Section("load"):
print("loading")
with Section("parse") as s:
print("inside", s.name)
raise Error("bad token")
print("done")