INNER CODE UNIT · Python
end
michelp/pgsodium · docgen.py:12
if end == -1:
return
comment = s[: end + 2]
lines = comment.splitlines()
if not lines:
return
first = lines[0]
if not first.startswith("/* doctest"):
return
target = first[len("/* doctest"):].strip()
if target.startswith("/"):
target = target[1:]
if not target:
return
target = target.replace('/', '_')
stripped_comment = "\n".join(lines[1:-1]).strip() if len(lines) >= 3 else ""
out_file = os.path.join("sql", target + ".sql")
os.makedirs(os.path.dirname(out_file), exist_ok=True)