- 将scc_ast_node_type_t重命名为scc_ast_node_kind_t以提高语义清晰度 - 为scc_ast_node结构体添加名称定义 - 更新所有相关头文件中的类型引用 - 实现数组下标表达式的IR转换逻辑 - 添加对sizeof和alignof表达式的基本支持 fix(ast2ir): 修复表达式求值和类型处理问题 - 修复数组类型退化为指针的逻辑 - 修复变量声明初始化值检查条件 - 添加结构体和枚举类型的IR生成支持 - 移除未使用的代码段 refactor(ir): 完善IR上下文错误处理 - 为未处理的类型标签添加恐慌处理 - 修复联合类型的哈希计算 chore(build): 更新依赖项配置 - 修正lexer模块中的依赖项名称 style(parser): 清理解析器代码 - 移除未使用的类型哈希表 - 更新语义分析回调函数签名 - 添加属性语法的占位符实现 - 完善内存清理逻辑 test: 添加数组下标和枚举测试用例 - 新增15_array_subscript.c测试数组下标访问 - 新增16_enum.c测试枚举类型功能 - 更新期望结果配置文件
32 lines
1.6 KiB
C
32 lines
1.6 KiB
C
#ifndef __SCC_POS_LOG_H__
|
|
#define __SCC_POS_LOG_H__
|
|
|
|
#include "scc_pos.h"
|
|
#include <scc_core.h>
|
|
|
|
extern logger_t __scc_usr_log;
|
|
|
|
#define SCC_POS_LOG(level, pos, fmt, ...) \
|
|
do { \
|
|
char _full_msg[LOGGER_MAX_BUF_SIZE]; \
|
|
int _n = scc_snprintf(_full_msg, sizeof(_full_msg), \
|
|
scc_pos_pnt_fmt ": ", scc_pos_pnt_val(pos)); \
|
|
scc_snprintf(_full_msg + _n, sizeof(_full_msg) - _n, fmt, \
|
|
##__VA_ARGS__); \
|
|
__scc_usr_log.handler(&__scc_usr_log, level, nullptr, 0, nullptr, \
|
|
"%s", _full_msg); \
|
|
} while (0)
|
|
|
|
#define SCC_DEBUG(pos, fmt, ...) \
|
|
SCC_POS_LOG(LOG_LEVEL_DEBUG, pos, fmt, ##__VA_ARGS__)
|
|
#define SCC_INFO(pos, fmt, ...) \
|
|
SCC_POS_LOG(LOG_LEVEL_INFO, pos, fmt, ##__VA_ARGS__)
|
|
#define SCC_WARN(pos, fmt, ...) \
|
|
SCC_POS_LOG(LOG_LEVEL_WARN, pos, fmt, ##__VA_ARGS__)
|
|
#define SCC_ERROR(pos, fmt, ...) \
|
|
SCC_POS_LOG(LOG_LEVEL_ERROR, pos, fmt, ##__VA_ARGS__)
|
|
#define SCC_FATAL(pos, fmt, ...) \
|
|
SCC_POS_LOG(LOG_LEVEL_FATAL, pos, fmt, ##__VA_ARGS__)
|
|
|
|
#endif /* __SCC_POS_LOG_H__ */
|