- 重命名和重构了多个文件,包括 lexer、parser 和 AST 相关代码 - 添加了日志功能,使用 LOG_* 宏替代原有的 error 和 warn 函数 - 优化了错误处理和内存分配方式 - 调整了代码结构,提高了模块化和可读性
34 lines
882 B
C
34 lines
882 B
C
#ifndef __SMCC_TERMINAL_COLOR_H__
|
|
#define __SMCC_TERMINAL_COLOR_H__
|
|
|
|
#define ANSI_FG_BLACK "\33[30m"
|
|
#define ANSI_FG_RED "\33[31m"
|
|
#define ANSI_FG_GREEN "\33[32m"
|
|
#define ANSI_FG_YELLOW "\33[33m"
|
|
#define ANSI_FG_BLUE "\33[34m"
|
|
#define ANSI_FG_MAGENTA "\33[35m"
|
|
#define ANSI_FG_CYAN "\33[36m"
|
|
#define ANSI_FG_WHITE "\33[37m"
|
|
|
|
#define ANSI_BG_BLACK "\33[40m"
|
|
#define ANSI_BG_RED "\33[41m"
|
|
#define ANSI_BG_GREEN "\33[42m"
|
|
#define ANSI_BG_YELLOW "\33[43m"
|
|
#define ANSI_BG_BLUE "\33[44m"
|
|
#define ANSI_BG_MAGENTA "\33[35m"
|
|
#define ANSI_BG_CYAN "\33[46m"
|
|
#define ANSI_BG_WHITE "\33[47m"
|
|
|
|
#define ANSI_UNDERLINED "\33[4m"
|
|
#define ANSI_BOLD "\33[1m"
|
|
#define ANSI_NONE "\33[0m"
|
|
|
|
// Maybe Some Terminal Doesn't Support Color
|
|
#ifndef ANSI_FMT_DISABLE
|
|
#define ANSI_FMT(str, fmt) fmt str ANSI_NONE
|
|
#else
|
|
#define ANSI_FMT(str, fmt) str
|
|
#endif
|
|
|
|
#endif
|