@scriptc/cli-darwin-x64 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_NOTICES +1 -1
- package/dist/bin/scriptc +0 -0
- package/dist/bin/scriptc.json +1 -1
- package/dist/lib/declarations/scriptc-node-fallback.d.ts +972 -245
- package/dist/lib/declarations/scriptc-overrides.d.ts +5 -1
- package/dist/lib/declarations/scriptc.d.ts +22 -2
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +1 -1
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default-workers/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/text-decoder-legacy-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/workers/scr_mailbox.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/workers/scr_message.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/workers/scr_worker.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/workers/scr_worker_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_async_dyn.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_bigint.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_bigint_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_console_native.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_crypto_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_dc.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_dyn_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_dyn_invoke.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_fetch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_ffi.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_ffi_queue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_grapheme.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_http.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_http2.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_inspect.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_loop_epoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_loop_kqueue.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_loop_wsapoll.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_net.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_path.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_qs.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_test.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_tls_ca.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_util.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_watch.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default-workers/scr_zlib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_child.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_closure.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_console.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_context.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_copying.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_cycle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_dgram.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_error.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_events_emitter.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_number.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_object.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_readline.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_shared.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_stream.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_string.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_tls.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_union.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic-text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/text-decoder-legacy/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/text-decoder-legacy-workers/scr_bytes.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/workers/scr_mailbox.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/workers/scr_message.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/workers/scr_worker.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/workers/scr_worker_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/package.json +1 -1
- package/dist/lib/runtime-darwin-x64/runtime-pack.json +3318 -790
- package/dist/lib/runtime-sources/package.json +1 -1
- package/dist/lib/runtime-sources/src/scr_array.c +479 -46
- package/dist/lib/runtime-sources/src/scr_assert.c +3 -3
- package/dist/lib/runtime-sources/src/scr_async.c +401 -71
- package/dist/lib/runtime-sources/src/scr_async.test.ts +16 -6
- package/dist/lib/runtime-sources/src/scr_async_dyn.c +30 -30
- package/dist/lib/runtime-sources/src/scr_bytes.c +487 -221
- package/dist/lib/runtime-sources/src/scr_bytes.test.c +85 -0
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +45 -64
- package/dist/lib/runtime-sources/src/scr_child.c +48 -30
- package/dist/lib/runtime-sources/src/scr_closure.c +21 -11
- package/dist/lib/runtime-sources/src/scr_console.c +27 -5
- package/dist/lib/runtime-sources/src/scr_context.c +167 -0
- package/dist/lib/runtime-sources/src/scr_context.test.c +118 -0
- package/dist/lib/runtime-sources/src/scr_context.test.ts +47 -0
- package/dist/lib/runtime-sources/src/scr_copying.c +13 -2
- package/dist/lib/runtime-sources/src/scr_cycle.c +112 -12
- package/dist/lib/runtime-sources/src/scr_dc.c +8 -8
- package/dist/lib/runtime-sources/src/scr_dgram.c +10 -7
- package/dist/lib/runtime-sources/src/scr_error.c +26 -14
- package/dist/lib/runtime-sources/src/scr_events.c +45 -31
- package/dist/lib/runtime-sources/src/scr_events_emitter.c +34 -1
- package/dist/lib/runtime-sources/src/scr_exception.c +26 -7
- package/dist/lib/runtime-sources/src/scr_fetch.c +23 -20
- package/dist/lib/runtime-sources/src/scr_fetch_curl.c +1 -1
- package/dist/lib/runtime-sources/src/scr_ffi.c +3 -3
- package/dist/lib/runtime-sources/src/scr_file_handle.c +1 -0
- package/dist/lib/runtime-sources/src/scr_http.c +20 -16
- package/dist/lib/runtime-sources/src/scr_http2.c +10 -8
- package/dist/lib/runtime-sources/src/scr_inspect.c +1 -0
- package/dist/lib/runtime-sources/src/scr_island.c +1 -1
- package/dist/lib/runtime-sources/src/scr_json.c +652 -189
- package/dist/lib/runtime-sources/src/scr_json.test.c +339 -1
- package/dist/lib/runtime-sources/src/scr_json.test.ts +59 -25
- package/dist/lib/runtime-sources/src/scr_key.h +92 -0
- package/dist/lib/runtime-sources/src/scr_lib.c +256 -136
- package/dist/lib/runtime-sources/src/scr_mailbox.c +233 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.h +28 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.test.c +86 -0
- package/dist/lib/runtime-sources/src/scr_mailbox.test.ts +46 -0
- package/dist/lib/runtime-sources/src/scr_map.c +240 -107
- package/dist/lib/runtime-sources/src/scr_message.c +443 -0
- package/dist/lib/runtime-sources/src/scr_message.h +14 -0
- package/dist/lib/runtime-sources/src/scr_message.test.c +152 -0
- package/dist/lib/runtime-sources/src/scr_message.test.ts +44 -0
- package/dist/lib/runtime-sources/src/scr_net.c +14 -12
- package/dist/lib/runtime-sources/src/scr_number.c +36 -4
- package/dist/lib/runtime-sources/src/scr_numeric.h +25 -0
- package/dist/lib/runtime-sources/src/scr_numeric.test.c +37 -0
- package/dist/lib/runtime-sources/src/scr_numeric.test.ts +33 -0
- package/dist/lib/runtime-sources/src/scr_object.c +9 -4
- package/dist/lib/runtime-sources/src/scr_path.c +1 -1
- package/dist/lib/runtime-sources/src/scr_readline.c +8 -8
- package/dist/lib/runtime-sources/src/scr_regex.c +351 -167
- package/dist/lib/runtime-sources/src/scr_runtime.h +207 -34
- package/dist/lib/runtime-sources/src/scr_shared.c +280 -0
- package/dist/lib/runtime-sources/src/scr_shared.test.c +113 -0
- package/dist/lib/runtime-sources/src/scr_shared.test.ts +45 -0
- package/dist/lib/runtime-sources/src/scr_stream.c +9 -9
- package/dist/lib/runtime-sources/src/scr_string.c +365 -141
- package/dist/lib/runtime-sources/src/scr_test.c +8 -8
- package/dist/lib/runtime-sources/src/scr_tls.c +12 -12
- package/dist/lib/runtime-sources/src/scr_tls_ca.c +34 -12
- package/dist/lib/runtime-sources/src/scr_union.c +10 -5
- package/dist/lib/runtime-sources/src/scr_util_compare.c +1 -0
- package/dist/lib/runtime-sources/src/scr_util_style.c +11 -11
- package/dist/lib/runtime-sources/src/scr_watch.c +16 -6
- package/dist/lib/runtime-sources/src/scr_worker.c +232 -0
- package/dist/lib/runtime-sources/src/scr_worker.h +42 -0
- package/dist/lib/runtime-sources/src/scr_worker.test.c +115 -0
- package/dist/lib/runtime-sources/src/scr_worker.test.ts +49 -0
- package/dist/lib/runtime-sources/src/scr_worker_events.c +443 -0
- package/dist/lib/runtime-sources/src/scr_zlib.c +6 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#include "scr_runtime.h"
|
|
2
|
+
#include "scr_key.h"
|
|
2
3
|
|
|
3
4
|
#include <math.h>
|
|
4
5
|
#include <stdio.h>
|
|
@@ -72,6 +73,7 @@ typedef struct ScrSidx {
|
|
|
72
73
|
const ScrStr *s; /* NULL = empty slot */
|
|
73
74
|
size_t u16len; /* SCR_U16_UNKNOWN until the whole current string */
|
|
74
75
|
size_t cu, cb; /* hot cursor: cb starts the char at unit cu */
|
|
76
|
+
size_t ascii_cu, ascii_cb, ascii_end; /* bounded, proven identity span */
|
|
75
77
|
ScrSidxPoint *points; /* sparse, ordered code-point-boundary anchors */
|
|
76
78
|
size_t npoints, cap; /* owned points length/capacity */
|
|
77
79
|
size_t indexed_cu; /* exact contiguous prefix indexed from byte zero */
|
|
@@ -87,17 +89,25 @@ static SCR_TL ScrSidx scr_sidx_sparse_tab[SCR_SIDX_N];
|
|
|
87
89
|
static SCR_TL ScrSidx scr_sidx_cursor_tab[SCR_SIDX_N];
|
|
88
90
|
static SCR_TL unsigned scr_sidx_sparse_clock;
|
|
89
91
|
static SCR_TL unsigned scr_sidx_cursor_clock;
|
|
92
|
+
static SCR_TL unsigned scr_sidx_sparse_live;
|
|
90
93
|
static SCR_TL bool scr_sidx_cleanup_registered;
|
|
94
|
+
/* Counts both tiers, independent of the wrapping eviction clocks. A transfer
|
|
95
|
+
* moves one active entry; only clearing or initializing changes the count. */
|
|
96
|
+
static SCR_TL size_t scr_sidx_active;
|
|
91
97
|
|
|
92
|
-
static void scr_sidx_clear(ScrSidx *e) {
|
|
98
|
+
static void scr_sidx_clear(ScrSidx *e, unsigned *live) {
|
|
99
|
+
if (e->s) {
|
|
100
|
+
scr_sidx_active--;
|
|
101
|
+
if (live) (*live)--;
|
|
102
|
+
}
|
|
93
103
|
free(e->points);
|
|
94
104
|
memset(e, 0, sizeof(*e));
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
static void scr_sidx_reset_all(void) {
|
|
98
108
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
99
|
-
scr_sidx_clear(&scr_sidx_sparse_tab[i]);
|
|
100
|
-
scr_sidx_clear(&scr_sidx_cursor_tab[i]);
|
|
109
|
+
scr_sidx_clear(&scr_sidx_sparse_tab[i], &scr_sidx_sparse_live);
|
|
110
|
+
scr_sidx_clear(&scr_sidx_cursor_tab[i], NULL);
|
|
101
111
|
}
|
|
102
112
|
scr_sidx_sparse_clock = 0;
|
|
103
113
|
scr_sidx_cursor_clock = 0;
|
|
@@ -112,9 +122,15 @@ static void scr_sidx_register_cleanup(void) {
|
|
|
112
122
|
|
|
113
123
|
#ifdef SCR_SIDX_TEST
|
|
114
124
|
static SCR_TL size_t scr_sidx_walk_steps;
|
|
115
|
-
|
|
125
|
+
static SCR_TL size_t scr_sidx_searches;
|
|
126
|
+
void scr_sidx_test_reset_steps(void) {
|
|
127
|
+
scr_sidx_walk_steps = 0;
|
|
128
|
+
scr_sidx_searches = 0;
|
|
129
|
+
}
|
|
116
130
|
size_t scr_sidx_test_walk_steps(void) { return scr_sidx_walk_steps; }
|
|
131
|
+
size_t scr_sidx_test_searches(void) { return scr_sidx_searches; }
|
|
117
132
|
void scr_sidx_test_reset_cache(void) { scr_sidx_reset_all(); }
|
|
133
|
+
size_t scr_sidx_test_active(void) { return scr_sidx_active; }
|
|
118
134
|
size_t scr_sidx_test_entries(void) {
|
|
119
135
|
size_t n = 0;
|
|
120
136
|
for (int i = 0; i < SCR_SIDX_N; i++)
|
|
@@ -128,28 +144,54 @@ size_t scr_sidx_test_points(void) {
|
|
|
128
144
|
return n;
|
|
129
145
|
}
|
|
130
146
|
#define SCR_SIDX_STEP() (scr_sidx_walk_steps++)
|
|
147
|
+
#define SCR_SIDX_SEARCH() (scr_sidx_searches++)
|
|
131
148
|
#else
|
|
132
149
|
#define SCR_SIDX_STEP() ((void)0)
|
|
150
|
+
#define SCR_SIDX_SEARCH() ((void)0)
|
|
133
151
|
#endif
|
|
134
152
|
|
|
135
|
-
|
|
153
|
+
/* Share cleanup across release and scratch reuse; callers inline only the
|
|
154
|
+
* empty-cache check. */
|
|
155
|
+
static __attribute__((noinline)) void scr_sidx_purge_active(const ScrStr *s) {
|
|
136
156
|
/* These are deliberately fixed four-entry tables, never an unbounded
|
|
137
157
|
* receiver registry. Releasing an unrelated temporary therefore does at
|
|
138
158
|
* most eight pointer comparisons and cannot grow with live strings. */
|
|
139
159
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
140
160
|
if (scr_sidx_sparse_tab[i].s == s)
|
|
141
|
-
scr_sidx_clear(&scr_sidx_sparse_tab[i]);
|
|
161
|
+
scr_sidx_clear(&scr_sidx_sparse_tab[i], &scr_sidx_sparse_live);
|
|
142
162
|
if (scr_sidx_cursor_tab[i].s == s)
|
|
143
|
-
scr_sidx_clear(&scr_sidx_cursor_tab[i]);
|
|
163
|
+
scr_sidx_clear(&scr_sidx_cursor_tab[i], NULL);
|
|
144
164
|
}
|
|
145
165
|
}
|
|
146
166
|
|
|
147
|
-
static void
|
|
167
|
+
static void scr_sidx_purge(const ScrStr *s) {
|
|
168
|
+
if (scr_sidx_active) scr_sidx_purge_active(s);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static void scr_sidx_init(ScrSidx *e, const ScrStr *s, unsigned *live) {
|
|
148
172
|
memset(e, 0, sizeof(*e));
|
|
149
173
|
e->s = s;
|
|
174
|
+
scr_sidx_active++;
|
|
175
|
+
if (live) (*live)++;
|
|
150
176
|
e->u16len = SCR_U16_UNKNOWN;
|
|
151
177
|
}
|
|
152
178
|
|
|
179
|
+
/* Reuse sparse-tier holes left by short-lived receivers before evicting a live index.
|
|
180
|
+
* Round-robin eviction remains bounded when every slot is occupied. */
|
|
181
|
+
static ScrSidx *scr_sidx_claim(ScrSidx *table, unsigned *clock, unsigned *live) {
|
|
182
|
+
/* A full tier needs no second slot scan after the failed lookup. */
|
|
183
|
+
for (size_t offset = 0; *live < SCR_SIDX_N && offset < SCR_SIDX_N; offset++) {
|
|
184
|
+
size_t index = (*clock + offset) % SCR_SIDX_N;
|
|
185
|
+
if (!table[index].s) {
|
|
186
|
+
*clock = (unsigned)(index + 1);
|
|
187
|
+
return &table[index];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
ScrSidx *entry = &table[(*clock)++ % SCR_SIDX_N];
|
|
191
|
+
scr_sidx_clear(entry, live);
|
|
192
|
+
return entry;
|
|
193
|
+
}
|
|
194
|
+
|
|
153
195
|
/* Short strings retain the historical hot cursor without contending with the
|
|
154
196
|
* sparse residency. Large strings claim only the sparse tier; an in-place
|
|
155
197
|
* append that crosses the threshold moves its exact cursor frontier into
|
|
@@ -170,17 +212,14 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
170
212
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
171
213
|
ScrSidx *old = &scr_sidx_cursor_tab[i];
|
|
172
214
|
if (old->s != s) continue;
|
|
173
|
-
ScrSidx *e = &
|
|
174
|
-
scr_sidx_sparse_clock++ % SCR_SIDX_N];
|
|
175
|
-
scr_sidx_clear(e);
|
|
215
|
+
ScrSidx *e = scr_sidx_claim(scr_sidx_sparse_tab, &scr_sidx_sparse_clock, &scr_sidx_sparse_live);
|
|
176
216
|
*e = *old;
|
|
217
|
+
scr_sidx_sparse_live++;
|
|
177
218
|
memset(old, 0, sizeof(*old)); /* ownership moved to the sparse tier */
|
|
178
219
|
return e;
|
|
179
220
|
}
|
|
180
|
-
ScrSidx *e =
|
|
181
|
-
|
|
182
|
-
scr_sidx_clear(e);
|
|
183
|
-
scr_sidx_init(e, s);
|
|
221
|
+
ScrSidx *e = scr_sidx_claim(scr_sidx_sparse_tab, &scr_sidx_sparse_clock, &scr_sidx_sparse_live);
|
|
222
|
+
scr_sidx_init(e, s, &scr_sidx_sparse_live);
|
|
184
223
|
return e;
|
|
185
224
|
}
|
|
186
225
|
ScrSidx *tab = scr_sidx_cursor_tab;
|
|
@@ -189,8 +228,8 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
189
228
|
if (tab[i].s == s) return &tab[i];
|
|
190
229
|
}
|
|
191
230
|
ScrSidx *e = &tab[(*clock)++ % SCR_SIDX_N];
|
|
192
|
-
scr_sidx_clear(e);
|
|
193
|
-
scr_sidx_init(e, s);
|
|
231
|
+
scr_sidx_clear(e, NULL);
|
|
232
|
+
scr_sidx_init(e, s, NULL);
|
|
194
233
|
return e;
|
|
195
234
|
}
|
|
196
235
|
|
|
@@ -200,6 +239,7 @@ static ScrSidx *scr_sidx(const ScrStr *s) {
|
|
|
200
239
|
* receiver may move from the cursor tier to the sparse tier on its next
|
|
201
240
|
* lookup, so invalidate either possible entry. */
|
|
202
241
|
static void scr_sidx_concat_append(const ScrStr *s, size_t oldlen) {
|
|
242
|
+
if (scr_sidx_active == 0) return;
|
|
203
243
|
for (int i = 0; i < SCR_SIDX_N; i++) {
|
|
204
244
|
ScrSidx *entries[] = {&scr_sidx_sparse_tab[i], &scr_sidx_cursor_tab[i]};
|
|
205
245
|
for (size_t j = 0; j < sizeof(entries) / sizeof(entries[0]); j++) {
|
|
@@ -373,7 +413,7 @@ ScrStr *scr_str_concat_parts(ScrStr *const *parts, size_t count) {
|
|
|
373
413
|
}
|
|
374
414
|
|
|
375
415
|
bool scr_str_eq(ScrStr *a, ScrStr *b) {
|
|
376
|
-
return a == b || (a->len == b->len &&
|
|
416
|
+
return a == b || (a->len == b->len && scr_key_equal(a->data, b->data, a->len));
|
|
377
417
|
}
|
|
378
418
|
|
|
379
419
|
int scr_str_cmp(ScrStr *a, ScrStr *b) {
|
|
@@ -383,62 +423,29 @@ int scr_str_cmp(ScrStr *a, ScrStr *b) {
|
|
|
383
423
|
return a->len < b->len ? -1 : (a->len > b->len ? 1 : 0);
|
|
384
424
|
}
|
|
385
425
|
|
|
386
|
-
/* UTF-16
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
* Decode code points and compare their leading UTF-16 units. */
|
|
392
|
-
static uint32_t scr_str_lead_u16(const unsigned char *s, size_t len,
|
|
393
|
-
size_t *adv) {
|
|
394
|
-
unsigned char b = s[0];
|
|
395
|
-
uint32_t cp;
|
|
396
|
-
size_t n;
|
|
397
|
-
if (b < 0x80) {
|
|
398
|
-
cp = b; n = 1;
|
|
399
|
-
} else if ((b & 0xe0) == 0xc0) {
|
|
400
|
-
cp = b & 0x1fu; n = 2;
|
|
401
|
-
} else if ((b & 0xf0) == 0xe0) {
|
|
402
|
-
cp = b & 0x0fu; n = 3;
|
|
403
|
-
} else {
|
|
404
|
-
cp = b & 0x07u; n = 4;
|
|
405
|
-
}
|
|
406
|
-
if (n > len) n = len; /* defensive: strings are well-formed by contract */
|
|
407
|
-
for (size_t i = 1; i < n; i++) cp = (cp << 6) | (s[i] & 0x3fu);
|
|
408
|
-
*adv = n;
|
|
409
|
-
if (cp >= 0x10000) return 0xd800 + ((cp - 0x10000) >> 10);
|
|
410
|
-
return cp;
|
|
411
|
-
}
|
|
412
|
-
|
|
426
|
+
/* UTF-16 ordering over well-formed UTF-8. Equal bytes can be skipped even
|
|
427
|
+
* inside a multibyte character: unequal continuation bytes preserve code
|
|
428
|
+
* point order. Only differing lead bytes for U+E000..U+FFFF versus a
|
|
429
|
+
* supplementary character reverse byte order, because the latter starts
|
|
430
|
+
* with a UTF-16 high surrogate below U+E000. */
|
|
413
431
|
int scr_str_cmp_u16(ScrStr *a, ScrStr *b) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
(i == 0 ? (unsigned char)b->data[ib] & 0x07u
|
|
432
|
-
: (unsigned char)b->data[ib + i] & 0x3fu);
|
|
433
|
-
}
|
|
434
|
-
if (cpa != cpb) return cpa < cpb ? -1 : 1;
|
|
435
|
-
}
|
|
436
|
-
ia += na;
|
|
437
|
-
ib += nb;
|
|
438
|
-
}
|
|
439
|
-
if (ia < a->len) return 1;
|
|
440
|
-
if (ib < b->len) return -1;
|
|
441
|
-
return 0;
|
|
432
|
+
if (a == b) return 0;
|
|
433
|
+
size_t common = a->len < b->len ? a->len : b->len;
|
|
434
|
+
size_t i = 0;
|
|
435
|
+
while (common - i >= sizeof(uint64_t)) {
|
|
436
|
+
uint64_t left, right;
|
|
437
|
+
memcpy(&left, a->data + i, sizeof(left));
|
|
438
|
+
memcpy(&right, b->data + i, sizeof(right));
|
|
439
|
+
if (left != right) break;
|
|
440
|
+
i += sizeof(left);
|
|
441
|
+
}
|
|
442
|
+
while (i < common && a->data[i] == b->data[i]) i++;
|
|
443
|
+
if (i == common) return (a->len > b->len) - (a->len < b->len);
|
|
444
|
+
unsigned char left = (unsigned char)a->data[i];
|
|
445
|
+
unsigned char right = (unsigned char)b->data[i];
|
|
446
|
+
if (left >= 0xf0 && right >= 0xee && right <= 0xef) return -1;
|
|
447
|
+
if (right >= 0xf0 && left >= 0xee && left <= 0xef) return 1;
|
|
448
|
+
return left < right ? -1 : 1;
|
|
442
449
|
}
|
|
443
450
|
|
|
444
451
|
/* ── interned strings ─────────────────────────────────────────────────
|
|
@@ -779,9 +786,14 @@ static size_t scr_sidx_abs_diff(size_t a, size_t b) {
|
|
|
779
786
|
* sufficient; the hot cursor retains sequential-access locality. */
|
|
780
787
|
static ScrSidxPoint scr_sidx_near_u16(const ScrStr *s, const ScrSidx *e,
|
|
781
788
|
size_t u16) {
|
|
789
|
+
/* A nearby cursor already bounds the walk. Searching the complete index
|
|
790
|
+
* first would make each sequential read depend on the receiver's size. */
|
|
791
|
+
if (e->cb <= s->len && scr_sidx_abs_diff(e->cu, u16) <= 16)
|
|
792
|
+
return (ScrSidxPoint){e->cu, e->cb};
|
|
782
793
|
ScrSidxPoint best = {0, 0};
|
|
783
794
|
size_t best_dist = u16;
|
|
784
795
|
if (e->npoints != 0) {
|
|
796
|
+
SCR_SIDX_SEARCH();
|
|
785
797
|
size_t lo = 0, hi = e->npoints;
|
|
786
798
|
while (lo < hi) {
|
|
787
799
|
size_t m = lo + (hi - lo) / 2;
|
|
@@ -812,9 +824,12 @@ static ScrSidxPoint scr_sidx_near_u16(const ScrStr *s, const ScrSidx *e,
|
|
|
812
824
|
|
|
813
825
|
static ScrSidxPoint scr_sidx_near_byte(const ScrStr *s, const ScrSidx *e,
|
|
814
826
|
size_t byte_off) {
|
|
827
|
+
if (e->cb <= s->len && scr_sidx_abs_diff(e->cb, byte_off) <= 16)
|
|
828
|
+
return (ScrSidxPoint){e->cu, e->cb};
|
|
815
829
|
ScrSidxPoint best = {0, 0};
|
|
816
830
|
size_t best_dist = byte_off;
|
|
817
831
|
if (e->npoints != 0) {
|
|
832
|
+
SCR_SIDX_SEARCH();
|
|
818
833
|
size_t lo = 0, hi = e->npoints;
|
|
819
834
|
while (lo < hi) {
|
|
820
835
|
size_t m = lo + (hi - lo) / 2;
|
|
@@ -843,6 +858,36 @@ static ScrSidxPoint scr_sidx_near_byte(const ScrStr *s, const ScrSidx *e,
|
|
|
843
858
|
return best;
|
|
844
859
|
}
|
|
845
860
|
|
|
861
|
+
/* Cache only a bounded ASCII run at a resolved boundary. Local scans then
|
|
862
|
+
* use arithmetic even inside a mixed string. The bytes are immutable except
|
|
863
|
+
* for append, which preserves this prefix; eviction/reallocation clears the
|
|
864
|
+
* whole entry. No scan reads outside the receiver or allocates metadata. */
|
|
865
|
+
static void scr_sidx_ascii_run(const ScrStr *s, ScrSidx *e) {
|
|
866
|
+
size_t start = e->cb, end = start;
|
|
867
|
+
/* Center the window on the access so reverse scans reuse it too. A
|
|
868
|
+
* forward-only window would rescan its full width on every backward read. */
|
|
869
|
+
size_t lower = start < 128 ? 0 : start - 128;
|
|
870
|
+
while (start - lower >= 8) {
|
|
871
|
+
uint64_t word;
|
|
872
|
+
memcpy(&word, s->data + start - 8, 8);
|
|
873
|
+
if (word & UINT64_C(0x8080808080808080)) break;
|
|
874
|
+
start -= 8;
|
|
875
|
+
}
|
|
876
|
+
while (start > lower && (unsigned char)s->data[start - 1] < 0x80) start--;
|
|
877
|
+
size_t remaining = s->len - end;
|
|
878
|
+
size_t limit = end + (remaining < 128 ? remaining : 128);
|
|
879
|
+
while (limit - end >= 8) {
|
|
880
|
+
uint64_t word;
|
|
881
|
+
memcpy(&word, s->data + end, 8);
|
|
882
|
+
if (word & UINT64_C(0x8080808080808080)) break;
|
|
883
|
+
end += 8;
|
|
884
|
+
}
|
|
885
|
+
while (end < limit && (unsigned char)s->data[end] < 0x80) end++;
|
|
886
|
+
e->ascii_cu = e->cu - (e->cb - start);
|
|
887
|
+
e->ascii_cb = start;
|
|
888
|
+
e->ascii_end = end;
|
|
889
|
+
}
|
|
890
|
+
|
|
846
891
|
/* Convert a UTF-16 index to a byte offset from the closest sparse anchor or
|
|
847
892
|
* hot cursor. If u16 addresses the second (low-surrogate) unit of
|
|
848
893
|
* an astral char, *mid is set and the returned offset is the START of that
|
|
@@ -854,6 +899,12 @@ static size_t scr_u16_to_byte_c(const ScrStr *s, ScrSidx *e, size_t u16,
|
|
|
854
899
|
*mid = false;
|
|
855
900
|
return u16 < s->len ? u16 : s->len;
|
|
856
901
|
}
|
|
902
|
+
if (u16 >= e->ascii_cu && u16 - e->ascii_cu < e->ascii_end - e->ascii_cb) {
|
|
903
|
+
e->cb = e->ascii_cb + (u16 - e->ascii_cu);
|
|
904
|
+
e->cu = u16;
|
|
905
|
+
*mid = false;
|
|
906
|
+
return e->cb;
|
|
907
|
+
}
|
|
857
908
|
scr_sidx_extend_to_u16(s, e, u16);
|
|
858
909
|
/* Extending a far-end lookup can just have proved identity. Do not
|
|
859
910
|
* materialize an index that the identity fast path will never consult. */
|
|
@@ -864,9 +915,31 @@ static size_t scr_u16_to_byte_c(const ScrStr *s, ScrSidx *e, size_t u16,
|
|
|
864
915
|
scr_sidx_materialize_identity_prefix(s, e);
|
|
865
916
|
ScrSidxPoint near = scr_sidx_near_u16(s, e, u16);
|
|
866
917
|
size_t cu = near.cu, cb = near.cb;
|
|
867
|
-
while (cu > u16)
|
|
918
|
+
while (cu > u16) {
|
|
919
|
+
/* Eight bytes starting inside a sequence can reach back at most three
|
|
920
|
+
* more bytes to its lead. Such a span contains at most nine UTF-16
|
|
921
|
+
* units (seven ASCII bytes plus an astral pair), so it cannot overshoot
|
|
922
|
+
* a target at least nine units away. */
|
|
923
|
+
if (cu - u16 >= 9 && cb >= 8) {
|
|
924
|
+
size_t start = cb - 8;
|
|
925
|
+
while (start > 0 && ((unsigned char)s->data[start] & 0xC0) == 0x80)
|
|
926
|
+
start--;
|
|
927
|
+
cu -= scr_utf16_units_span(s->data + start, cb - start, NULL);
|
|
928
|
+
cb = start;
|
|
929
|
+
} else {
|
|
930
|
+
scr_sidx_back(s, &cu, &cb);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
868
933
|
bool m = false;
|
|
869
934
|
while (cu < u16 && cb < s->len) {
|
|
935
|
+
if (u16 - cu >= 9 && s->len - cb >= 8) {
|
|
936
|
+
size_t end = cb + 8;
|
|
937
|
+
while (end < s->len && ((unsigned char)s->data[end] & 0xC0) == 0x80)
|
|
938
|
+
end++;
|
|
939
|
+
cu += scr_utf16_units_span(s->data + cb, end - cb, NULL);
|
|
940
|
+
cb = end;
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
870
943
|
SCR_SIDX_STEP();
|
|
871
944
|
size_t seq = scr_utf8_seq_len((unsigned char)s->data[cb]);
|
|
872
945
|
size_t w = seq == 4 ? 2 : 1;
|
|
@@ -879,6 +952,8 @@ static size_t scr_u16_to_byte_c(const ScrStr *s, ScrSidx *e, size_t u16,
|
|
|
879
952
|
}
|
|
880
953
|
e->cu = cu;
|
|
881
954
|
e->cb = cb;
|
|
955
|
+
if (cb < s->len && (unsigned char)s->data[cb] < 0x80)
|
|
956
|
+
scr_sidx_ascii_run(s, e);
|
|
882
957
|
*mid = m;
|
|
883
958
|
return cb;
|
|
884
959
|
}
|
|
@@ -888,6 +963,11 @@ static size_t scr_u16_to_byte_c(const ScrStr *s, ScrSidx *e, size_t u16,
|
|
|
888
963
|
static size_t scr_byte_to_u16_c(const ScrStr *s, ScrSidx *e,
|
|
889
964
|
size_t byte_off) {
|
|
890
965
|
if (e->u16len == s->len) return byte_off; /* all ASCII */
|
|
966
|
+
if (byte_off >= e->ascii_cb && byte_off < e->ascii_end) {
|
|
967
|
+
e->cu = e->ascii_cu + (byte_off - e->ascii_cb);
|
|
968
|
+
e->cb = byte_off;
|
|
969
|
+
return e->cu;
|
|
970
|
+
}
|
|
891
971
|
/* A byte search result may be far beyond the existing prefix. Build the
|
|
892
972
|
* same sparse intervals first, then choose the closest boundary anchor. */
|
|
893
973
|
if (byte_off > e->indexed_cb) {
|
|
@@ -900,15 +980,17 @@ static size_t scr_byte_to_u16_c(const ScrStr *s, ScrSidx *e,
|
|
|
900
980
|
scr_sidx_materialize_identity_prefix(s, e);
|
|
901
981
|
ScrSidxPoint near = scr_sidx_near_byte(s, e, byte_off);
|
|
902
982
|
size_t cu = near.cu, cb = near.cb;
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
983
|
+
/* Unlike unit-to-byte conversion, both endpoints are already exact byte
|
|
984
|
+
* boundaries. Count the whole span with the shared word-wise classifier. */
|
|
985
|
+
if (cb > byte_off)
|
|
986
|
+
cu -= scr_utf16_units_span(s->data + byte_off, cb - byte_off, NULL);
|
|
987
|
+
else
|
|
988
|
+
cu += scr_utf16_units_span(s->data + cb, byte_off - cb, NULL);
|
|
989
|
+
cb = byte_off;
|
|
910
990
|
e->cu = cu;
|
|
911
991
|
e->cb = cb;
|
|
992
|
+
if (cb < s->len && (unsigned char)s->data[cb] < 0x80)
|
|
993
|
+
scr_sidx_ascii_run(s, e);
|
|
912
994
|
return cu;
|
|
913
995
|
}
|
|
914
996
|
|
|
@@ -919,16 +1001,21 @@ static double scr_to_integer_or_infinity(double x) {
|
|
|
919
1001
|
return trunc(x);
|
|
920
1002
|
}
|
|
921
1003
|
|
|
922
|
-
/*
|
|
1004
|
+
/* Byte substring search (needle and hay are both well-formed UTF-8,
|
|
923
1005
|
* so any byte-level match starts on a char boundary — UTF-8 is
|
|
924
1006
|
* self-synchronizing). Empty needle matches at hay. */
|
|
925
1007
|
static const char *scr_byte_find(const char *hay, size_t hay_len,
|
|
926
1008
|
const char *nee, size_t nee_len) {
|
|
927
1009
|
if (nee_len == 0) return hay;
|
|
928
1010
|
if (nee_len > hay_len) return NULL;
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1011
|
+
if (nee_len == 1) return memchr(hay, (unsigned char)nee[0], hay_len);
|
|
1012
|
+
size_t remaining = hay_len - nee_len + 1;
|
|
1013
|
+
while (remaining) {
|
|
1014
|
+
const char *found = memchr(hay, (unsigned char)nee[0], remaining);
|
|
1015
|
+
if (!found) return NULL;
|
|
1016
|
+
if (memcmp(found + 1, nee + 1, nee_len - 1) == 0) return found;
|
|
1017
|
+
remaining -= (size_t)(found - hay) + 1;
|
|
1018
|
+
hay = found + 1;
|
|
932
1019
|
}
|
|
933
1020
|
return NULL;
|
|
934
1021
|
}
|
|
@@ -981,14 +1068,18 @@ double scr_str_char_code_at(ScrStr *s, double i) {
|
|
|
981
1068
|
|
|
982
1069
|
double scr_str_index_of(ScrStr *s, ScrStr *needle, double fromIndex) {
|
|
983
1070
|
double pos = scr_to_integer_or_infinity(fromIndex);
|
|
1071
|
+
if (needle->len > s->len) return -1.0;
|
|
984
1072
|
ScrSidx *e = scr_sidx(s);
|
|
985
|
-
size_t len16 = scr_sidx_len(s, e);
|
|
986
|
-
size_t start16 = pos <= 0 ? 0
|
|
987
|
-
: pos >= (double)len16 ? len16
|
|
988
|
-
: (size_t)pos;
|
|
989
1073
|
/* Per spec, the empty needle is found at the clamped fromIndex itself —
|
|
990
1074
|
* even when that index is between the halves of an astral pair. */
|
|
991
|
-
if (needle->len == 0)
|
|
1075
|
+
if (needle->len == 0) {
|
|
1076
|
+
size_t len16 = scr_sidx_len(s, e);
|
|
1077
|
+
return pos <= 0 ? 0 : pos >= (double)len16 ? (double)len16 : pos;
|
|
1078
|
+
}
|
|
1079
|
+
/* Byte length bounds UTF-16 length and fences the cast. Let the mapper
|
|
1080
|
+
* extend only as far as needed instead of indexing an unsearched suffix. */
|
|
1081
|
+
if (pos >= (double)s->len) return -1.0;
|
|
1082
|
+
size_t start16 = pos <= 0 ? 0 : (size_t)pos;
|
|
992
1083
|
bool mid;
|
|
993
1084
|
size_t start_b = scr_u16_to_byte_c(s, e, start16, &mid);
|
|
994
1085
|
/* A match can't begin on a low-surrogate half (needles are well-formed),
|
|
@@ -1001,11 +1092,11 @@ double scr_str_index_of(ScrStr *s, ScrStr *needle, double fromIndex) {
|
|
|
1001
1092
|
return (double)scr_byte_to_u16_c(s, e, (size_t)(found - s->data));
|
|
1002
1093
|
}
|
|
1003
1094
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
*
|
|
1095
|
+
static ScrStr *scr_str_slice_units(ScrStr *s, ScrSidx *e,
|
|
1096
|
+
size_t from, size_t to);
|
|
1097
|
+
|
|
1098
|
+
/* Normalize once, then share slice's extraction without another cache
|
|
1099
|
+
* lookup, length query or floating-point boundary conversion. */
|
|
1009
1100
|
ScrStr *scr_str_substring(ScrStr *s, double start, double end) {
|
|
1010
1101
|
ScrSidx *e = scr_sidx(s);
|
|
1011
1102
|
double len16 = (double)scr_sidx_len(s, e);
|
|
@@ -1013,7 +1104,8 @@ ScrStr *scr_str_substring(ScrStr *s, double start, double end) {
|
|
|
1013
1104
|
double b = scr_to_integer_or_infinity(end);
|
|
1014
1105
|
double fa = a < 0 ? 0 : a > len16 ? len16 : a;
|
|
1015
1106
|
double fb = b < 0 ? 0 : b > len16 ? len16 : b;
|
|
1016
|
-
return fa < fb ?
|
|
1107
|
+
return fa < fb ? scr_str_slice_units(s, e, (size_t)fa, (size_t)fb)
|
|
1108
|
+
: scr_str_slice_units(s, e, (size_t)fb, (size_t)fa);
|
|
1017
1109
|
}
|
|
1018
1110
|
|
|
1019
1111
|
bool scr_str_includes(ScrStr *s, ScrStr *needle) {
|
|
@@ -1037,22 +1129,27 @@ static size_t scr_str_clamp_u16_position(double position, size_t len16) {
|
|
|
1037
1129
|
}
|
|
1038
1130
|
|
|
1039
1131
|
bool scr_str_starts_with_from(ScrStr *s, ScrStr *needle, double position) {
|
|
1040
|
-
ScrSidx *e = scr_sidx(s);
|
|
1041
|
-
size_t len16 = scr_sidx_len(s, e);
|
|
1042
|
-
size_t start16 = scr_str_clamp_u16_position(position, len16);
|
|
1043
1132
|
if (needle->len == 0) return true;
|
|
1133
|
+
double pos = scr_to_integer_or_infinity(position);
|
|
1134
|
+
if (pos <= 0) return scr_str_starts_with(s, needle);
|
|
1135
|
+
if (pos >= (double)s->len || needle->len > s->len) return false;
|
|
1136
|
+
ScrSidx *e = scr_sidx(s);
|
|
1044
1137
|
bool mid;
|
|
1045
|
-
size_t start_byte = scr_u16_to_byte_c(s, e,
|
|
1138
|
+
size_t start_byte = scr_u16_to_byte_c(s, e, (size_t)pos, &mid);
|
|
1046
1139
|
return !mid && needle->len <= s->len - start_byte &&
|
|
1047
1140
|
memcmp(s->data + start_byte, needle->data, needle->len) == 0;
|
|
1048
1141
|
}
|
|
1049
1142
|
|
|
1050
1143
|
bool scr_str_ends_with_from(ScrStr *s, ScrStr *needle, double end_position) {
|
|
1144
|
+
if (needle->len == 0) return true;
|
|
1145
|
+
if (needle->len > s->len) return false;
|
|
1146
|
+
if (end_position >= (double)s->len) return scr_str_ends_with(s, needle);
|
|
1147
|
+
/* A second receiver lookup can evict the first receiver's entry. Resolve
|
|
1148
|
+
* the needle before borrowing the haystack entry for both conversions. */
|
|
1149
|
+
size_t needle16 = scr_sidx_len(needle, scr_sidx(needle));
|
|
1051
1150
|
ScrSidx *e = scr_sidx(s);
|
|
1052
1151
|
size_t len16 = scr_sidx_len(s, e);
|
|
1053
1152
|
size_t end16 = scr_str_clamp_u16_position(end_position, len16);
|
|
1054
|
-
size_t needle16 = scr_sidx_len(needle, scr_sidx(needle));
|
|
1055
|
-
if (needle16 == 0) return true;
|
|
1056
1153
|
if (needle16 > end16) return false;
|
|
1057
1154
|
bool start_mid, end_mid;
|
|
1058
1155
|
size_t start_byte = scr_u16_to_byte_c(s, e, end16 - needle16, &start_mid);
|
|
@@ -1077,7 +1174,46 @@ ScrStr *scr_str_slice(ScrStr *s, double start, double end) {
|
|
|
1077
1174
|
size_t len16 = scr_sidx_len(s, e);
|
|
1078
1175
|
size_t from = scr_slice_boundary(scr_to_integer_or_infinity(start), len16);
|
|
1079
1176
|
size_t to = scr_slice_boundary(scr_to_integer_or_infinity(end), len16);
|
|
1177
|
+
return scr_str_slice_units(s, e, from, to);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
void scr_str_slice_range(ScrStr *s, double start, double end, bool substring,
|
|
1181
|
+
ScrStringSlice *out) {
|
|
1182
|
+
ScrSidx *e = scr_sidx(s);
|
|
1183
|
+
size_t length = scr_sidx_len(s, e);
|
|
1184
|
+
double a = scr_to_integer_or_infinity(start), b = scr_to_integer_or_infinity(end);
|
|
1185
|
+
size_t from, to;
|
|
1186
|
+
if (substring) {
|
|
1187
|
+
from = a <= 0 ? 0 : a >= (double)length ? length : (size_t)a;
|
|
1188
|
+
to = b <= 0 ? 0 : b >= (double)length ? length : (size_t)b;
|
|
1189
|
+
if (from > to) { size_t swap = from; from = to; to = swap; }
|
|
1190
|
+
} else {
|
|
1191
|
+
from = scr_slice_boundary(a, length);
|
|
1192
|
+
to = scr_slice_boundary(b, length);
|
|
1193
|
+
}
|
|
1194
|
+
out->start = from;
|
|
1195
|
+
out->length = to > from ? to - from : 0;
|
|
1196
|
+
out->split = 0;
|
|
1197
|
+
if (out->length) {
|
|
1198
|
+
bool first, last;
|
|
1199
|
+
(void)scr_u16_to_byte_c(s, e, from, &first);
|
|
1200
|
+
(void)scr_u16_to_byte_c(s, e, to, &last);
|
|
1201
|
+
out->split = (first ? 1u : 0u) | (last ? 2u : 0u);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
double scr_str_slice_char_code_at(ScrStr *s, const ScrStringSlice *range, double index) {
|
|
1206
|
+
double unit = scr_to_integer_or_infinity(index);
|
|
1207
|
+
if (!(unit >= 0) || unit >= (double)range->length) return NAN;
|
|
1208
|
+
if ((unit == 0 && (range->split & 1u)) ||
|
|
1209
|
+
(unit == (double)(range->length - 1) && (range->split & 2u))) return 0xFFFD;
|
|
1210
|
+
return scr_str_char_code_at(s, (double)range->start + unit);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
static ScrStr *scr_str_slice_units(ScrStr *s, ScrSidx *e,
|
|
1214
|
+
size_t from, size_t to) {
|
|
1080
1215
|
if (from >= to) return scr_str_empty();
|
|
1216
|
+
if (from == 0 && to == e->u16len) return scr_str_retain(s);
|
|
1081
1217
|
|
|
1082
1218
|
bool from_mid, to_mid;
|
|
1083
1219
|
size_t from_b = scr_u16_to_byte_c(s, e, from, &from_mid);
|
|
@@ -1087,24 +1223,28 @@ ScrStr *scr_str_slice(ScrStr *s, double start, double end) {
|
|
|
1087
1223
|
size_t content_b = from_mid ? from_b + 4 : from_b;
|
|
1088
1224
|
size_t content_len = to_b - content_b;
|
|
1089
1225
|
|
|
1090
|
-
if (!from_mid && !to_mid)
|
|
1091
|
-
|
|
1226
|
+
if (!from_mid && !to_mid) {
|
|
1227
|
+
ScrStr *result = scr_str_from_span(s->data + from_b, content_len);
|
|
1228
|
+
/* Unit boundaries already prove the exact output length. Preserve it
|
|
1229
|
+
* instead of decoding a potentially megabyte-sized copy on .length.
|
|
1230
|
+
* Index checkpoints remain lazy and owned by the result's cache slot. */
|
|
1231
|
+
if (content_len >= SCR_SIDX_MIN_BYTES) scr_sidx(result)->u16len = to - from;
|
|
1232
|
+
return result;
|
|
1233
|
+
}
|
|
1092
1234
|
|
|
1093
1235
|
/* Divergence: JS would emit the lone surrogate half; we emit U+FFFD. */
|
|
1094
1236
|
size_t total = content_len + (from_mid ? SCR_REPLACEMENT_LEN : 0) +
|
|
1095
1237
|
(to_mid ? SCR_REPLACEMENT_LEN : 0);
|
|
1096
|
-
|
|
1097
|
-
if (!tmp) scr_oom();
|
|
1238
|
+
ScrStr *r = scr_str_alloc(total, total);
|
|
1098
1239
|
size_t o = 0;
|
|
1099
1240
|
if (from_mid) {
|
|
1100
|
-
memcpy(
|
|
1241
|
+
memcpy(r->data + o, SCR_REPLACEMENT, SCR_REPLACEMENT_LEN);
|
|
1101
1242
|
o += SCR_REPLACEMENT_LEN;
|
|
1102
1243
|
}
|
|
1103
|
-
memcpy(
|
|
1244
|
+
memcpy(r->data + o, s->data + content_b, content_len);
|
|
1104
1245
|
o += content_len;
|
|
1105
|
-
if (to_mid) memcpy(
|
|
1106
|
-
|
|
1107
|
-
free(tmp);
|
|
1246
|
+
if (to_mid) memcpy(r->data + o, SCR_REPLACEMENT, SCR_REPLACEMENT_LEN);
|
|
1247
|
+
r->data[total] = '\0';
|
|
1108
1248
|
return r;
|
|
1109
1249
|
}
|
|
1110
1250
|
|
|
@@ -1213,6 +1353,9 @@ ScrStr *scr_str_trim_end(ScrStr *s) {
|
|
|
1213
1353
|
static const struct { size_t rc; size_t len; size_t cap; char data[4]; }
|
|
1214
1354
|
scr_lit_fffd = {SIZE_MAX, 3, 3, "\xEF\xBF\xBD"};
|
|
1215
1355
|
|
|
1356
|
+
/* Split owns a fresh array and appends only present string values. Fill an
|
|
1357
|
+
* available dense slot directly; ordinary push handles growth and the sparse
|
|
1358
|
+
* boundary. The array remains valid after every append, including RC audit. */
|
|
1216
1359
|
/* split(separator, limit) with a STRING separator (ECMA-262 22.1.3.23):
|
|
1217
1360
|
* limit is ToUint32'd; zero returns [] and reaching the limit stops before
|
|
1218
1361
|
* any later separator probes. The no-limit wrapper supplies 2^32-1.
|
|
@@ -1225,38 +1368,119 @@ static const struct { size_t rc; size_t len; size_t cap; char data[4]; }
|
|
|
1225
1368
|
* yield the two lone surrogate halves, each half is U+FFFD here
|
|
1226
1369
|
* (divergence 2 — the same substitution the island's boundary marshal
|
|
1227
1370
|
* applied). Borrows both; returns a +1 string[]. */
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1371
|
+
void scr_str_split_cursor_init(ScrSplitCursor *cursor, uint32_t limit) {
|
|
1372
|
+
cursor->offset = 0;
|
|
1373
|
+
cursor->remaining = limit;
|
|
1374
|
+
cursor->pending_unit = 0;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
static ScrStr *scr_str_split_piece(const char *bytes, size_t len, ScrStr **scratch) {
|
|
1378
|
+
if (!scratch || len <= 4) return scr_str_from_span(bytes, len);
|
|
1379
|
+
ScrStr *piece = *scratch;
|
|
1380
|
+
if (piece && piece->rc == 1 && piece->cap >= len) {
|
|
1381
|
+
/* The scratch owner is the only remaining reference. Invalidate all
|
|
1382
|
+
* metadata before replacing bytes, just as unique concatenation does. */
|
|
1383
|
+
scr_short_forget(piece);
|
|
1384
|
+
scr_sidx_purge(piece);
|
|
1385
|
+
memcpy(piece->data, bytes, len);
|
|
1386
|
+
piece->len = len;
|
|
1387
|
+
piece->data[len] = '\0';
|
|
1388
|
+
} else {
|
|
1389
|
+
ScrStr *fresh = scr_str_alloc_raw(len, len < 64 ? 64 : len);
|
|
1390
|
+
memcpy(fresh->data, bytes, len);
|
|
1391
|
+
fresh->data[len] = '\0';
|
|
1392
|
+
*scratch = fresh;
|
|
1393
|
+
scr_str_release(piece);
|
|
1394
|
+
piece = fresh;
|
|
1395
|
+
}
|
|
1396
|
+
return scr_str_retain(piece);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/* Both eager and loop consumers use the same boundary state machine.
|
|
1400
|
+
* Eager consumers select the unit/substring path once before their loop. */
|
|
1401
|
+
static const char *scr_str_split_span(ScrStr *s, ScrStr *sep,
|
|
1402
|
+
ScrSplitCursor *cursor, bool units,
|
|
1403
|
+
size_t *len) {
|
|
1404
|
+
if (cursor->remaining == 0 || cursor->offset > s->len) return NULL;
|
|
1405
|
+
if (units) {
|
|
1406
|
+
if (cursor->pending_unit) {
|
|
1407
|
+
cursor->pending_unit = 0;
|
|
1408
|
+
cursor->remaining--;
|
|
1409
|
+
*len = 3;
|
|
1410
|
+
return scr_lit_fffd.data;
|
|
1246
1411
|
}
|
|
1247
|
-
return
|
|
1248
|
-
|
|
1249
|
-
|
|
1412
|
+
if (cursor->offset == s->len) return NULL;
|
|
1413
|
+
size_t start = cursor->offset, adv;
|
|
1414
|
+
uint32_t cp = scr_utf8_decode(s->data + start, &adv);
|
|
1415
|
+
cursor->offset += adv;
|
|
1416
|
+
cursor->remaining--;
|
|
1417
|
+
if (cp >= 0x10000) {
|
|
1418
|
+
cursor->pending_unit = 1;
|
|
1419
|
+
*len = 3;
|
|
1420
|
+
return scr_lit_fffd.data;
|
|
1421
|
+
}
|
|
1422
|
+
*len = adv;
|
|
1423
|
+
return s->data + start;
|
|
1424
|
+
}
|
|
1425
|
+
size_t start = cursor->offset;
|
|
1426
|
+
const char *found = scr_byte_find(s->data + start, s->len - start,
|
|
1427
|
+
sep->data, sep->len);
|
|
1428
|
+
size_t end = found ? (size_t)(found - s->data) : s->len;
|
|
1429
|
+
/* String allocations reserve the header and terminator, so len + 1
|
|
1430
|
+
* cannot overflow. This sentinel includes a final empty trailing piece. */
|
|
1431
|
+
cursor->offset = found ? end + sep->len : s->len + 1;
|
|
1432
|
+
cursor->remaining--;
|
|
1433
|
+
*len = end - start;
|
|
1434
|
+
return s->data + start;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/* The source snapshot owns these bytes through the current iteration.
|
|
1438
|
+
* A consumer that stores or otherwise exposes the piece materializes it
|
|
1439
|
+
* with ordinary string ownership instead. */
|
|
1440
|
+
const char *scr_str_split_cursor_span(ScrStr *s, ScrStr *sep, ScrSplitCursor *cursor,
|
|
1441
|
+
size_t *length) {
|
|
1442
|
+
return scr_str_split_span(s, sep, cursor, sep->len == 0, length);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
ScrStr *scr_str_split_materialize(const char *bytes, size_t length, ScrStr **scratch) {
|
|
1446
|
+
return scr_str_split_piece(bytes, length, scratch);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
ScrStr *scr_str_split_cursor_next(ScrStr *s, ScrStr *sep, ScrSplitCursor *cursor,
|
|
1450
|
+
ScrStr **scratch) {
|
|
1451
|
+
size_t len;
|
|
1452
|
+
const char *bytes = scr_str_split_span(s, sep, cursor, sep->len == 0, &len);
|
|
1453
|
+
if (!bytes) return NULL;
|
|
1454
|
+
if (bytes == scr_lit_fffd.data) return scr_str_retain((ScrStr *)&scr_lit_fffd);
|
|
1455
|
+
return scr_str_split_piece(bytes, len, scratch);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/* Move a bounded batch of pieces into array storage in one operation.
|
|
1459
|
+
* This avoids a second separator scan and preserves sparse overflow. */
|
|
1460
|
+
static void scr_str_split_fill(ScrArr *out, ScrStr *s, ScrStr *sep,
|
|
1461
|
+
ScrSplitCursor *cursor, bool units) {
|
|
1462
|
+
uint64_t slots[64];
|
|
1250
1463
|
for (;;) {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1464
|
+
size_t count = 0, len;
|
|
1465
|
+
const char *bytes;
|
|
1466
|
+
while (count < 64 && (bytes = scr_str_split_span(s, sep, cursor, units, &len))) {
|
|
1467
|
+
ScrStr *piece = bytes == scr_lit_fffd.data
|
|
1468
|
+
? scr_str_retain((ScrStr *)&scr_lit_fffd)
|
|
1469
|
+
: scr_str_from_span(bytes, len);
|
|
1470
|
+
slots[count++] = (uint64_t)(uintptr_t)piece;
|
|
1471
|
+
}
|
|
1472
|
+
if (count) scr_arr_push_many(out, count, slots);
|
|
1473
|
+
if (count < 64) return;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
ScrArr *scr_str_split_limit(ScrStr *s, ScrStr *sep, double limit_num) {
|
|
1478
|
+
uint32_t limit = scr_to_uint32(limit_num);
|
|
1479
|
+
ScrArr *out = scr_arr_new(SCR_ELEM_STR, 0);
|
|
1480
|
+
ScrSplitCursor cursor;
|
|
1481
|
+
scr_str_split_cursor_init(&cursor, limit);
|
|
1482
|
+
if (sep->len == 0) scr_str_split_fill(out, s, sep, &cursor, true);
|
|
1483
|
+
else scr_str_split_fill(out, s, sep, &cursor, false);
|
|
1260
1484
|
return out;
|
|
1261
1485
|
}
|
|
1262
1486
|
|