feat(lexer): 添加SCC语言扩展关键字支持并重构标准定义
- 将SCC_CEXT_ASM重命名为SCC_CEXT_SCC以更好地反映扩展类型 - 为asm关键字添加SCC_CEXT_SCC标准标识 - 新增atomic、auto、bool、complex四个关键字及其对应的token类型 - 所有新关键字都标记为SCC_CEXT_SCC扩展标准 fix(lexer): 修复数字字面量解析中的类型不匹配问题 - 将token->value.n更正为token->value.u以正确存储解析结果 - 统一了词法分析器中数值解析的字段访问 refactor(log): 重构日志系统API设计并增强功能 - 将日志处理器接口从void返回改为int返回类型 - 新增函数名记录功能,通过__func__宏获取当前函数名 - 引入可变参数支持,允许格式化字符串传递 - 重构内部宏实现,使用SCC_LOG_IMPL统一处理逻辑 - 改进缓冲区管理,优化日志消息格式化流程 - 重命名头文件保护宏从__SCC_LOG_H__到__SCC_LOG_IMPL_H__ - 替换snprintf为vsnprintf以支持可变参数处理 - 更新断言宏实现,提供更清晰的错误信息格式
This commit is contained in:
0
runtime/scc_core/src/cfg.bale_metal.c
Normal file
0
runtime/scc_core/src/cfg.bale_metal.c
Normal file
@@ -2,10 +2,11 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#define __SCC_CORE_FMT_IMPL__
|
||||
#include <scc_core_impl.h>
|
||||
#define __SCC_LOG_IMPORT_SRC__
|
||||
#define log_snprintf scc_snprintf
|
||||
#define log_printf scc_printf
|
||||
#define __SCC_LOG_IMPL_IMPORT_SRC__
|
||||
#define log_vsnprintf vsnprintf_
|
||||
#define log_puts(str) scc_printf("%s", str)
|
||||
#define log_exit scc_exit
|
||||
#include <log.h>
|
||||
|
||||
@@ -15,6 +16,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void putchar_(char c) { putchar(c); }
|
||||
/* ====== 内存管理核心接口实现 ====== */
|
||||
|
||||
void *scc_malloc(usize size) { return malloc(size); }
|
||||
@@ -71,15 +73,6 @@ cbool scc_fexists(const char *path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ====== 输入输出核心接口实现 ====== */
|
||||
|
||||
void scc_snprintf(char *buf, usize size, const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsnprintf(buf, size, format, args); // NOLINT
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void scc_printf(const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
Reference in New Issue
Block a user