chore(syntax): DefineTest/FormatStringTest 迁移到 cif/defined() 条件编译
DefineTest 的条件编译用例(基础/elif-else/cifdef-cifndef/平台宏/嵌套/表达式/跨模块/守卫)全部改写为 cif-celif-celse + defined();FormatStringTest 的 isptr 判断由 c.CIf 改为 cif;README 同步新语法口径。
This commit is contained in:
1 parent
30b14bc477
commit
f5544eed80
3 files changed
+103
-101
No files matched your search
@@ -37,9 +37,9 @@ export def main() -> int:
|
||||
# &s is i8** (char**); implicit pointer casts require matching depth, so annotate str*.
|
||||
ptr_var: str* = &s
|
||||
val_var: int = 42
|
||||
if c.CIf(ctraits.isptr(ptr_var)):
|
||||
cif ctraits.isptr(ptr_var):
|
||||
print("ptr_var is pointer")
|
||||
if c.CIf(not ctraits.isptr(val_var)):
|
||||
cif not ctraits.isptr(val_var):
|
||||
print("val_var is not pointer")
|
||||
|
||||
testcheck.section("placeholder")
|
||||
|
||||
Reference in new issue
Block a user