cleanup
This commit is contained in:
+17
-6
@@ -1,4 +1,15 @@
|
||||
char* Lisp_Object_Type_to_string(Lisp_Object_Type type) {
|
||||
proc create_source_code_location(char* file, int line, int col) -> Source_Code_Location* {
|
||||
if (!file)
|
||||
return nullptr;
|
||||
|
||||
Source_Code_Location* ret = new(Source_Code_Location);
|
||||
ret->file = file;
|
||||
ret->line = line;
|
||||
ret->column = col;
|
||||
return ret;
|
||||
}
|
||||
|
||||
proc Lisp_Object_Type_to_string(Lisp_Object_Type type) -> char* {
|
||||
switch (type) {
|
||||
case(Lisp_Object_Type::Nil): return "nil";
|
||||
case(Lisp_Object_Type::T): return "t";
|
||||
@@ -13,7 +24,7 @@ char* Lisp_Object_Type_to_string(Lisp_Object_Type type) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
Positional_Arguments* create_positional_argument_list(int initial_capacity) {
|
||||
proc create_positional_argument_list(int initial_capacity) -> Positional_Arguments* {
|
||||
Positional_Arguments* ret = new(Positional_Arguments);
|
||||
ret->identifiers = (char**)malloc(initial_capacity * sizeof(char*));
|
||||
ret->next_index = 0;
|
||||
@@ -21,7 +32,7 @@ Positional_Arguments* create_positional_argument_list(int initial_capacity) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void append_to_positional_argument_list(Positional_Arguments* args, char* identifier) {
|
||||
proc append_to_positional_argument_list(Positional_Arguments* args, char* identifier) -> void {
|
||||
if (args->next_index == args->length) {
|
||||
args->length *= 2;
|
||||
args->identifiers = (char**)realloc(args->identifiers, args->length * sizeof(char*));
|
||||
@@ -29,7 +40,7 @@ void append_to_positional_argument_list(Positional_Arguments* args, char* identi
|
||||
args->identifiers[args->next_index++] = identifier;
|
||||
}
|
||||
|
||||
Keyword_Arguments* create_keyword_argument_list(int initial_capacity) {
|
||||
proc create_keyword_argument_list(int initial_capacity) -> Keyword_Arguments* {
|
||||
Keyword_Arguments* ret = new(Keyword_Arguments);
|
||||
ret->identifiers = (char**)malloc(initial_capacity * sizeof(char*));
|
||||
ret->values = create_Lisp_Object_array_list(initial_capacity);
|
||||
@@ -38,9 +49,9 @@ Keyword_Arguments* create_keyword_argument_list(int initial_capacity) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void append_to_keyword_argument_list(Keyword_Arguments* args,
|
||||
proc append_to_keyword_argument_list(Keyword_Arguments* args,
|
||||
char* identifier,
|
||||
struct Lisp_Object* default_value)
|
||||
struct Lisp_Object* default_value) -> void
|
||||
{
|
||||
if (args->next_index == args->length) {
|
||||
args->length *= 2;
|
||||
|
||||
Reference in New Issue
Block a user