combine v0.10.0 Combine View Source

Main entry point for the Combine API.

To use:

defmodule Test do
  use Combine # defaults to parsers: [:text, :binary]
  # use Combine, parsers: [:text]
  # use Combine, parsers: [:binary]
  # use Combine, parsers: [] # does not import any parsers other than Base

  def foo(str) do
    Combine.parse(str, many1(char))
  end
end

Link to this section Summary

Functions

Given an input string and a parser, applies the parser to the input string, and returns the results as a list, or an error tuple if an error occurs

Given a file path and a parser, applies the parser to the file located at that path, and returns the results as a lsit, or an error tuple if an error occurs

Link to this section Types

Link to this section Functions

Link to this function parse(input, parser, options \\ []) View Source
parse(any, parser, Keyword.t) ::
  [term] |
  Keyword.t |
  {:error, term}

Given an input string and a parser, applies the parser to the input string, and returns the results as a list, or an error tuple if an error occurs.

Link to this function parse_file(path, parser) View Source
parse_file(String.t, parser) :: [term] | {:error, term}

Given a file path and a parser, applies the parser to the file located at that path, and returns the results as a lsit, or an error tuple if an error occurs.