Dextrin.Text.Escapes (Dextrin v0.1.0)

Copy Markdown View Source

Shared escape-decoding for DXN's string/char/quoted-keyword bodies (DXN.md §1.1's escape production) — one implementation so none of the token handlers in Dextrin.Text.Actions duplicate it.

Summary

Functions

Decodes a full string/keyword body (text between quotes, quotes already stripped).

Decodes exactly one escape sequence, the text after the leading backslash.

Functions

decode(body)

@spec decode(String.t()) :: {:ok, String.t()} | {:error, String.t()}

Decodes a full string/keyword body (text between quotes, quotes already stripped).

decode_escape(arg1)

@spec decode_escape(String.t()) ::
  {:ok, String.t(), String.t()} | {:error, String.t()}

Decodes exactly one escape sequence, the text after the leading backslash.