pub fn parse_lisp_program(program: &str) -> LispProgramParsingResult
Expand description

A function that parses a LISP program into LispObjects. Each LispObject is a List or a String, and numbers are Strings here too.

Errors

If something is wrong with the program passed, an error may be returned:

  • UnclosedQuote: there is an opening quote for a string literal that was not closed. Enum contents: opening_quote_position (TextPosition) - where an opening quote was in text. Example: abc (def) “ghi ^ Unclosed quote is here
  • UnclosedParenthesis: there is an opened parenthesis for a list literal that was not closed. Enum contents: opening_parenthesis_position (TextPosition) - where an opening parenthesis was in text. Example: (abc def “ghi” ^ Unclosed parenthesis is here
  • UnexpectedClosingParenthesis: there is a closing parenthesis, but it does not correspond to any opening parenthesis. Enum contents: closing_parenthesis_position (TextPosition) - where an unexpected closing parenthesis was in text. Example: ( ) abc def) ^ Unexpected closing parenthesis is here