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/existential.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/existential.yue')
| -rw-r--r-- | spec/inputs/unicode/existential.yue | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/spec/inputs/unicode/existential.yue b/spec/inputs/unicode/existential.yue new file mode 100644 index 0000000..0e35a39 --- /dev/null +++ b/spec/inputs/unicode/existential.yue | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | |||
| 2 | 函数1?! | ||
| 3 | |||
| 4 | 函数2? "参数0",123 | ||
| 5 | |||
| 6 | 变量x = 表?.值 | ||
| 7 | |||
| 8 | 打印 对象abc?["你好 世界"]?.字段xyz | ||
| 9 | |||
| 10 | if 打印 and 变量x? | ||
| 11 | 打印 变量x | ||
| 12 | |||
| 13 | @?\函数 998 | ||
| 14 | |||
| 15 | with 对象abc?!\函数?! | ||
| 16 | if \函数p? "abc" | ||
| 17 | return 123 | ||
| 18 | |||
| 19 | if {:x字段} = 对象a?.如果?\然后?(123)? @?\方法 998 | ||
| 20 | 打印 x字段 | ||
| 21 | |||
| 22 | 结果 = 对象b.方法\执行!\当?("没问题")\如果("默认",998)\函数? | ||
| 23 | 打印 结果 | ||
| 24 | |||
| 25 | 自我为中心 = true if 思想? and not 世界? | ||
| 26 | |||
| 27 | 速度 = 0 | ||
| 28 | 速度 or= 15 | ||
| 29 | |||
| 30 | 脚印 = 野人 or "熊" | ||
| 31 | |||
| 32 | 专业 = '计算机科学' | ||
| 33 | |||
| 34 | unless 专业? | ||
| 35 | 选修课程 '葡萄酒入门' | ||
| 36 | |||
| 37 | if 窗体? | ||
| 38 | 环境 = '浏览器(有可能)' | ||
| 39 | |||
| 40 | 邮编 = 抽奖.中奖者?!.地址?.邮政编码 | ||
| 41 | |||
| 42 | 长度 = utf8?.长度 or 字符串?.长度 or (对象) -> #对象 | ||
| 43 | |||
| 44 | 变量a = 表1?\结束? 123 + 表2?\然后 456 | ||
| 45 | |||
| 46 | 变量b = 表1?\结束? or 表2?\然后 | ||
| 47 | |||
| 48 | with? io.open "测试.txt", "w" | ||
| 49 | \write "你好" | ||
| 50 | \close! | ||
| 51 | |||
| 52 | 表?.<call>? 123 | ||
| 53 | |||
| 54 | with? 表.<>?.<index> | ||
| 55 | .字段a = 1 | ||
| 56 | |||
| 57 | nil | ||
| 58 | |||
