diff --git a/src/main.c b/src/main.c index fa17a04..9acbe9a 100644 --- a/src/main.c +++ b/src/main.c @@ -119,7 +119,7 @@ int main(int argc, char **argv) return -1; } - Object *o = buildValue(heap, &error, "${ return 3+1; }"); + Object *o = buildValue(heap, &error, "[${ return 3*1; }, $i, {}, {${return 'name';}: $s, ${return 'name';}: [$s]}]", 4, "Francesco", "Giovanni"); if(o == NULL) { diff --git a/src/objects/o_list.c b/src/objects/o_list.c index 5296d98..c8f2384 100644 --- a/src/objects/o_list.c +++ b/src/objects/o_list.c @@ -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, "]"); } \ No newline at end of file diff --git a/src/objects/o_map.c b/src/objects/o_map.c index cf56580..06026b1 100644 --- a/src/objects/o_map.c +++ b/src/objects/o_map.c @@ -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, "}"); } \ No newline at end of file