feat(core): rename string and stream functions for clarity

- Rename `cstring_push` to `cstring_append_ch` and `cstring_push_cstr` to `cstring_append_cstr` for consistent naming with new `cstring_append` function
- Update all callers in lexer and tests to use new function names
- Rename stream `destroy` method to `drop` for consistency with resource management conventions
- Fix potential overflow in string capacity calculation by adjusting growth logic
This commit is contained in:
zzy
2025-12-09 18:04:53 +08:00
parent 36bff64a91
commit 186602a301
5 changed files with 28 additions and 16 deletions

View File

@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
core_mem_probe_stream_init(&mem_stream, buffer, fsize, false);
Assert(stream != null);
cstring_clear(&stream->name);
cstring_push_cstr(&stream->name, file_name, strlen(file_name));
cstring_append_cstr(&stream->name, file_name, strlen(file_name));
lexer_init(&lexer, stream);
lexer_tok_t tok;