1.1 --- a/templates/native/str.c Tue Nov 02 00:04:48 2021 +0100
1.2 +++ b/templates/native/str.c Thu Nov 04 23:21:09 2021 +0100
1.3 @@ -33,8 +33,8 @@
1.4 /* _data, other interpreted as string.__data__ */
1.5 char *s = _data.strvalue;
1.6 char *o = other.strvalue;
1.7 - /* _size, othersize interpreted as int */
1.8 - __int ss = __TOINT(_size), os = __TOINT(othersize);
1.9 + /* _size, othersize interpreted as size */
1.10 + __int ss = _size.sizevalue, os = othersize.sizevalue;
1.11 __int n = ss + os;
1.12 char *r = (char *) __ALLOCATE(n + 1, sizeof(char));
1.13
1.14 @@ -93,6 +93,11 @@
1.15 return __new_int((__int) s[0]);
1.16 }
1.17
1.18 +__attr __fn_native_str_str_size(__attr __self, __attr _size)
1.19 +{
1.20 + return __new_int(_size.sizevalue);
1.21 +}
1.22 +
1.23 __attr __fn_native_str_str_substr(__attr __self, __attr _data, __attr start, __attr end, __attr step)
1.24 {
1.25 /* _data interpreted as string.__data__ */