feat: rename core types to scc prefix for consistency

Updated type names from `core_*` to `scc_*` across lex_parser and stream modules to maintain naming consistency within the SCC codebase. This includes changes to function signatures and internal usage of types like `core_probe_stream_t`, `core_pos_t`, and `cstring_t` to their `scc_*` counterparts.
This commit is contained in:
zzy
2025-12-11 13:00:29 +08:00
parent 35c13ee30a
commit d88fa3b8d3
33 changed files with 741 additions and 745 deletions

View File

@@ -2,12 +2,13 @@
#include <lex_parser.h>
#include <utest/acutest.h>
cbool check_identifier(const char *str, const char *expect, cstring_t *output) {
cbool check_identifier(const char *str, const char *expect,
scc_cstring_t *output) {
log_set_level(&__default_logger_root, 0);
core_pos_t pos = core_pos_init();
core_mem_probe_stream_t mem_stream;
core_probe_stream_t *stream =
core_mem_probe_stream_init(&mem_stream, str, smcc_strlen(str), false);
scc_pos_t pos = scc_pos_init();
scc_mem_probe_stream_t mem_stream;
scc_probe_stream_t *stream =
scc_mem_probe_stream_init(&mem_stream, str, scc_strlen(str), false);
cbool ret = lex_parse_identifier(stream, &pos, output);
if (ret && expect) {
@@ -18,19 +19,19 @@ cbool check_identifier(const char *str, const char *expect, cstring_t *output) {
#define CHECK_IDENTIFIER_VALID(str, expect) \
do { \
cstring_t _output = cstring_new(); \
scc_cstring_t _output = scc_cstring_new(); \
cbool ret = check_identifier(str, expect, &_output); \
TEST_CHECK(ret == true); \
TEST_CHECK(strcmp(_output.data, expect) == 0); \
cstring_free(&_output); \
scc_cstring_free(&_output); \
} while (0)
#define CHECK_IDENTIFIER_INVALID(str) \
do { \
cstring_t _output = cstring_new(); \
scc_cstring_t _output = scc_cstring_new(); \
cbool ret = check_identifier(str, NULL, &_output); \
TEST_CHECK(ret == false); \
cstring_free(&_output); \
scc_cstring_free(&_output); \
} while (0)
void test_valid_identifier(void) {