markright v0.1.0 Markright.Buffer

The buffer, used in continuations, stores the tail of the string parsed, tags that are already opened and arbitrary values in bag field.

Summary

Types

t()

Buffer to hold a string buffer and the FILO of tags

Types

t()
t() :: %Markright.Buffer{bag: List.t, buffer: String.t, tags: List.t}

Buffer to hold a string buffer and the FILO of tags.

Functions

append(data, buffer)
append_and_cleanup(data, buffer)
cleanup(data)
empty()
empty?(buffer)
fields()
get(data, key)
pop(data)

Pops the element from the end of tags. Returns tuple {elem, rest}.

## Examples

iex> Markright.Buffer.pop(%Markright.Buffer{tags: [:a, :b, :c]})
  {:c, %Markright.Buffer{buffer: "", tags: [:a, :b]}}
push(data, tag)
put(data, kvs)
shift(data)
unshift(data, tag)
unshift_and_cleanup(data, tag)