Constants used throughout the TOON encoder and decoder.
This module defines all the string literals, delimiters, and special characters used in the TOON format.
Performance
Constants are defined as module attributes and exposed via @compile {:inline}
functions. This allows the compiler to inline constant access at call sites,
avoiding function call overhead in the hot encoding path.
For use in @compile {:inline} contexts, the attribute values can be referenced
directly via the zero-arity functions, which the compiler will inline.
Summary
Functions
Returns the list of control characters that need escaping.
Returns the list of structure characters that require quoting in keys and values. Note: Comma is NOT included here as it's only special when it's the active delimiter.
Checks if a delimiter is valid.
Returns the list of valid delimiter values.
Functions
@spec control_chars() :: [String.t()]
Returns the list of control characters that need escaping.
@spec structure_chars() :: [String.t()]
Returns the list of structure characters that require quoting in keys and values. Note: Comma is NOT included here as it's only special when it's the active delimiter.
Checks if a delimiter is valid.
@spec valid_delimiters() :: [String.t()]
Returns the list of valid delimiter values.