Module Mini_ml_lib.Parser

type error =
  1. | UnexpectedEnd
    (*

    When end of source unexpectedly reached

    *)
  2. | UnexpectedRest of string
    (*

    When not all characters where parsed

    *)
  3. | SyntaxError of string
    (*

    For other errors

    *)

Type for parsing error

type 'a result =
  1. | Parsed of 'a * char list
  2. | ParseError of error

Type for result of parsing

val parse_line : string -> Ast.t result

Parses one expression

val show_error : error -> string

Shows error in human readable format

val show_result : Ast.t result -> string

Shows result in human readable format