diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
| commit | e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch) | |
| tree | 6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/inputs/unicode/export.yue | |
| parent | 289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff) | |
| download | yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2 yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip | |
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/inputs/unicode/export.yue')
| -rw-r--r-- | spec/inputs/unicode/export.yue | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/spec/inputs/unicode/export.yue b/spec/inputs/unicode/export.yue new file mode 100644 index 0000000..151c5f5 --- /dev/null +++ b/spec/inputs/unicode/export.yue | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | |||
| 2 | export 变量a,变量b,变量c = 223, 343, 123 | ||
| 3 | export 酷 = "🧧" | ||
| 4 | |||
| 5 | 变量d,变量e,变量f = 3, 2, 1 | ||
| 6 | export 变量d, 变量e, 变量f | ||
| 7 | |||
| 8 | export class 某类 | ||
| 9 | 嗯: "酷" | ||
| 10 | |||
| 11 | export if 这个 | ||
| 12 | 232 | ||
| 13 | else | ||
| 14 | 4343 | ||
| 15 | |||
| 16 | export 什么 = if 这个 | ||
| 17 | 232 | ||
| 18 | else | ||
| 19 | 4343 | ||
| 20 | |||
| 21 | export 变量y = -> | ||
| 22 | 你好 = 3434 | ||
| 23 | |||
| 24 | export with 临时 | ||
| 25 | 变量j = 2000 | ||
| 26 | |||
| 27 | export cb的值 = do | ||
| 28 | 变量h = 100 | ||
| 29 | (参数)<- 函数 | ||
| 30 | return 参数 h变量 | ||
| 31 | |||
| 32 | export 丫丫 = -> | ||
| 33 | 变量h = 100 | ||
| 34 | 变量k = 100 | ||
| 35 | |||
| 36 | export switch 变量h | ||
| 37 | when 100, 150 then 200 | ||
| 38 | when 200 then 300 | ||
| 39 | else 0 | ||
| 40 | |||
| 41 | export 常量 = switch 值 | ||
| 42 | when "好" then 1 | ||
| 43 | when "更好" then 2 | ||
| 44 | when "最好" then 3 | ||
| 45 | |||
| 46 | export 项目 = 123 | ||
| 47 | |> 函数 | ||
| 48 | |||
| 49 | export 变量x | ||
| 50 | |||
| 51 | 函数 if 条件a then 值b | ||
| 52 | 函数 do 123 | ||
| 53 | 函数 switch 对象a | ||
| 54 | when 变量b then 值c | ||
| 55 | 函数 [计数 for 计数 = 1,10] | ||
| 56 | 函数 for 计数 = 1,10 do 计数 | ||
| 57 | 函数 {键,值 for 键,值 in pairs 表} | ||
| 58 | 函数 for 键,值 in pairs 表 do {键,值} | ||
| 59 | 函数 while 条件a do true | ||
| 60 | 函数 with 条件a | ||
| 61 | .字段b = 123 | ||
| 62 | 函数 对象a?.字段b | ||
| 63 | 函数 对象a\字段b | ||
| 64 | 函数 class A类 | ||
| 65 | |||
| 66 | _ = "#{if 条件a then 值b}" | ||
| 67 | _ = "#{do 123}" | ||
| 68 | _ = "#{switch 对象a | ||
| 69 | when 变量b then 值c}" | ||
| 70 | _ = "#{[计数 for 计数 = 1,10]}" | ||
| 71 | _ = "#{for 计数 = 1,10 do 计数}" | ||
| 72 | _ = "#{{键,值 for 键,值 in pairs 表}}" | ||
| 73 | _ = "#{for 键,值 in pairs 表 do {键,值}}" | ||
| 74 | _ = "#{while 条件a do true}" | ||
| 75 | _ = "#{with 对象a | ||
| 76 | .字段b = 123}" | ||
| 77 | _ = "#{对象a?.字段b}" | ||
| 78 | _ = "#{对象a\字段b}" | ||
| 79 | _ = "#{class A类}" | ||
| 80 | |||
| 81 | local * | ||
| 82 | 变量1 = 1 | ||
| 83 | export 变量2 = 2 | ||
| 84 | export 变量3 = class 类4 | ||
| 85 | 变量5 = 5 | ||
| 86 | |||
| 87 | export.<"🀄️"> = 1 | ||
| 88 | export.<name> = "导出" | ||
| 89 | export.<call> = => {} | ||
| 90 | export["导出-任意-名称"] = 123 | ||
