feat(core): 重构词法分析器流接口并迁移至 core 库
将 lexer_stream 抽象为 core_stream,统一运行时核心组件的输入流模型。 移除了旧的 `lexer_stream.h` 定义,并将其功能完整迁移至 `core_stream.h` 中。 更新了内存流实现以适配新的 core_stream 接口,并修复部分资源释放问题。 同时调整日志模块包含方式,增强模块间解耦能力。 此变更影响词法分析器对输入流的操作方式,所有涉及 stream 的类型与函数均已替换为 core 前缀版本。 测试用例同步更新并验证通过。
This commit is contained in:
@@ -31,6 +31,10 @@ void log_default_handler(log_level_t level, const char* module, const char* file
|
||||
log_printf("[%s] %s:%d | %s: %s\n",
|
||||
level_str, file, line, module, message);
|
||||
#endif
|
||||
// for clangd warning
|
||||
// clang-analyzer-deadcode.DeadStores
|
||||
(void)color_code;
|
||||
(void)level_str;
|
||||
if (level & LOG_LEVEL_FATAL) {
|
||||
log_exit(-LOG_LEVEL_FATAL);
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "color.h"
|
||||
|
||||
#ifndef __SMCC_LOG_NO_STD_IMPL__
|
||||
#ifdef __SMCC_LOG_USE_STD_IMPL__
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define log_snprintf snprintf
|
||||
@@ -192,4 +192,8 @@ void logger_destroy(logger_t* logger);
|
||||
#define FIXME(str) PanicFmt("FIXME " __LOG_STR(str)) ///< 提醒开发者修改代码(触发致命错误)
|
||||
/// @}
|
||||
|
||||
#ifdef __SMCC_LOG_IMPORT_SRC__
|
||||
#include "log.c"
|
||||
#endif
|
||||
|
||||
#endif // __SMCC_LOG_H__
|
||||
|
||||
Reference in New Issue
Block a user