ds: array: update to_string() to surround string values in quotes
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <blue/core/iterator.h>
|
#include <blue/core/iterator.h>
|
||||||
#include <blue/core/stream.h>
|
#include <blue/core/stream.h>
|
||||||
#include <blue/ds/array.h>
|
#include <blue/ds/array.h>
|
||||||
|
#include <blue/ds/string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -323,8 +324,7 @@ static void array_to_string(const b_object *obj, b_stream *out)
|
|||||||
|
|
||||||
for (size_t i = 0; i < array->ar_len; i++) {
|
for (size_t i = 0; i < array->ar_len; i++) {
|
||||||
b_object *value = array->ar_data[i];
|
b_object *value = array->ar_data[i];
|
||||||
bool is_string
|
bool is_string = b_object_is_type(value, B_TYPE_STRING);
|
||||||
= false; // b_object_is_type(value, B_TYPE_STRING);
|
|
||||||
|
|
||||||
if (is_string) {
|
if (is_string) {
|
||||||
b_stream_write_char(out, '"');
|
b_stream_write_char(out, '"');
|
||||||
|
|||||||
Reference in New Issue
Block a user