This repository was archived by the owner on Aug 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 11# CodeNothing 更新日志
22
3- ## [ v0.4.5] - 2025-07-26
3+ ## [ v0.4.6] - 2025-07-26
4+ ### 🚀 重大新功能:默认参数值与原始字符串字面量
5+ - ** 默认参数值 (Default Parameter Values)**
6+ - 函数参数可指定默认值:` fn greet(name : string = "世界") : string { ... } `
7+ - 提高API灵活性,简化函数调用
8+ - 支持常量、变量和表达式作为默认值
9+ - 可选参数与必需参数混合使用
10+ - ** 原始字符串字面量 (Raw String Literals)**
11+ - 使用` r"..." ` 语法定义无需转义的字符串
12+ - 保留字符的字面值,包括` \n ` 、` \t ` 、` \ ` 等
13+ - 特别适用于正则表达式、文件路径等场景
14+ - 提高代码可读性和简洁性
15+
16+ ### 🔧 技术实现
17+ - ** AST扩展** :新增` RawStringLiteral ` 表达式类型和` Parameter.default_value ` 字段
18+ - ** 解析器增强** :支持解析函数参数默认值和原始字符串格式
19+ - ** 求值逻辑改进** :在函数调用时自动处理默认参数值
20+
21+ ### 📝 语法示例
22+ ``` cn
23+ // 默认参数值示例
24+ fn createRect(width : float = 100.0, height : float = 50.0) : object {
25+ return {width: width, height: height};
26+ };
27+
28+ // 原始字符串示例
29+ regex_pattern : string = r"\d+\.\d+"; // 正则表达式不需要双重转义
30+ path : string = r"C:\Program Files\App"; // 文件路径无需转义
31+ ```
32+
33+ ### 📚 详细文档
34+ - 完整的功能文档:[ DEFAULT_PARAMS_RAW_STRINGS_CHANGELOG_v0.4.6.md] ( file-doc/DEFAULT_PARAMS_RAW_STRINGS_CHANGELOG_v0.4.6.md )
35+
36+ ## [ v0.4.5] - 2025-10-15
437### 🚀 重大新功能:字符串插值
538- ** 模板字符串语法** : 添加使用反引号定义的模板字符串
639 - 表达式嵌入:使用` ${...} ` 语法在字符串中嵌入表达式
You can’t perform that action at this time.
0 commit comments