cleanup and writing docs

This commit is contained in:
FelixBrendel
2018-10-27 21:25:28 +02:00
parent 49f18d7771
commit 321ef46a84
4 changed files with 61 additions and 1022 deletions
+15 -15
View File
@@ -1,18 +1,18 @@
typedef enum {
Error_Type_Ill_Formed_List,
Error_Type_Ill_Formed_Arguments,
Error_Type_Ill_Formed_Lambda_List,
Error_Type_Wrong_Number_Of_Arguments,
Error_Type_Unknown_Keyword_Argument,
Error_Type_Type_Missmatch,
Error_Type_Symbol_Not_Defined,
Error_Type_Ill_Formed_List,
Error_Type_Not_A_Function,
Error_Type_Not_Yet_Implemented,
Error_Type_Symbol_Not_Defined,
Error_Type_Syntax_Error,
Error_Type_Unexpected_Eof,
Error_Type_Unbalanced_Parenthesis,
Error_Type_Trailing_Garbage,
Error_Type_Type_Missmatch,
Error_Type_Unbalanced_Parenthesis,
Error_Type_Unexpected_Eof,
Error_Type_Unknown_Error,
Error_Type_Unknown_Keyword_Argument,
Error_Type_Wrong_Number_Of_Arguments,
} Error_Type;
typedef struct {
@@ -31,7 +31,7 @@ void delete_error() {
void create_error(Error_Type type, Ast_Node* location) {
delete_error();
error = new(Error);
error->type = type;
error->location = location;
@@ -39,19 +39,19 @@ void create_error(Error_Type type, Ast_Node* location) {
char* Error_Type_to_string(Error_Type type) {
switch (type) {
case Error_Type_Ill_Formed_List: return "Evaluation-error: Ill formed list";
case Error_Type_Ill_Formed_Arguments: return "Evaluation-error: Ill formed arguments";
case Error_Type_Ill_Formed_Lambda_List: return "Evaluation-error: Ill formed lambda list";
case Error_Type_Unknown_Keyword_Argument: return "Evaluation-error: Unknown keyword argument";
case Error_Type_Ill_Formed_List: return "Evaluation-error: Ill formed list";
case Error_Type_Not_A_Function: return "Evaluation-error: Not a function";
case Error_Type_Symbol_Not_Defined: return "Evaluation-error: Symbol not defined";
case Error_Type_Wrong_Number_Of_Arguments: return "Evaluation-error: Wrong number of arguments";
case Error_Type_Type_Missmatch: return "Evaluation-error: Type Missmatch";
case Error_Type_Not_Yet_Implemented: return "Evaluation-error: Not yet implemented";
case Error_Type_Trailing_Garbage: return "Evaluation-error: Trailing garbage following expression";
case Error_Type_Symbol_Not_Defined: return "Evaluation-error: Symbol not defined";
case Error_Type_Syntax_Error: return "Syntax Error";
case Error_Type_Unexpected_Eof: return "Parsing-error: Unexpected EOF";
case Error_Type_Trailing_Garbage: return "Evaluation-error: Trailing garbage following expression";
case Error_Type_Type_Missmatch: return "Evaluation-error: Type Missmatch";
case Error_Type_Unbalanced_Parenthesis: return "Parsing-error: Unbalanced parenthesis";
case Error_Type_Unexpected_Eof: return "Parsing-error: Unexpected EOF";
case Error_Type_Unknown_Keyword_Argument: return "Evaluation-error: Unknown keyword argument";
case Error_Type_Wrong_Number_Of_Arguments: return "Evaluation-error: Wrong number of arguments";
default: return "Unknown Error";
}
}