Hydrogen-python/test6.hy
2025-06-12 14:52:25 +08:00

20 lines
352 B
Hy
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* test6带错误的语法测试用于验证报错机制*/
fn main() {
i32 x;
x = ; /* 错误:缺少右值 */
return x;
}
fn main1() {
int x;
x == 10; /* 错误:应为赋值 = */
return x;
}
fn main2() {
i32 x;
if (x) /* 错误if 条件必须是整型表达式 */
return 1;
return 0;
}