set up so reusing scope when in a loop
This commit is contained in:
@@ -20,7 +20,7 @@ const char *built_in_field_names[BUILT_IN_FIELDS_COUNT] = {
|
||||
"__string__", "__subtract__", "__multiply__", "__division__",
|
||||
"__new__", "__init__", "__boolean__", "__get_attr__",
|
||||
"__binding__", "__function__", "address", "__call__",
|
||||
"__number__", "log"};
|
||||
"__number__", "log", "length"};
|
||||
|
||||
uint64_t built_in_field_hashes[BUILT_IN_FIELDS_COUNT];
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ typedef enum {
|
||||
__call__,
|
||||
__number__,
|
||||
field_log,
|
||||
field_length,
|
||||
BUILT_IN_FIELDS_COUNT
|
||||
} built_in_fields;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ ArgonObject *new_string_object(char *data, size_t length, uint64_t prehash,
|
||||
uint64_t hash) {
|
||||
ArgonObject *object = new_object();
|
||||
add_builtin_field(object, __class__, ARGON_STRING_TYPE);
|
||||
add_builtin_field(object, length,
|
||||
add_builtin_field(object, field_length,
|
||||
new_number_object_from_num_and_den(length, 1));
|
||||
object->type = TYPE_STRING;
|
||||
object->value.as_str.data = ar_alloc_atomic(length);
|
||||
|
||||
Reference in New Issue
Block a user