| 217 | } |
| 218 | |
| 219 | char* builtin_string_slice1 ( const char *str, int start, int end, Context * context, LineInfoArg * at ) { |
| 220 | const uint32_t strLen = stringLengthSafe ( *context, str ); |
| 221 | if (!strLen) |
| 222 | return nullptr; |
| 223 | start = clamp_int((start < 0) ? (strLen + start) : start, 0, strLen); |
| 224 | end = clamp_int((end < 0) ? (strLen + end) : end, 0, strLen); |
| 225 | return end > start ? context->allocateString(str + start, uint32_t(end-start), at) : nullptr; |
| 226 | } |
| 227 | |
| 228 | char* builtin_string_slice2 ( const char *str, int start, Context * context, LineInfoArg * at ) { |
| 229 | const uint32_t strLen = stringLengthSafe ( *context, str ); |
nothing calls this directly
no test coverage detected