function "UCASE" { param "text"; value "translate($text, 'abcdefghijklmnopqrstuvwxyz-', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_')"; } function "lcase" { param "text"; value "translate($text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-', 'abcdefghijklmnopqrstuvwxyz_')"; } function "hyphenize" { param "text"; value "translate($text, '_', '-')"; } function "CamelCase" { param "text"; const "tokens", "str:tokenize($text, '-')"; for "$tokens" { choose { when ".='pEp'" > pEp otherwise { call "UCASE" with "text", "substring(., 1, 1)"; value "substring(., 2)"; } } } } define operator "©([$@]?[a-zA-Z0-9_]+)" as call "CamelCase" with "text", "%1";