From d2a6bde8cd54f5fbc613f96d8d0421e7ade03e08 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 14 Jul 2025 23:03:09 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=B9=B6=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=A7=84=E5=88=99=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 Snow 语言语法规范,调整错误分类表格格式和示例代码结构 --- .lingma/rules/project_rule.md | 2 ++ .../Snow-Lang-Grammar-Specification.md.md | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .lingma/rules/project_rule.md diff --git a/.lingma/rules/project_rule.md b/.lingma/rules/project_rule.md new file mode 100644 index 0000000..aea8af4 --- /dev/null +++ b/.lingma/rules/project_rule.md @@ -0,0 +1,2 @@ +**添加规则文件可帮助模型精准理解你的编码偏好,如框架、代码风格等** +**规则文件只对当前工程生效,单文件限制10000字符。如果无需将该文件提交到远程 Git 仓库,请将其添加到 .gitignore** \ No newline at end of file diff --git a/docs/Snow-Lang-Syntax/Snow-Lang-Grammar-Specification.md.md b/docs/Snow-Lang-Syntax/Snow-Lang-Grammar-Specification.md.md index 495d43b..a60b3fd 100644 --- a/docs/Snow-Lang-Syntax/Snow-Lang-Grammar-Specification.md.md +++ b/docs/Snow-Lang-Syntax/Snow-Lang-Grammar-Specification.md.md @@ -421,8 +421,8 @@ declare a: Point = Point(1, 2) ## 9 · 错误分类 -| 编译期错误代码 | 产生条件 | -| ---------------------- | -------------------------- | +| 编译期错误代码 | 产生条件 | +|----------------------|----------------------------| | DuplicateName | 违反唯一性规则;结构体内有参数签名完全相同的构造函数 | | UnresolvedIdentifier | 名字无法解析 | | ReturnMissing | 非 void 函数缺少 return | @@ -430,7 +430,7 @@ declare a: Point = Point(1, 2) | ImportCycle | (可选)检测到循环依赖 | | CtorAmbiguous | 构造函数重载时参数匹配不唯一 | | CtorNotFound | 构造函数重载时无匹配参数签名 | -|AccessDenied | 访问了以 `_` 开头的私有变量或方法但不在允许范围| +| AccessDenied | 访问了以 `_` 开头的私有变量或方法但不在允许范围 | --- @@ -517,10 +517,10 @@ module: RectExample function: main returns: int - declare rect1: Rectangle = Rectangle(0, 0, 10, 10) - declare rect2: Rectangle = Rectangle(5, 6) - declare result: int = 0 body: + declare rect1: Rectangle = Rectangle(0, 0, 10, 10) + declare rect2: Rectangle = Rectangle(5, 6) + declare result: int = 0 if rect1.area() > 50 then loop: init: