Kuddle.V2.Decoder (Kuddle v1.1.1)

Copy Markdown View Source

Tokenizes and parses KDL2 documents into kuddle documents.

Summary

Types

A kuddle document is a list of Kuddle Nodes

A single node in the Kuddle document

Parsed tokens from the Tokenizer, these will be processed and converted into the final nodes for the document.

Functions

Tokenize and parse a given KDL document.

Same as decode/1, but will raise a Kuddle.DecodeError on error from decode.

Types

document()

@type document() :: [document_node()]

A kuddle document is a list of Kuddle Nodes

document_node()

@type document_node() :: Kuddle.Node.t()

A single node in the Kuddle document

tokens()

@type tokens() :: Kuddle.V2.Tokenizer.tokens()

Parsed tokens from the Tokenizer, these will be processed and converted into the final nodes for the document.

Functions

decode(blob)

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

Tokenize and parse a given KDL document.

If successful, it will return {:ok, document, tokens}, where document is the list of nodes that were parsed and tokens are any unparsed tokens.

decode!(blob)

@spec decode!(String.t()) :: document()

Same as decode/1, but will raise a Kuddle.DecodeError on error from decode.

default_state(args \\ [])

(macro)

default_state(record, args)

(macro)

node_state(args \\ [])

(macro)

node_state(record, args)

(macro)