razom-text-util- Common text/parsing tools for Razom language packages.

Safe HaskellSafe-Inferred




literal :: Regex String Source

Matches a delimited generic value literal and returns it, without delimiters and still escaped (since unescaping may be type-specific).

>>> match literal "{{1\\}2\\\\3}}"
Just "1\\}2\\\\3"

escapeMinimal :: String -> String Source

Given a value literal in unescaped form, do minimal default escapes: for the escape character itself (backslash) and for the closing delimiter character ('{').

unescapeMinimal :: String -> String Source

Given an escaped value literal, do minimal default unescapes: for the escape character and for the closing delimiter.