nibble
Types
pub type DeadEnd(ctx) {
DeadEnd(
row: Int,
col: Int,
problem: Error,
context: List(Located(ctx)),
)
}
Constructors
-
DeadEnd( row: Int, col: Int, problem: Error, context: List(Located(ctx)), )
pub type Error {
BadParser(String)
Custom(String)
EndOfInput
Expected(String, got: String)
Unexpected(String)
}
Constructors
-
BadParser(String)
-
Custom(String)
-
EndOfInput
-
Expected(String, got: String)
-
Unexpected(String)
pub type Located(ctx) {
Located(row: Int, col: Int, context: ctx)
}
Constructors
-
Located(row: Int, col: Int, context: ctx)
Functions
pub fn backtrackable(parser: Parser(a, b)) -> Parser(a, b)
pub fn inspect(parser: Parser(a, b), message: String) -> Parser(
a,
b,
)
Run the given parser and then inspect it’s state.
pub fn take_if(predicate: fn(String) -> Bool, expecting: String) -> Parser(
String,
a,
)
pub fn take_if_and_while(predicate: fn(String) -> Bool, expecting: String) -> Parser(
String,
a,
)
pub fn take_until(predicate: fn(String) -> Bool) -> Parser(
String,
a,
)
pub fn take_while(predicate: fn(String) -> Bool) -> Parser(
String,
a,
)
pub fn whitespace() -> Parser(Nil, a)