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:
zzy
2026-01-28 15:44:24 +08:00
parent 84cff78b86
commit e1cd8c5206
12 changed files with 2035 additions and 157 deletions

View File

@@ -92,7 +92,7 @@ static void parse_line(scc_lexer_t *lexer, scc_lexer_tok_t *token) {
if (scc_probe_stream_consume(stream) != ' ') {
scc_lex_parse_skip_line(stream, &lexer->pos);
token->loc.line = token->value.n;
token->loc.line = token->value.u;
}
if (scc_probe_stream_next(stream) != '"') {
@@ -385,7 +385,7 @@ void scc_lexer_get_token(scc_lexer_t *lexer, scc_lexer_tok_t *token) {
scc_probe_stream_reset(stream);
if (scc_lex_parse_number(stream, &lexer->pos, &output) == true) {
scc_probe_stream_sync(stream);
token->value.n = output;
token->value.u = output;
} else {
LEX_ERROR("Unexpected number literal");
token->type = SCC_TOK_UNKNOWN;