pears/chars

Types

A grapheme is a user-perceived character.

pub type Char =
  String

Functions

pub fn char(
  c: String,
) -> fn(Input(String)) ->
  Result(Parsed(String, String), ParseError(String))

Parses a given character.

pub fn digit() -> fn(Input(String)) ->
  Result(Parsed(String, String), ParseError(String))

Parses a digit in the range 0-9.

pub fn input(s: String) -> Input(String)

Creates an Input(Char) from a string.

pub fn number() -> fn(Input(String)) ->
  Result(Parsed(String, Int), ParseError(String))

Parses a number consisting of one or more digits.

pub fn string(
  str: String,
) -> fn(Input(String)) ->
  Result(Parsed(String, String), ParseError(String))

Parses a given string.

pub fn whitespace() -> fn(Input(String)) ->
  Result(Parsed(String, String), ParseError(String))

Parses a character if is whitespace according to the Unicode standard.

pub fn whitespace0() -> fn(Input(String)) ->
  Result(Parsed(String, List(String)), ParseError(String))

Parses zero or more whitespace characters.

pub fn whitespace1() -> fn(Input(String)) ->
  Result(Parsed(String, List(String)), ParseError(String))

Parses one or more whitespace characters.

Search Document