mochi/parser

Types

pub type ParseError {
  LexError(error: @internal LexerError)
  UnexpectedToken(
    expected: String,
    got: @internal Token,
    position: @internal Position,
  )
  UnexpectedEOF(expected: String)
}

Constructors

  • LexError(error: @internal LexerError)
  • UnexpectedToken(
      expected: String,
      got: @internal Token,
      position: @internal Position,
    )
  • UnexpectedEOF(expected: String)
pub type Parser {
  Parser(
    tokens: List(@internal TokenWithPosition),
    position: Int,
  )
}

Constructors

  • Parser(tokens: List(@internal TokenWithPosition), position: Int)

Values

pub fn parse(
  input: String,
) -> Result(@internal Document, ParseError)
Search Document