PazeE 编译器(.NET 8/C# 实现),直接生成原生 x64/ARM64 机器码,无需 gcc/clang/nasm。 主要特性: - 词法/语法/语义分析、AST 生成、代码生成 - 目标平台:Windows (PE32+)、Linux (ELF64)、macOS (Mach-O 64)、Los4 - 架构:AMD64 与 ARM64 独立后端 - C 语法特性:匿名结构体/联合、位域、灵活数组成员、语句表达式+typeof - printf 颜色格式化、time.get.utc 时区支持 - GUI 支持:Windows (Win11 API)、Los4、Linux (X11)、macOS (ObjC) - Windows GUI 程序无控制台窗口(PE 子系统自动检测) - WiX Bundle 安装器(仅输出 .exe,MSI 作为中间产物内嵌)
22 行
657 B
Plaintext
22 行
657 B
Plaintext
/* printf 颜色集成测试:color 参数作为修饰符包装格式串为 ANSI 24-bit 转义码 */
|
|
int printf(const char *fmt, ...);
|
|
|
|
int main(void) {
|
|
/* 命名颜色 */
|
|
printf("Red text\n", color.red);
|
|
printf("Green text\n", color.green);
|
|
printf("Blue text\n", color.blue);
|
|
printf("Yellow text\n", color.yellow);
|
|
printf("Cyan text\n", color.cyan);
|
|
|
|
/* RGB 直接指定 */
|
|
printf("Orange text\n", color.255.165.0);
|
|
printf("Custom purple\n", color.128.0.128);
|
|
|
|
/* 带格式化参数 + 颜色 */
|
|
printf("Value = %d\n", color.green, 42);
|
|
printf("Hex = %x, Dec = %d\n", color.cyan, 255, 255);
|
|
|
|
return 0;
|
|
}
|