Add opt-in face presence departure and return speech

This commit is contained in:
zenord
2026-10-13 16:38:08 +08:00
parent 40abf3a14e
commit d0c1d7eb3d
21 changed files with 913 additions and 89 deletions
+9 -1
View File
@@ -13,7 +13,15 @@ clean=re.sub(pattern,lambda m:' '*len(m[0]),source)
def block(marker,within=None):
start,end=within or (0,len(source))
at=clean.index(marker,start,end)
left=clean.index('{',at+len(marker),end)
body_at=at+len(marker)
if marker.startswith('fun '):
# Default callback lambdas belong to the parameter list, not the body.
params=clean.index('(',body_at,end)
depth=1;body_at=params+1
while depth:
assert body_at<end,'Unclosed Kotlin parameters'
depth+=(clean[body_at]=='(')-(clean[body_at]==')');body_at+=1
left=clean.index('{',body_at,end)
depth=1;right=left+1
while depth:
assert right<end,'Unclosed Kotlin block'