Skip to main content

Module string

Module string 

Source
Expand description

Parsers and utility types for parsing KDL strings and identifiers.

Structs§

KdlString
A KDL string, parsed from an identifier, escaped string, or raw string. Exists in either Owned or Borrowed form, depending on whether there were escapes in the string. Doesn’t track the origin of the string (identifier, escaped, or raw), because KDL semantics treat them all identically.

Traits§

StringBuilder
Helper trait for parsing strings with escape sequences. Allows for returning borrowed strings without any allocation if there are no escape sequences, or for recognizing strings without doing actual parsing / allocation.

Functions§

is_identifier
Returns true if this is not considered a “non-identifier character”
is_initial_identifier
Returns true if this is not considered a “non-initial character”
parse_bare_identifier
Parse a KDL bare identifier.
parse_escaped_string
Parse a regular, quoted string (with escape sequences)
parse_identifier
Parse a KDL identifier, which is either a bare identifer or a string
parse_raw_string
Parse a raw string, resembling r##"abc"##
parse_string
Parse a KDL string, which is either a raw or escaped string