refactor: 重构前端代码并添加日志功能
- 重命名和重构了多个文件,包括 lexer、parser 和 AST 相关代码 - 添加了日志功能,使用 LOG_* 宏替代原有的 error 和 warn 函数 - 优化了错误处理和内存分配方式 - 调整了代码结构,提高了模块化和可读性
This commit is contained in:
0
lib/test/test.py
Normal file
0
lib/test/test.py
Normal file
0
lib/test/test_alloc..c
Normal file
0
lib/test/test_alloc..c
Normal file
15
lib/test/test_log.c
Normal file
15
lib/test/test_log.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <lib/core.h>
|
||||
|
||||
int main(void) {
|
||||
// make -C ..
|
||||
// gcc -g -Wall -I../.. test_log.c -L.. -lcore -o test_log
|
||||
// ./test_log
|
||||
init_lib_core();
|
||||
|
||||
LOG_NOTSET("Log notset");
|
||||
LOG_DEBUG("Log debug");
|
||||
LOG_INFO("Log info");
|
||||
LOG_WARN("Log warn");
|
||||
LOG_ERROR("Log error");
|
||||
LOG_FATAL("Log fatal");
|
||||
}
|
Reference in New Issue
Block a user