changed the way lists and maps are printed
This commit is contained in:
@@ -194,6 +194,7 @@ static void print(Object *self, FILE *fp)
|
||||
{
|
||||
ListObject *list = (ListObject*) self;
|
||||
|
||||
fprintf(fp, "[");
|
||||
for(int i = 0; i < list->count; i += 1)
|
||||
{
|
||||
Object_Print(list->vals[i], fp);
|
||||
@@ -201,4 +202,5 @@ static void print(Object *self, FILE *fp)
|
||||
if(i+1 < list->count)
|
||||
fprintf(fp, ", ");
|
||||
}
|
||||
fprintf(fp, "]");
|
||||
}
|
||||
@@ -294,6 +294,7 @@ static void print(Object *self, FILE *fp)
|
||||
{
|
||||
MapObject *map = (MapObject*) self;
|
||||
|
||||
fprintf(fp, "{");
|
||||
for(int i = 0; i < map->count; i += 1)
|
||||
{
|
||||
Object_Print(map->keys[i], fp);
|
||||
@@ -303,4 +304,5 @@ static void print(Object *self, FILE *fp)
|
||||
if(i+1 < map->count)
|
||||
fprintf(fp, ", ");
|
||||
}
|
||||
fprintf(fp, "}");
|
||||
}
|
||||
Reference in New Issue
Block a user