Sammal v0.1.0 Sammal.ParserCombinators View Source

Experimenting with parser combinators. TODO docs

Link to this section Summary

Link to this section Types

Link to this type error() View Source
error() :: atom
Link to this type parser() View Source
parser() :: (input :: [token] -> {:ok, result} | {:error, error})
Link to this type result() View Source
result() :: {value :: [token], remaining :: [token]}
Link to this type token() View Source
token() :: any
Link to this type transformer() View Source
transformer() :: ([token] -> [token])

Link to this section Functions

Link to this function delay(parser_func) View Source
delay((() -> parser)) :: parser

Delay parser evaluation to handle infinite loops in self-referential parsers.

Link to this function sequence(parsers) View Source
sequence([parser]) :: parser

Wrap parser result into a list.