Function lisp_parser::parse_lisp_program
source · [−]pub fn parse_lisp_program(program: &str) -> LispProgramParsingResult
Expand description
A function that parses a LISP program into LispObject
s.
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 hereUnclosedParenthesis
: 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 hereUnexpectedClosingParenthesis
: 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