def sanitize

ezmcp@0.1.0.0 · src/openapi.bend:611

import ezmcp@0.1.0.0/src/openapi.bend as Openapi
import Base

611# a string as a tool name: each character that may not stand in one
612# (`name.ok`) as `_`, one for one
613def sanitize(text: String) -> String:
614  match text:
615    case SNil{}:
616      SNil{}
617    case SCon{Chr{+cp}, rest}:
618      SCon{name.char(name.ok(cp), cp), sanitize(rest)}

Uses (4)

Used by (1)