refactor: 重构模板代码

This commit is contained in:
zhangxun 2025-08-04 14:50:10 +08:00
parent 87560db20d
commit d11822f4ba
2 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ public class ASTPrinter {
NodeContext _
) -> {
System.out.println(pad + "function " + name
+ "(params=" + parameters + ", return=" + returnType + ")");
+ "(params=" + parameters + ", returns=" + returnType + ")");
for (StatementNode stmt : body) {
print(stmt, indent + 1);
}

View File

@ -24,8 +24,8 @@ public final class SnowExample {
return """
module: Math
function: main
parameter:
return_type: int
params:
returns: int
body:
Math.factorial(6)
return 0
@ -33,9 +33,9 @@ public final class SnowExample {
end function
function: factorial
parameter:
params:
declare n: int
return_type: int
returns: int
body:
declare num1: int = 1
loop: