feat(parser): 改进解析器错误处理和表达式解析逻辑
- 在初始化解析中添加缺失的赋值操作符检查 - 改进后缀表达式解析逻辑,处理嵌套情况 - 添加数组下标初始化的赋值操作符验证 - 修复主表达式解析中的返回语句处理 refactor(pproc): 优化预处理器宏展开和位置追踪 - 添加token复制函数来保持原始位置信息 - 重构宏展开函数参数传递方式 - 修复字符串化参数的位置信息处理 - 改进可变参数宏的处理逻辑 test(parser): 增加标签语句和字符串字面量测试用例 - 添加返回语句with复合字面量的测试 - 增加标签继续语句的测试用例 - 添加字符串连接的解析测试 test(pproc): 添加预处理器位置追踪测试 - 增加双重宏定义位置追踪测试 - 添加带参数宏定义位置追踪测试 - 增加字符串化操作位置追踪测试 docs: 更新代码中的宏定义和注释 - 修正未定义标识符的拼写错误 - 添加必要的头文件包含 - 改进错误消息提示文本
This commit is contained in:
@@ -18,13 +18,13 @@
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__ // GCC, Clang
|
||||
#define __smcc_log_unreachable() (__builtin_unreachable())
|
||||
#define __scc_log_unreachable() (__builtin_unreachable())
|
||||
#elif defined _MSC_VER // MSVC
|
||||
#define __smcc_log_unreachable() (__assume(false))
|
||||
#elif defined __SCC_BUILT_IN__ // The SCC Compiler (my compiler)
|
||||
#define __smcc_log_unreachable() (__smcc_builtin_unreachable())
|
||||
#define __scc_log_unreachable() (__assume(false))
|
||||
#elif defined __SCC_BUILTIN__ // The SCC Compiler (my compiler)
|
||||
#define __scc_log_unreachable() (__scc_builtin_unreachable())
|
||||
#else
|
||||
#define __smcc_log_unreachable()
|
||||
#define __scc_log_unreachable() ((void)0)
|
||||
#endif
|
||||
|
||||
#ifndef log_vsnprintf
|
||||
@@ -155,7 +155,7 @@ void log_set_handler(logger_t *logger, log_handler handler);
|
||||
((void)((cond) || \
|
||||
(__default_logger_root.handler(SCC_LOG_HANDLE_ARGS( \
|
||||
&__default_logger_root, LOG_LEVEL_FATAL, __VA_ARGS__)), \
|
||||
log_exit(1), __smcc_log_unreachable(), 0)))
|
||||
log_exit(1), __scc_log_unreachable(), 0)))
|
||||
|
||||
/// @name 断言工具宏
|
||||
/// @{
|
||||
|
||||
@@ -211,4 +211,8 @@ static inline char *scc_cstring_move_cstr(scc_cstring_t *str) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline scc_cstring_t scc_cstring_move(scc_cstring_t *str) {
|
||||
return scc_cstring_from_cstr(scc_cstring_move_cstr(str));
|
||||
}
|
||||
|
||||
#endif /* __SCC_CORE_STR_H__ */
|
||||
|
||||
@@ -58,6 +58,10 @@ typedef double f64;
|
||||
|
||||
typedef bool cbool;
|
||||
|
||||
#ifndef null
|
||||
#define null NULL
|
||||
#endif
|
||||
|
||||
/* clang-format on */
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user