Add opt-in face presence departure and return speech
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user