Luke e18d7426bc refactor: 重构死循环测试用例
- 将 initializer 改为 init
- 将 condition 改为 cond
- 将 update 改为 step
2025-07-14 23:46:51 +08:00

32 lines
699 B
Plaintext

module: Math
function: main
parameter:
return_type: int
body:
Math.factorial(6)
return 0
end body
end function
function: factorial
parameter:
declare n:int
return_type: int
body:
declare num1:int = 1
loop:
init:
declare counter:int = 1
cond:
counter <= n
step:
counter = counter + 1
body:
num1 = num1 * counter
end body
end loop
return num1
end body
end function
end module