KEYWORDS = Set.of
- ("module", "function", "parameter", "return_type", "body", "end",
+ ("module", "function", "params", "returns", "body", "end",
"if", "then", "else", "loop", "declare", "return", "import", "init",
"cond", "step", "globals", "break", "continue");
diff --git a/src/main/java/org/jcnc/snow/compiler/parser/function/FunctionParser.java b/src/main/java/org/jcnc/snow/compiler/parser/function/FunctionParser.java
index 39d928a..dba62b3 100644
--- a/src/main/java/org/jcnc/snow/compiler/parser/function/FunctionParser.java
+++ b/src/main/java/org/jcnc/snow/compiler/parser/function/FunctionParser.java
@@ -27,8 +27,8 @@ import java.util.*;
*
*
* - 函数头(关键字 {@code function:} 与函数名)
- * - 参数列表(parameter 区块)
- * - 返回类型(return_type 区块)
+ * - 参数列表(params 区块)
+ * - 返回类型(returns 区块)
* - 函数体(body 区块)
* - 函数结束(关键字 {@code end function})
*
@@ -107,7 +107,7 @@ public class FunctionParser implements TopLevelParser {
}
/**
- * 构造函数定义中各区块的解析规则(parameter、return_type、body)。
+ * 构造函数定义中各区块的解析规则(params、returns、body)。
*
*
* 每个 {@link SectionDefinition} 包含两个部分: 区块起始判断器(基于关键字)与具体的解析逻辑。
@@ -124,13 +124,13 @@ public class FunctionParser implements TopLevelParser {
List body) {
Map map = new HashMap<>();
- map.put("parameter", new SectionDefinition(
- (TokenStream stream) -> stream.peek().getLexeme().equals("parameter"),
+ map.put("params", new SectionDefinition(
+ (TokenStream stream) -> stream.peek().getLexeme().equals("params"),
(ParserContext context, TokenStream stream) -> params.addAll(parseParameters(context))
));
- map.put("return_type", new SectionDefinition(
- (TokenStream stream) -> stream.peek().getLexeme().equals("return_type"),
+ map.put("returns", new SectionDefinition(
+ (TokenStream stream) -> stream.peek().getLexeme().equals("returns"),
(ParserContext context, TokenStream stream) -> returnType[0] = parseReturnType(stream)
));
@@ -182,7 +182,7 @@ public class FunctionParser implements TopLevelParser {
*
* 支持声明后附加注释,格式示例:
*
- * parameter:
+ * params:
* declare x: int // 说明文字
* declare y: float
*
@@ -194,7 +194,7 @@ public class FunctionParser implements TopLevelParser {
private List parseParameters(ParserContext ctx) {
TokenStream ts = ctx.getTokens();
- ts.expect("parameter");
+ ts.expect("params");
ts.expect(":");
skipComments(ts);
ts.expectType(TokenType.NEWLINE);
@@ -208,7 +208,7 @@ public class FunctionParser implements TopLevelParser {
continue;
}
String lex = ts.peek().getLexeme();
- if (lex.equals("return_type") || lex.equals("body") || lex.equals("end")) {
+ if (lex.equals("returns") || lex.equals("body") || lex.equals("end")) {
break;
}
@@ -232,14 +232,14 @@ public class FunctionParser implements TopLevelParser {
* 解析返回类型声明。
*
*
- * 格式为 {@code return_type: TYPE},支持前置或行尾注释。
+ * 格式为 {@code returns: TYPE},支持前置或行尾注释。
*
*
* @param ts 当前使用的 {@link TokenStream}。
* @return 返回类型名称字符串。
*/
private String parseReturnType(TokenStream ts) {
- ts.expect("return_type");
+ ts.expect("returns");
ts.expect(":");
skipComments(ts);
Token typeToken = ts.expectType(TokenType.TYPE);
From d11822f4ba94f6de103d63d70aef38be2e85b53d Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:50:10 +0800
Subject: [PATCH 23/38] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E6=A8=A1?=
=?UTF-8?q?=E6=9D=BF=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../jcnc/snow/compiler/parser/function/ASTPrinter.java | 2 +-
src/main/java/org/jcnc/snow/pkg/utils/SnowExample.java | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/compiler/parser/function/ASTPrinter.java b/src/main/java/org/jcnc/snow/compiler/parser/function/ASTPrinter.java
index b440a4a..ae45674 100644
--- a/src/main/java/org/jcnc/snow/compiler/parser/function/ASTPrinter.java
+++ b/src/main/java/org/jcnc/snow/compiler/parser/function/ASTPrinter.java
@@ -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);
}
diff --git a/src/main/java/org/jcnc/snow/pkg/utils/SnowExample.java b/src/main/java/org/jcnc/snow/pkg/utils/SnowExample.java
index 7358487..4cab0b2 100644
--- a/src/main/java/org/jcnc/snow/pkg/utils/SnowExample.java
+++ b/src/main/java/org/jcnc/snow/pkg/utils/SnowExample.java
@@ -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:
From a8cf93671e889d4caec61ed406425dd25d919e39 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:51:24 +0800
Subject: [PATCH 24/38] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E6=A0=87?=
=?UTF-8?q?=E5=87=86=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/math/factorial/factorial.snow | 8 ++++----
lib/os/OS.snow | 4 ++--
lib/test/Dead_loop.snow | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/math/factorial/factorial.snow b/lib/math/factorial/factorial.snow
index 82a6dbf..61d51a8 100644
--- a/lib/math/factorial/factorial.snow
+++ b/lib/math/factorial/factorial.snow
@@ -1,7 +1,7 @@
module: Math
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
Math.factorial(6)
return 0
@@ -9,9 +9,9 @@ module: Math
end function
function: factorial
- parameter:
+ params:
declare n:int
- return_type: int
+ returns: int
body:
declare num1:int = 1
loop:
diff --git a/lib/os/OS.snow b/lib/os/OS.snow
index 6026d43..1982627 100644
--- a/lib/os/OS.snow
+++ b/lib/os/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/lib/test/Dead_loop.snow b/lib/test/Dead_loop.snow
index f2a1a98..7a40d25 100644
--- a/lib/test/Dead_loop.snow
+++ b/lib/test/Dead_loop.snow
@@ -1,6 +1,6 @@
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
loop:
init:
From 62f58cd83a48a6504dd1a6791e52b2eb030ea7e5 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:02 +0800
Subject: [PATCH 25/38] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=20BugFarm?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
playground/BugFarm/Bug1/Main.snow | 2 +-
playground/BugFarm/Bug2/Main.snow | 2 +-
playground/BugFarm/Bug2/OS.snow | 4 ++--
playground/BugFarm/Bug3/Main.snow | 2 +-
playground/BugFarm/Bug3/OS.snow | 4 ++--
playground/BugFarm/Bug4/Main.snow | 2 +-
playground/BugFarm/Bug4/a.snow | 2 +-
playground/BugFarm/Bug4/b.snow | 2 +-
playground/BugFarm/Bug5/Main.snow | 4 ++--
playground/BugFarm/Bug5/OS.snow | 4 ++--
playground/BugFarm/Bug6/Main.snow | 4 ++--
playground/BugFarm/Bug6/OS.snow | 4 ++--
12 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/playground/BugFarm/Bug1/Main.snow b/playground/BugFarm/Bug1/Main.snow
index 3468433..df241ed 100644
--- a/playground/BugFarm/Bug1/Main.snow
+++ b/playground/BugFarm/Bug1/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: void
+ returns: void
body:
declare abc:int =1
end body
diff --git a/playground/BugFarm/Bug2/Main.snow b/playground/BugFarm/Bug2/Main.snow
index 674b74b..023a778 100644
--- a/playground/BugFarm/Bug2/Main.snow
+++ b/playground/BugFarm/Bug2/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
loop:
init:
diff --git a/playground/BugFarm/Bug2/OS.snow b/playground/BugFarm/Bug2/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug2/OS.snow
+++ b/playground/BugFarm/Bug2/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug3/Main.snow b/playground/BugFarm/Bug3/Main.snow
index 7918328..7f76773 100644
--- a/playground/BugFarm/Bug3/Main.snow
+++ b/playground/BugFarm/Bug3/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
// 合法
declare b1: byte = 127b
diff --git a/playground/BugFarm/Bug3/OS.snow b/playground/BugFarm/Bug3/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug3/OS.snow
+++ b/playground/BugFarm/Bug3/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug4/Main.snow b/playground/BugFarm/Bug4/Main.snow
index 0efa4b1..6333a4d 100644
--- a/playground/BugFarm/Bug4/Main.snow
+++ b/playground/BugFarm/Bug4/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: ModuleB
function: main
- return_type: int
+ returns: int
body:
return ModuleB.fun()
end body
diff --git a/playground/BugFarm/Bug4/a.snow b/playground/BugFarm/Bug4/a.snow
index d717032..56799b4 100644
--- a/playground/BugFarm/Bug4/a.snow
+++ b/playground/BugFarm/Bug4/a.snow
@@ -1,6 +1,6 @@
module: ModuleA
function: fun
- return_type: int
+ returns: int
body:
return 123
end body
diff --git a/playground/BugFarm/Bug4/b.snow b/playground/BugFarm/Bug4/b.snow
index 4db51a0..8f25548 100644
--- a/playground/BugFarm/Bug4/b.snow
+++ b/playground/BugFarm/Bug4/b.snow
@@ -1,7 +1,7 @@
module: ModuleB
import: ModuleA
function: fun
- return_type: int
+ returns: int
body:
return ModuleA.fun() + ModuleA.fun()
end body
diff --git a/playground/BugFarm/Bug5/Main.snow b/playground/BugFarm/Bug5/Main.snow
index 89c6c84..d517949 100644
--- a/playground/BugFarm/Bug5/Main.snow
+++ b/playground/BugFarm/Bug5/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 0
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
sum = 20
diff --git a/playground/BugFarm/Bug5/OS.snow b/playground/BugFarm/Bug5/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug5/OS.snow
+++ b/playground/BugFarm/Bug5/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug6/Main.snow b/playground/BugFarm/Bug6/Main.snow
index 7a5bdae..34768c6 100644
--- a/playground/BugFarm/Bug6/Main.snow
+++ b/playground/BugFarm/Bug6/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 123
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
os.print(sum)
return 0
diff --git a/playground/BugFarm/Bug6/OS.snow b/playground/BugFarm/Bug6/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug6/OS.snow
+++ b/playground/BugFarm/Bug6/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
From 9f3b3ad860eb8387f9eb6da6e015a926bbfd8bd9 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:13 +0800
Subject: [PATCH 26/38] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=20Demo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
playground/Demo/Demo1/Main.snow | 2 +-
playground/Demo/Demo1/Math.snow | 4 ++--
playground/Demo/Demo10/Main.snow | 2 +-
playground/Demo/Demo11/Main.snow | 2 +-
playground/Demo/Demo12/Main.snow | 4 ++--
playground/Demo/Demo13/Main.snow | 2 +-
playground/Demo/Demo14/Main.snow | 2 +-
playground/Demo/Demo14/OS.snow | 4 ++--
playground/Demo/Demo15/Main.snow | 4 ++--
playground/Demo/Demo15/OS.snow | 4 ++--
playground/Demo/Demo16/Main.snow | 2 +-
playground/Demo/Demo16/OS.snow | 4 ++--
playground/Demo/Demo17/Main.snow | 2 +-
playground/Demo/Demo17/OS.snow | 4 ++--
playground/Demo/Demo18/Main.snow | 2 +-
playground/Demo/Demo18/OS.snow | 4 ++--
playground/Demo/Demo19/Main.snow | 2 +-
playground/Demo/Demo19/OS.snow | 4 ++--
playground/Demo/Demo2/Main.snow | 4 ++--
playground/Demo/Demo20/Main.snow | 2 +-
playground/Demo/Demo20/OS.snow | 4 ++--
playground/Demo/Demo21/Main.snow | 4 ++--
playground/Demo/Demo21/OS.snow | 4 ++--
playground/Demo/Demo3/Main.snow | 4 ++--
playground/Demo/Demo4/Main.snow | 4 ++--
playground/Demo/Demo5/Main.snow | 4 ++--
playground/Demo/Demo6/Main.snow | 4 ++--
playground/Demo/Demo7/Main.snow | 4 ++--
playground/Demo/Demo8/Main.snow | 4 ++--
playground/Demo/Demo9/Main.snow | 8 ++++----
30 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/playground/Demo/Demo1/Main.snow b/playground/Demo/Demo1/Main.snow
index 9058208..090e5ac 100644
--- a/playground/Demo/Demo1/Main.snow
+++ b/playground/Demo/Demo1/Main.snow
@@ -1,7 +1,7 @@
module: Main
import:Math
function: main
- return_type: int
+ returns: int
body:
Math.add(6,1)
return 0
diff --git a/playground/Demo/Demo1/Math.snow b/playground/Demo/Demo1/Math.snow
index 2e5963e..099c244 100644
--- a/playground/Demo/Demo1/Math.snow
+++ b/playground/Demo/Demo1/Math.snow
@@ -1,9 +1,9 @@
module: Math
function: add
- parameter:
+ params:
declare n1: int
declare n2: int
- return_type: int
+ returns: int
body:
return n1 + n2
end body
diff --git a/playground/Demo/Demo10/Main.snow b/playground/Demo/Demo10/Main.snow
index de91d63..c5ee595 100644
--- a/playground/Demo/Demo10/Main.snow
+++ b/playground/Demo/Demo10/Main.snow
@@ -1,5 +1,5 @@
function: main
- return_type: int
+ returns: int
body:
declare res: boolean = 8L > 7L
if res then
diff --git a/playground/Demo/Demo11/Main.snow b/playground/Demo/Demo11/Main.snow
index 3dd121d..a64b5c8 100644
--- a/playground/Demo/Demo11/Main.snow
+++ b/playground/Demo/Demo11/Main.snow
@@ -1,5 +1,5 @@
function: main
- return_type: int
+ returns: int
body:
return 65537
end body
diff --git a/playground/Demo/Demo12/Main.snow b/playground/Demo/Demo12/Main.snow
index 134096c..cadccb5 100644
--- a/playground/Demo/Demo12/Main.snow
+++ b/playground/Demo/Demo12/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: int
+ returns: int
body:
foo()
@@ -9,7 +9,7 @@ module: Main
end function
function: foo
- return_type: int
+ returns: int
body:
if false then
return 1
diff --git a/playground/Demo/Demo13/Main.snow b/playground/Demo/Demo13/Main.snow
index 7b6479b..92dd51e 100644
--- a/playground/Demo/Demo13/Main.snow
+++ b/playground/Demo/Demo13/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: int
+ returns: int
body:
5 == 7
5 == 7s
diff --git a/playground/Demo/Demo14/Main.snow b/playground/Demo/Demo14/Main.snow
index 7bb005a..88322e4 100644
--- a/playground/Demo/Demo14/Main.snow
+++ b/playground/Demo/Demo14/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
os.print(222)
end body
diff --git a/playground/Demo/Demo14/OS.snow b/playground/Demo/Demo14/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo14/OS.snow
+++ b/playground/Demo/Demo14/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo15/Main.snow b/playground/Demo/Demo15/Main.snow
index 65533fe..3ddb8b4 100644
--- a/playground/Demo/Demo15/Main.snow
+++ b/playground/Demo/Demo15/Main.snow
@@ -3,7 +3,7 @@ module: Main
globals:
declare num2:int=10
function: main
- return_type: void
+ returns: void
body:
declare num1:int=11
os.print(num1+num2+abc())
@@ -11,7 +11,7 @@ module: Main
end function
function: abc
- return_type: int
+ returns: int
body:
return 1
end body
diff --git a/playground/Demo/Demo15/OS.snow b/playground/Demo/Demo15/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo15/OS.snow
+++ b/playground/Demo/Demo15/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo16/Main.snow b/playground/Demo/Demo16/Main.snow
index 4aa7b8d..6a85f02 100644
--- a/playground/Demo/Demo16/Main.snow
+++ b/playground/Demo/Demo16/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo16/OS.snow b/playground/Demo/Demo16/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo16/OS.snow
+++ b/playground/Demo/Demo16/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo17/Main.snow b/playground/Demo/Demo17/Main.snow
index 8c15d75..ecce2ae 100644
--- a/playground/Demo/Demo17/Main.snow
+++ b/playground/Demo/Demo17/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo17/OS.snow b/playground/Demo/Demo17/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo17/OS.snow
+++ b/playground/Demo/Demo17/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo18/Main.snow b/playground/Demo/Demo18/Main.snow
index 107f100..520803c 100644
--- a/playground/Demo/Demo18/Main.snow
+++ b/playground/Demo/Demo18/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo18/OS.snow b/playground/Demo/Demo18/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo18/OS.snow
+++ b/playground/Demo/Demo18/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo19/Main.snow b/playground/Demo/Demo19/Main.snow
index 5bcef84..e8aabfa 100644
--- a/playground/Demo/Demo19/Main.snow
+++ b/playground/Demo/Demo19/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
declare n: int[][][][] = [
[
diff --git a/playground/Demo/Demo19/OS.snow b/playground/Demo/Demo19/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo19/OS.snow
+++ b/playground/Demo/Demo19/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo2/Main.snow b/playground/Demo/Demo2/Main.snow
index 1b1833f..a0f1396 100644
--- a/playground/Demo/Demo2/Main.snow
+++ b/playground/Demo/Demo2/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
return (1+2) / 3 * 4 + 2 *2
end body
diff --git a/playground/Demo/Demo20/Main.snow b/playground/Demo/Demo20/Main.snow
index c3ba2e4..e442ff4 100644
--- a/playground/Demo/Demo20/Main.snow
+++ b/playground/Demo/Demo20/Main.snow
@@ -1,7 +1,7 @@
module: Main
import:os
function: main
- return_type: void
+ returns: void
body:
declare arr: int[] = [1, 2, 3]
arr[0] = 5
diff --git a/playground/Demo/Demo20/OS.snow b/playground/Demo/Demo20/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo20/OS.snow
+++ b/playground/Demo/Demo20/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo21/Main.snow b/playground/Demo/Demo21/Main.snow
index f3b11ce..4ad4c48 100644
--- a/playground/Demo/Demo21/Main.snow
+++ b/playground/Demo/Demo21/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 123
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare arr: int[][][][][][][][][][][][][][][][][][][][][][] = [[[[[[[[[[[[[[[[[[[[[[1], [2], [3]]]]]]]]]]]]]]]]]]]]]]
loop:
diff --git a/playground/Demo/Demo21/OS.snow b/playground/Demo/Demo21/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo21/OS.snow
+++ b/playground/Demo/Demo21/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo3/Main.snow b/playground/Demo/Demo3/Main.snow
index 4a13b7d..6e9de28 100644
--- a/playground/Demo/Demo3/Main.snow
+++ b/playground/Demo/Demo3/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare n1: int =1
declare n2: int =2
diff --git a/playground/Demo/Demo4/Main.snow b/playground/Demo/Demo4/Main.snow
index 60d39a4..aa376bc 100644
--- a/playground/Demo/Demo4/Main.snow
+++ b/playground/Demo/Demo4/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: boolean
+ params:
+ returns: boolean
body:
declare b1: boolean =true
diff --git a/playground/Demo/Demo5/Main.snow b/playground/Demo/Demo5/Main.snow
index c475980..5a5c2b8 100644
--- a/playground/Demo/Demo5/Main.snow
+++ b/playground/Demo/Demo5/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare b1: boolean = true
loop:
diff --git a/playground/Demo/Demo6/Main.snow b/playground/Demo/Demo6/Main.snow
index 71b29c5..0f3b2dc 100644
--- a/playground/Demo/Demo6/Main.snow
+++ b/playground/Demo/Demo6/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare b1 :int = -1
return b1
diff --git a/playground/Demo/Demo7/Main.snow b/playground/Demo/Demo7/Main.snow
index aae7e15..f7e551c 100644
--- a/playground/Demo/Demo7/Main.snow
+++ b/playground/Demo/Demo7/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: boolean
+ params:
+ returns: boolean
body:
declare b1 :boolean = true
return !b1
diff --git a/playground/Demo/Demo8/Main.snow b/playground/Demo/Demo8/Main.snow
index 8ff76af..e5260f4 100644
--- a/playground/Demo/Demo8/Main.snow
+++ b/playground/Demo/Demo8/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: long
+ params:
+ returns: long
body:
declare n: long
n = 2147483647
diff --git a/playground/Demo/Demo9/Main.snow b/playground/Demo/Demo9/Main.snow
index 82a6dbf..61d51a8 100644
--- a/playground/Demo/Demo9/Main.snow
+++ b/playground/Demo/Demo9/Main.snow
@@ -1,7 +1,7 @@
module: Math
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
Math.factorial(6)
return 0
@@ -9,9 +9,9 @@ module: Math
end function
function: factorial
- parameter:
+ params:
declare n:int
- return_type: int
+ returns: int
body:
declare num1:int = 1
loop:
From 9a61798d81ae000f32fe6bca905fa29239c49ca4 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:24 +0800
Subject: [PATCH 27/38] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 20 ++++++++---------
docs/Snow-Lang-Journey/Snow-Lang-Journey.md | 8 +++----
docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md | 24 ++++++++++-----------
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index d2fd83b..d88a658 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ SnowVM) 的完整编译-执行链路。
Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的语法和严格的类型系统,以帮助 LLM 更好地理解程序。
-语言使用显式的 `module` 声明来组织代码,用 `function`,`parameter`,`return_type`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
+语言使用显式的 `module` 声明来组织代码,用 `function`,`parameter`,`returns`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
实现了语义分析来检查变量作用域和类型一致性,在编译阶段捕获错误并确保生成的中间代码正确无误。这种自上而下的编译流程,使得代码设计和生成更加模块化,可解释,也有利于调试和优化。
相关背景: [心路历程](docs/Snow-Lang-Journey/Snow-Lang-Journey.md)
@@ -111,7 +111,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
module: Main
import:Math
function: main
- return_type: int
+ returns: int
body:
Math.add(6,1)
return 0
@@ -135,7 +135,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
3 15 IDENTIFIER main
3 19 NEWLINE \n
- 4 9 KEYWORD return_type
+ 4 9 KEYWORD returns
4 20 COLON :
4 22 TYPE int
4 25 NEWLINE \n
@@ -174,10 +174,10 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
#### Math.snow
module: Math
function: add
- parameter:
+ params:
declare n1: int
declare n2: int
- return_type: int
+ returns: int
body:
return n1 + n2
end body
@@ -195,7 +195,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
2 15 IDENTIFIER add
2 18 NEWLINE \n
- 3 9 KEYWORD parameter
+ 3 9 KEYWORD params
3 18 COLON :
3 19 NEWLINE \n
@@ -211,7 +211,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
5 25 TYPE int
5 28 NEWLINE \n
- 6 9 KEYWORD return_type
+ 6 9 KEYWORD returns
6 20 COLON :
6 22 TYPE int
6 25 NEWLINE \n
@@ -494,7 +494,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
```snow
module: Math
function: main
- return_type: int
+ returns: int
body:
Math.factorial(6)
return 0
@@ -502,9 +502,9 @@ module: Math
end function
function: factorial
- parameter:
+ params:
declare n:int
- return_type: int
+ returns: int
body:
declare num1:int = 1
loop:
diff --git a/docs/Snow-Lang-Journey/Snow-Lang-Journey.md b/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
index c203998..4c2c5a8 100644
--- a/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
+++ b/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
@@ -76,8 +76,8 @@
module: Main
import:Math
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
Math.factorial(6L,1L)
@@ -90,10 +90,10 @@ end module
## 源代码 (test.snow)
module: Math
function: factorial
- parameter:
+ params:
declare n1: long
declare n2: long
- return_type: long
+ returns: long
body:
return n1+n2
end body
diff --git a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
index 169fdb1..057f1b8 100644
--- a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
+++ b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
@@ -7,7 +7,7 @@
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
return 1 + 1
@@ -116,7 +116,7 @@ cond 可以是表达式(结果为 bool 类型)或者 bool 字面量
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
if 5 > 7 then
return 5
@@ -154,7 +154,7 @@ end loop
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
declare sum: int = 0
loop:
@@ -179,17 +179,17 @@ end module
函数的形式如下:
```snow
function: add
- parameter:
+ params:
declare a: int
declare b: int
- return_type: int
+ returns: int
body:
return a + b
end body
end function
```
-其中 add 是函数名,parameter 下面是参数列表(可省略),与变量的定义类似,但是不允许赋初值,
-接着 return_type 设置返回值类型,最后的 body 为函数体。
+其中 add 是函数名,params 下面是参数列表(可省略),与变量的定义类似,但是不允许赋初值,
+接着 returns 设置返回值类型,最后的 body 为函数体。
## 模块
@@ -202,7 +202,7 @@ snow 会自动将同名模块的函数合并。
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
return 1 + 1
@@ -218,10 +218,10 @@ end module
// Math.snow
module: Math
function: add
- parameter:
+ params:
declare a: int
declare b: int
- return_type: int
+ returns: int
body:
return a + b
end body
@@ -235,7 +235,7 @@ end module
module: Main
import: Math
function: main
- return_type: int
+ returns: int
body:
return Math.add(5, 7)
@@ -250,7 +250,7 @@ end module
module: Main
import: Math, Time
function: main
- return_type: int
+ returns: int
body:
return Math.add(5, 7)
From 3e7e5f2dadb8522e98b89acd73289ff99e66fb00 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 15:01:11 +0800
Subject: [PATCH 28/38] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=A0=87?=
=?UTF-8?q?=E5=87=86=20URL=20=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java | 2 +-
.../java/org/jcnc/snow/compiler/lexer/core/LexicalError.java | 2 +-
.../java/org/jcnc/snow/compiler/parser/context/ParseError.java | 2 +-
.../org/jcnc/snow/compiler/parser/context/ParserContext.java | 2 +-
.../org/jcnc/snow/compiler/semantic/error/SemanticError.java | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
index 672116f..ec69e67 100644
--- a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
+++ b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
@@ -37,7 +37,7 @@ public class LexerEngine {
* @param sourceName 文件名(诊断用)
*/
public LexerEngine(String source, String sourceName) {
- this.absPath = new File(sourceName).getAbsolutePath();
+ this.absPath = new File(sourceName).getAbsolutePath().replace('\\', '/');
this.context = new LexerContext(source);
this.scanners = List.of(
new WhitespaceTokenScanner(),
diff --git a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexicalError.java b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexicalError.java
index 2454088..ae928d4 100644
--- a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexicalError.java
+++ b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexicalError.java
@@ -50,6 +50,6 @@ public class LexicalError {
*/
@Override
public String toString() {
- return file + ":" + line + ":" + column + ": " + message;
+ return "file:///" + file + ":" + line + ":" + column + ": " + message;
}
}
diff --git a/src/main/java/org/jcnc/snow/compiler/parser/context/ParseError.java b/src/main/java/org/jcnc/snow/compiler/parser/context/ParseError.java
index 105fd20..c32d95e 100644
--- a/src/main/java/org/jcnc/snow/compiler/parser/context/ParseError.java
+++ b/src/main/java/org/jcnc/snow/compiler/parser/context/ParseError.java
@@ -40,6 +40,6 @@ public class ParseError {
*/
@Override
public String toString() {
- return file + ":" + line + ":" + column + ": " + message;
+ return "file:///" + file + ":" + line + ":" + column + ": " + message;
}
}
diff --git a/src/main/java/org/jcnc/snow/compiler/parser/context/ParserContext.java b/src/main/java/org/jcnc/snow/compiler/parser/context/ParserContext.java
index b9c9852..e9ce832 100644
--- a/src/main/java/org/jcnc/snow/compiler/parser/context/ParserContext.java
+++ b/src/main/java/org/jcnc/snow/compiler/parser/context/ParserContext.java
@@ -39,7 +39,7 @@ public class ParserContext {
*/
public ParserContext(List tokens, String sourceName) {
this.tokens = new TokenStream(tokens);
- this.sourceName = Paths.get(sourceName).toAbsolutePath().toString();
+ this.sourceName = Paths.get(sourceName).toAbsolutePath().toString().replace('\\', '/');
}
diff --git a/src/main/java/org/jcnc/snow/compiler/semantic/error/SemanticError.java b/src/main/java/org/jcnc/snow/compiler/semantic/error/SemanticError.java
index 5bdec98..c43e6c9 100644
--- a/src/main/java/org/jcnc/snow/compiler/semantic/error/SemanticError.java
+++ b/src/main/java/org/jcnc/snow/compiler/semantic/error/SemanticError.java
@@ -48,7 +48,7 @@ public record SemanticError(Node node, String message) {
}
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder("file:///");
if (file != null && !file.isBlank()) sb.append(file).append(":");
sb.append((line >= 0 && col >= 0) ? line + ":" + col : "未知位置");
sb.append(": ").append(message);
From 359c65228dc7d2703b8a7b44c3980ca8ff33e099 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:02 +0800
Subject: [PATCH 29/38] =?UTF-8?q?test:=20=E9=87=8D=E6=9E=84=20BugFarm?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
playground/BugFarm/Bug1/Main.snow | 2 +-
playground/BugFarm/Bug2/Main.snow | 2 +-
playground/BugFarm/Bug2/OS.snow | 4 ++--
playground/BugFarm/Bug3/Main.snow | 2 +-
playground/BugFarm/Bug3/OS.snow | 4 ++--
playground/BugFarm/Bug4/Main.snow | 2 +-
playground/BugFarm/Bug4/a.snow | 2 +-
playground/BugFarm/Bug4/b.snow | 2 +-
playground/BugFarm/Bug5/Main.snow | 4 ++--
playground/BugFarm/Bug5/OS.snow | 4 ++--
playground/BugFarm/Bug6/Main.snow | 4 ++--
playground/BugFarm/Bug6/OS.snow | 4 ++--
12 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/playground/BugFarm/Bug1/Main.snow b/playground/BugFarm/Bug1/Main.snow
index 3468433..df241ed 100644
--- a/playground/BugFarm/Bug1/Main.snow
+++ b/playground/BugFarm/Bug1/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: void
+ returns: void
body:
declare abc:int =1
end body
diff --git a/playground/BugFarm/Bug2/Main.snow b/playground/BugFarm/Bug2/Main.snow
index 674b74b..023a778 100644
--- a/playground/BugFarm/Bug2/Main.snow
+++ b/playground/BugFarm/Bug2/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
loop:
init:
diff --git a/playground/BugFarm/Bug2/OS.snow b/playground/BugFarm/Bug2/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug2/OS.snow
+++ b/playground/BugFarm/Bug2/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug3/Main.snow b/playground/BugFarm/Bug3/Main.snow
index 7918328..7f76773 100644
--- a/playground/BugFarm/Bug3/Main.snow
+++ b/playground/BugFarm/Bug3/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
// 合法
declare b1: byte = 127b
diff --git a/playground/BugFarm/Bug3/OS.snow b/playground/BugFarm/Bug3/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug3/OS.snow
+++ b/playground/BugFarm/Bug3/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug4/Main.snow b/playground/BugFarm/Bug4/Main.snow
index 0efa4b1..6333a4d 100644
--- a/playground/BugFarm/Bug4/Main.snow
+++ b/playground/BugFarm/Bug4/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: ModuleB
function: main
- return_type: int
+ returns: int
body:
return ModuleB.fun()
end body
diff --git a/playground/BugFarm/Bug4/a.snow b/playground/BugFarm/Bug4/a.snow
index d717032..56799b4 100644
--- a/playground/BugFarm/Bug4/a.snow
+++ b/playground/BugFarm/Bug4/a.snow
@@ -1,6 +1,6 @@
module: ModuleA
function: fun
- return_type: int
+ returns: int
body:
return 123
end body
diff --git a/playground/BugFarm/Bug4/b.snow b/playground/BugFarm/Bug4/b.snow
index 4db51a0..8f25548 100644
--- a/playground/BugFarm/Bug4/b.snow
+++ b/playground/BugFarm/Bug4/b.snow
@@ -1,7 +1,7 @@
module: ModuleB
import: ModuleA
function: fun
- return_type: int
+ returns: int
body:
return ModuleA.fun() + ModuleA.fun()
end body
diff --git a/playground/BugFarm/Bug5/Main.snow b/playground/BugFarm/Bug5/Main.snow
index 89c6c84..d517949 100644
--- a/playground/BugFarm/Bug5/Main.snow
+++ b/playground/BugFarm/Bug5/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 0
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
sum = 20
diff --git a/playground/BugFarm/Bug5/OS.snow b/playground/BugFarm/Bug5/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug5/OS.snow
+++ b/playground/BugFarm/Bug5/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/BugFarm/Bug6/Main.snow b/playground/BugFarm/Bug6/Main.snow
index 7a5bdae..34768c6 100644
--- a/playground/BugFarm/Bug6/Main.snow
+++ b/playground/BugFarm/Bug6/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 123
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
os.print(sum)
return 0
diff --git a/playground/BugFarm/Bug6/OS.snow b/playground/BugFarm/Bug6/OS.snow
index 6026d43..1982627 100644
--- a/playground/BugFarm/Bug6/OS.snow
+++ b/playground/BugFarm/Bug6/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
From 582ba2ce278378e124ba9776e694d232c6fd9e5b Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:13 +0800
Subject: [PATCH 30/38] =?UTF-8?q?test:=20=E9=87=8D=E6=9E=84=20Demo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
playground/Demo/Demo1/Main.snow | 2 +-
playground/Demo/Demo1/Math.snow | 4 ++--
playground/Demo/Demo10/Main.snow | 2 +-
playground/Demo/Demo11/Main.snow | 2 +-
playground/Demo/Demo12/Main.snow | 4 ++--
playground/Demo/Demo13/Main.snow | 2 +-
playground/Demo/Demo14/Main.snow | 2 +-
playground/Demo/Demo14/OS.snow | 4 ++--
playground/Demo/Demo15/Main.snow | 4 ++--
playground/Demo/Demo15/OS.snow | 4 ++--
playground/Demo/Demo16/Main.snow | 2 +-
playground/Demo/Demo16/OS.snow | 4 ++--
playground/Demo/Demo17/Main.snow | 2 +-
playground/Demo/Demo17/OS.snow | 4 ++--
playground/Demo/Demo18/Main.snow | 2 +-
playground/Demo/Demo18/OS.snow | 4 ++--
playground/Demo/Demo19/Main.snow | 2 +-
playground/Demo/Demo19/OS.snow | 4 ++--
playground/Demo/Demo2/Main.snow | 4 ++--
playground/Demo/Demo20/Main.snow | 2 +-
playground/Demo/Demo20/OS.snow | 4 ++--
playground/Demo/Demo21/Main.snow | 4 ++--
playground/Demo/Demo21/OS.snow | 4 ++--
playground/Demo/Demo3/Main.snow | 4 ++--
playground/Demo/Demo4/Main.snow | 4 ++--
playground/Demo/Demo5/Main.snow | 4 ++--
playground/Demo/Demo6/Main.snow | 4 ++--
playground/Demo/Demo7/Main.snow | 4 ++--
playground/Demo/Demo8/Main.snow | 4 ++--
playground/Demo/Demo9/Main.snow | 8 ++++----
30 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/playground/Demo/Demo1/Main.snow b/playground/Demo/Demo1/Main.snow
index 9058208..090e5ac 100644
--- a/playground/Demo/Demo1/Main.snow
+++ b/playground/Demo/Demo1/Main.snow
@@ -1,7 +1,7 @@
module: Main
import:Math
function: main
- return_type: int
+ returns: int
body:
Math.add(6,1)
return 0
diff --git a/playground/Demo/Demo1/Math.snow b/playground/Demo/Demo1/Math.snow
index 2e5963e..099c244 100644
--- a/playground/Demo/Demo1/Math.snow
+++ b/playground/Demo/Demo1/Math.snow
@@ -1,9 +1,9 @@
module: Math
function: add
- parameter:
+ params:
declare n1: int
declare n2: int
- return_type: int
+ returns: int
body:
return n1 + n2
end body
diff --git a/playground/Demo/Demo10/Main.snow b/playground/Demo/Demo10/Main.snow
index de91d63..c5ee595 100644
--- a/playground/Demo/Demo10/Main.snow
+++ b/playground/Demo/Demo10/Main.snow
@@ -1,5 +1,5 @@
function: main
- return_type: int
+ returns: int
body:
declare res: boolean = 8L > 7L
if res then
diff --git a/playground/Demo/Demo11/Main.snow b/playground/Demo/Demo11/Main.snow
index 3dd121d..a64b5c8 100644
--- a/playground/Demo/Demo11/Main.snow
+++ b/playground/Demo/Demo11/Main.snow
@@ -1,5 +1,5 @@
function: main
- return_type: int
+ returns: int
body:
return 65537
end body
diff --git a/playground/Demo/Demo12/Main.snow b/playground/Demo/Demo12/Main.snow
index 134096c..cadccb5 100644
--- a/playground/Demo/Demo12/Main.snow
+++ b/playground/Demo/Demo12/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: int
+ returns: int
body:
foo()
@@ -9,7 +9,7 @@ module: Main
end function
function: foo
- return_type: int
+ returns: int
body:
if false then
return 1
diff --git a/playground/Demo/Demo13/Main.snow b/playground/Demo/Demo13/Main.snow
index 7b6479b..92dd51e 100644
--- a/playground/Demo/Demo13/Main.snow
+++ b/playground/Demo/Demo13/Main.snow
@@ -1,6 +1,6 @@
module: Main
function: main
- return_type: int
+ returns: int
body:
5 == 7
5 == 7s
diff --git a/playground/Demo/Demo14/Main.snow b/playground/Demo/Demo14/Main.snow
index 7bb005a..88322e4 100644
--- a/playground/Demo/Demo14/Main.snow
+++ b/playground/Demo/Demo14/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
os.print(222)
end body
diff --git a/playground/Demo/Demo14/OS.snow b/playground/Demo/Demo14/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo14/OS.snow
+++ b/playground/Demo/Demo14/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo15/Main.snow b/playground/Demo/Demo15/Main.snow
index 65533fe..3ddb8b4 100644
--- a/playground/Demo/Demo15/Main.snow
+++ b/playground/Demo/Demo15/Main.snow
@@ -3,7 +3,7 @@ module: Main
globals:
declare num2:int=10
function: main
- return_type: void
+ returns: void
body:
declare num1:int=11
os.print(num1+num2+abc())
@@ -11,7 +11,7 @@ module: Main
end function
function: abc
- return_type: int
+ returns: int
body:
return 1
end body
diff --git a/playground/Demo/Demo15/OS.snow b/playground/Demo/Demo15/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo15/OS.snow
+++ b/playground/Demo/Demo15/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo16/Main.snow b/playground/Demo/Demo16/Main.snow
index 4aa7b8d..6a85f02 100644
--- a/playground/Demo/Demo16/Main.snow
+++ b/playground/Demo/Demo16/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo16/OS.snow b/playground/Demo/Demo16/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo16/OS.snow
+++ b/playground/Demo/Demo16/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo17/Main.snow b/playground/Demo/Demo17/Main.snow
index 8c15d75..ecce2ae 100644
--- a/playground/Demo/Demo17/Main.snow
+++ b/playground/Demo/Demo17/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo17/OS.snow b/playground/Demo/Demo17/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo17/OS.snow
+++ b/playground/Demo/Demo17/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo18/Main.snow b/playground/Demo/Demo18/Main.snow
index 107f100..520803c 100644
--- a/playground/Demo/Demo18/Main.snow
+++ b/playground/Demo/Demo18/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: int
+ returns: int
body:
loop:
init:
diff --git a/playground/Demo/Demo18/OS.snow b/playground/Demo/Demo18/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo18/OS.snow
+++ b/playground/Demo/Demo18/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo19/Main.snow b/playground/Demo/Demo19/Main.snow
index 5bcef84..e8aabfa 100644
--- a/playground/Demo/Demo19/Main.snow
+++ b/playground/Demo/Demo19/Main.snow
@@ -1,7 +1,7 @@
module: Main
import: os
function: main
- return_type: void
+ returns: void
body:
declare n: int[][][][] = [
[
diff --git a/playground/Demo/Demo19/OS.snow b/playground/Demo/Demo19/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo19/OS.snow
+++ b/playground/Demo/Demo19/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo2/Main.snow b/playground/Demo/Demo2/Main.snow
index 1b1833f..a0f1396 100644
--- a/playground/Demo/Demo2/Main.snow
+++ b/playground/Demo/Demo2/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
return (1+2) / 3 * 4 + 2 *2
end body
diff --git a/playground/Demo/Demo20/Main.snow b/playground/Demo/Demo20/Main.snow
index c3ba2e4..e442ff4 100644
--- a/playground/Demo/Demo20/Main.snow
+++ b/playground/Demo/Demo20/Main.snow
@@ -1,7 +1,7 @@
module: Main
import:os
function: main
- return_type: void
+ returns: void
body:
declare arr: int[] = [1, 2, 3]
arr[0] = 5
diff --git a/playground/Demo/Demo20/OS.snow b/playground/Demo/Demo20/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo20/OS.snow
+++ b/playground/Demo/Demo20/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo21/Main.snow b/playground/Demo/Demo21/Main.snow
index f3b11ce..4ad4c48 100644
--- a/playground/Demo/Demo21/Main.snow
+++ b/playground/Demo/Demo21/Main.snow
@@ -3,8 +3,8 @@ module: Main
globals:
declare sum: int = 123
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare arr: int[][][][][][][][][][][][][][][][][][][][][][] = [[[[[[[[[[[[[[[[[[[[[[1], [2], [3]]]]]]]]]]]]]]]]]]]]]]
loop:
diff --git a/playground/Demo/Demo21/OS.snow b/playground/Demo/Demo21/OS.snow
index 6026d43..1982627 100644
--- a/playground/Demo/Demo21/OS.snow
+++ b/playground/Demo/Demo21/OS.snow
@@ -1,9 +1,9 @@
module: os
import: os
function: print
- parameter:
+ params:
declare i1: int
- return_type: void
+ returns: void
body:
syscall("PRINT",i1)
end body
diff --git a/playground/Demo/Demo3/Main.snow b/playground/Demo/Demo3/Main.snow
index 4a13b7d..6e9de28 100644
--- a/playground/Demo/Demo3/Main.snow
+++ b/playground/Demo/Demo3/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare n1: int =1
declare n2: int =2
diff --git a/playground/Demo/Demo4/Main.snow b/playground/Demo/Demo4/Main.snow
index 60d39a4..aa376bc 100644
--- a/playground/Demo/Demo4/Main.snow
+++ b/playground/Demo/Demo4/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: boolean
+ params:
+ returns: boolean
body:
declare b1: boolean =true
diff --git a/playground/Demo/Demo5/Main.snow b/playground/Demo/Demo5/Main.snow
index c475980..5a5c2b8 100644
--- a/playground/Demo/Demo5/Main.snow
+++ b/playground/Demo/Demo5/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare b1: boolean = true
loop:
diff --git a/playground/Demo/Demo6/Main.snow b/playground/Demo/Demo6/Main.snow
index 71b29c5..0f3b2dc 100644
--- a/playground/Demo/Demo6/Main.snow
+++ b/playground/Demo/Demo6/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
declare b1 :int = -1
return b1
diff --git a/playground/Demo/Demo7/Main.snow b/playground/Demo/Demo7/Main.snow
index aae7e15..f7e551c 100644
--- a/playground/Demo/Demo7/Main.snow
+++ b/playground/Demo/Demo7/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: boolean
+ params:
+ returns: boolean
body:
declare b1 :boolean = true
return !b1
diff --git a/playground/Demo/Demo8/Main.snow b/playground/Demo/Demo8/Main.snow
index 8ff76af..e5260f4 100644
--- a/playground/Demo/Demo8/Main.snow
+++ b/playground/Demo/Demo8/Main.snow
@@ -1,7 +1,7 @@
module: Main
function: main
- parameter:
- return_type: long
+ params:
+ returns: long
body:
declare n: long
n = 2147483647
diff --git a/playground/Demo/Demo9/Main.snow b/playground/Demo/Demo9/Main.snow
index 82a6dbf..61d51a8 100644
--- a/playground/Demo/Demo9/Main.snow
+++ b/playground/Demo/Demo9/Main.snow
@@ -1,7 +1,7 @@
module: Math
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
Math.factorial(6)
return 0
@@ -9,9 +9,9 @@ module: Math
end function
function: factorial
- parameter:
+ params:
declare n:int
- return_type: int
+ returns: int
body:
declare num1:int = 1
loop:
From 4ae77434dce4b174601d4377bd3a6a0836a8805a Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 14:52:24 +0800
Subject: [PATCH 31/38] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 20 ++++++++---------
docs/Snow-Lang-Journey/Snow-Lang-Journey.md | 8 +++----
docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md | 24 ++++++++++-----------
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index d2fd83b..d88a658 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ SnowVM) 的完整编译-执行链路。
Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的语法和严格的类型系统,以帮助 LLM 更好地理解程序。
-语言使用显式的 `module` 声明来组织代码,用 `function`,`parameter`,`return_type`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
+语言使用显式的 `module` 声明来组织代码,用 `function`,`parameter`,`returns`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
实现了语义分析来检查变量作用域和类型一致性,在编译阶段捕获错误并确保生成的中间代码正确无误。这种自上而下的编译流程,使得代码设计和生成更加模块化,可解释,也有利于调试和优化。
相关背景: [心路历程](docs/Snow-Lang-Journey/Snow-Lang-Journey.md)
@@ -111,7 +111,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
module: Main
import:Math
function: main
- return_type: int
+ returns: int
body:
Math.add(6,1)
return 0
@@ -135,7 +135,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
3 15 IDENTIFIER main
3 19 NEWLINE \n
- 4 9 KEYWORD return_type
+ 4 9 KEYWORD returns
4 20 COLON :
4 22 TYPE int
4 25 NEWLINE \n
@@ -174,10 +174,10 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
#### Math.snow
module: Math
function: add
- parameter:
+ params:
declare n1: int
declare n2: int
- return_type: int
+ returns: int
body:
return n1 + n2
end body
@@ -195,7 +195,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
2 15 IDENTIFIER add
2 18 NEWLINE \n
- 3 9 KEYWORD parameter
+ 3 9 KEYWORD params
3 18 COLON :
3 19 NEWLINE \n
@@ -211,7 +211,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
5 25 TYPE int
5 28 NEWLINE \n
- 6 9 KEYWORD return_type
+ 6 9 KEYWORD returns
6 20 COLON :
6 22 TYPE int
6 25 NEWLINE \n
@@ -494,7 +494,7 @@ Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的
```snow
module: Math
function: main
- return_type: int
+ returns: int
body:
Math.factorial(6)
return 0
@@ -502,9 +502,9 @@ module: Math
end function
function: factorial
- parameter:
+ params:
declare n:int
- return_type: int
+ returns: int
body:
declare num1:int = 1
loop:
diff --git a/docs/Snow-Lang-Journey/Snow-Lang-Journey.md b/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
index c203998..4c2c5a8 100644
--- a/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
+++ b/docs/Snow-Lang-Journey/Snow-Lang-Journey.md
@@ -76,8 +76,8 @@
module: Main
import:Math
function: main
- parameter:
- return_type: int
+ params:
+ returns: int
body:
Math.factorial(6L,1L)
@@ -90,10 +90,10 @@ end module
## 源代码 (test.snow)
module: Math
function: factorial
- parameter:
+ params:
declare n1: long
declare n2: long
- return_type: long
+ returns: long
body:
return n1+n2
end body
diff --git a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
index 169fdb1..057f1b8 100644
--- a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
+++ b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
@@ -7,7 +7,7 @@
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
return 1 + 1
@@ -116,7 +116,7 @@ cond 可以是表达式(结果为 bool 类型)或者 bool 字面量
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
if 5 > 7 then
return 5
@@ -154,7 +154,7 @@ end loop
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
declare sum: int = 0
loop:
@@ -179,17 +179,17 @@ end module
函数的形式如下:
```snow
function: add
- parameter:
+ params:
declare a: int
declare b: int
- return_type: int
+ returns: int
body:
return a + b
end body
end function
```
-其中 add 是函数名,parameter 下面是参数列表(可省略),与变量的定义类似,但是不允许赋初值,
-接着 return_type 设置返回值类型,最后的 body 为函数体。
+其中 add 是函数名,params 下面是参数列表(可省略),与变量的定义类似,但是不允许赋初值,
+接着 returns 设置返回值类型,最后的 body 为函数体。
## 模块
@@ -202,7 +202,7 @@ snow 会自动将同名模块的函数合并。
```snow
module: Main
function: main
- return_type: int
+ returns: int
body:
return 1 + 1
@@ -218,10 +218,10 @@ end module
// Math.snow
module: Math
function: add
- parameter:
+ params:
declare a: int
declare b: int
- return_type: int
+ returns: int
body:
return a + b
end body
@@ -235,7 +235,7 @@ end module
module: Main
import: Math
function: main
- return_type: int
+ returns: int
body:
return Math.add(5, 7)
@@ -250,7 +250,7 @@ end module
module: Main
import: Math, Time
function: main
- return_type: int
+ returns: int
body:
return Math.add(5, 7)
From 7898505717014eb1b15d3b5cc283f91c91121533 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 15:20:30 +0800
Subject: [PATCH 32/38] docs: update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d88a658..60dbc44 100644
--- a/README.md
+++ b/README.md
@@ -44,7 +44,7 @@ SnowVM) 的完整编译-执行链路。
Snow 语言受到 LLM 驱动代码生成趋势的启发,强调简单而清晰的语法和严格的类型系统,以帮助 LLM 更好地理解程序。
-语言使用显式的 `module` 声明来组织代码,用 `function`,`parameter`,`returns`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
+语言使用显式的 `module` 声明来组织代码,用 `function`,`params`,`returns`,`body` 等关键字分隔不同代码块,语法结构固定且易读。此外,Snow
实现了语义分析来检查变量作用域和类型一致性,在编译阶段捕获错误并确保生成的中间代码正确无误。这种自上而下的编译流程,使得代码设计和生成更加模块化,可解释,也有利于调试和优化。
相关背景: [心路历程](docs/Snow-Lang-Journey/Snow-Lang-Journey.md)
From 8d04397f32c9c95775697a6632aed33d246510f0 Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 15:26:00 +0800
Subject: [PATCH 33/38] =?UTF-8?q?docs:=20=E7=A7=BB=E9=99=A4=E5=BA=9F?=
=?UTF-8?q?=E5=BC=83=E7=9A=84=E5=AD=97=E9=9D=A2=E9=87=8F=E5=90=8E=E7=BC=80?=
=?UTF-8?q?=20i=E3=80=81d?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
index 169fdb1..c99c81c 100644
--- a/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
+++ b/docs/Snow-Lang-Syntax/Snow-Lang-Syntax.md
@@ -57,10 +57,8 @@ bool 类型:
|---------|----|
| b、B | 7b |
| s、S | 7s |
-| i、I | 7i |
| l、L | 7l |
| f、F | 7f |
-| d、D | 7d |
### 变量
From a9b4a6682a06ee93254f98d6b64d78a402c83b6a Mon Sep 17 00:00:00 2001
From: zhangxun <1958638841@qq.com>
Date: Mon, 4 Aug 2025 16:37:04 +0800
Subject: [PATCH 34/38] =?UTF-8?q?fix:=20=E7=9C=81=E7=95=A5=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97=E5=87=BD=E6=95=B0=E8=B0=83=E7=94=A8=E5=89=8D=E7=BC=80?=
=?UTF-8?q?=EF=BC=8C=E8=AF=AD=E4=B9=89=E5=88=86=E6=9E=90=E4=BE=9D=E7=84=B6?=
=?UTF-8?q?=E5=88=A4=E5=AE=9A=E5=87=BD=E6=95=B0=E5=AD=98=E5=9C=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../expression/CallExpressionAnalyzer.java | 30 +------------------
1 file changed, 1 insertion(+), 29 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/compiler/semantic/analyzers/expression/CallExpressionAnalyzer.java b/src/main/java/org/jcnc/snow/compiler/semantic/analyzers/expression/CallExpressionAnalyzer.java
index df0993c..250e12e 100644
--- a/src/main/java/org/jcnc/snow/compiler/semantic/analyzers/expression/CallExpressionAnalyzer.java
+++ b/src/main/java/org/jcnc/snow/compiler/semantic/analyzers/expression/CallExpressionAnalyzer.java
@@ -80,35 +80,7 @@ public class CallExpressionAnalyzer implements ExpressionAnalyzer
Date: Fri, 22 Aug 2025 17:34:53 +0800
Subject: [PATCH 35/38] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E8=AF=8D?=
=?UTF-8?q?=E6=B3=95=E5=88=86=E6=9E=90=E5=99=A8=E4=B8=AD=E7=9A=84=E8=B0=83?=
=?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
index ec69e67..74f74f3 100644
--- a/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
+++ b/src/main/java/org/jcnc/snow/compiler/lexer/core/LexerEngine.java
@@ -56,9 +56,9 @@ public class LexerEngine {
/* 2. 后置整体校验 */
validateTokens();
/* 3. 打印 token */
- if (SnowConfig.isDebug()) {
- TokenPrinter.print(tokens);
- }
+// if (SnowConfig.isDebug()) {
+// TokenPrinter.print(tokens);
+// }
/* 4. 统一报告错误 */
report(errors);
From df07531edcf0beff566a3685c09e328dd139cff5 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sun, 24 Aug 2025 12:05:15 +0800
Subject: [PATCH 36/38] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20bug=20issue?=
=?UTF-8?q?=20=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E8=BD=AF=E4=BB=B6?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E9=80=89=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
将 v0.6.0 版本替换为 v0.7.0版本,以反映软件的最新版本。
---
.gitee/ISSUE_TEMPLATE/bug.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitee/ISSUE_TEMPLATE/bug.yml b/.gitee/ISSUE_TEMPLATE/bug.yml
index f7f9965..2825f1f 100644
--- a/.gitee/ISSUE_TEMPLATE/bug.yml
+++ b/.gitee/ISSUE_TEMPLATE/bug.yml
@@ -69,7 +69,7 @@ body:
attributes:
label: 软件版本/分支
options:
- - v0.6.0
+ - v0.7.0
- main
- dev
- 其他
From 99345ddd19929fec17b025af9f0b31164cf74816 Mon Sep 17 00:00:00 2001
From: Luke
Date: Sun, 24 Aug 2025 12:05:30 +0800
Subject: [PATCH 37/38] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E7=89=88=E6=9C=AC=E8=87=B30.7.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 4 ++--
pom.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 60dbc44..f67ed9f 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/pom.xml b/pom.xml
index 8846ae1..6b8b27d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
org.jcnc.snow
Snow
- 0.6.0
+ 0.7.0
UTF-8
From 80efd7c357295c3c644b62b020f3514ededbda3a Mon Sep 17 00:00:00 2001
From: Luke
Date: Sun, 24 Aug 2025 12:13:23 +0800
Subject: [PATCH 38/38] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20os.snow?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=BA=93=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../org/jcnc/snow/pkg/tasks/GenerateTask.java | 13 ++++++--
.../org/jcnc/snow/pkg/utils/SnowExample.java | 30 +++++++++++++++----
2 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/jcnc/snow/pkg/tasks/GenerateTask.java b/src/main/java/org/jcnc/snow/pkg/tasks/GenerateTask.java
index 4794994..3364823 100644
--- a/src/main/java/org/jcnc/snow/pkg/tasks/GenerateTask.java
+++ b/src/main/java/org/jcnc/snow/pkg/tasks/GenerateTask.java
@@ -16,7 +16,7 @@ import java.util.List;
* main.snow。
*
*
- * 生成内容包括:
+ * 生成内容包括:
*