aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/unicode/string.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
committerLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
commite61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch)
tree6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/outputs/unicode/string.lua
parent289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff)
downloadyuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz
yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2
yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/outputs/unicode/string.lua')
-rw-r--r--spec/outputs/unicode/string.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/outputs/unicode/string.lua b/spec/outputs/unicode/string.lua
new file mode 100644
index 0000000..6bfb033
--- /dev/null
+++ b/spec/outputs/unicode/string.lua
@@ -0,0 +1,53 @@
1local _u4f60_u597d = "你好"
2local _u95ee_u5019 = "啥事,好吧"
3_u6253_u5370(_u4f60_u597d)
4local _u55ef = '嗯'
5local _u8fd9_u91cc, _u53e6_u4e00_u4e2a = "好的", '世界'
6local _u5440 = "YU'M"
7_u4f60('我说:"嗯"')
8_u6253_u5370(_u5440, _u4f60)
9_u53e6_u4e00_u4e2a = [[ 你好 世界 ]]
10local _u4f60_u597d__u90a3_u91cc = [[ 你好呀
11]]
12local _u597d_u5427 = [==[ "helo" ]==]
13local _u54c8_u55bd = [===[ eat noots]===]
14local _u55ef_u55ef = [[well trhere]]
15local _u6587_u5b57 = [[
16nil
17Fail to compile
18]]
19_u6587_u5b57[ [[abc]]] = [["#{变量i}" for 变量i = 1, 10] for 变量i = 1, 10]]
20local _u54e6_u54e6 = ""
21local _u53d8_u91cfx = "\\"
22_u53d8_u91cfx = "a\\b"
23_u53d8_u91cfx = "\\\n"
24_u53d8_u91cfx = "\""
25local _u53d8_u91cfa = "你好 " .. tostring(_u95ee_u5019) .. " 你好"
26local _u53d8_u91cfb = tostring(_u95ee_u5019) .. " 你好"
27local _u53d8_u91cfc = "你好 " .. tostring(5 + 1)
28local _u53d8_u91cfd = tostring(_u4f60_u597d(_u4e16_u754c))
29local _u53d8_u91cfe = tostring(1) .. " " .. tostring(2) .. " " .. tostring(3)
30local _u53d8_u91cff = [[你好 #{世界} 世界]]
31local _u53d8_u91cfg = "#{你好 世界}"
32_u53d8_u91cfa = '你好 #{问候} 你好'
33_u53d8_u91cfb = '#{问候} 你好'
34_u53d8_u91cfc = '你好 #{问候}'
35local _u53d8_u91cf_ = "你好"
36local _call_0 = ("你好")
37_call_0["格式"](_call_0, 1)
38local _call_1 = ("你好")
39_call_1["格式"](_call_1, 1, 2, 3)
40local _call_2 = ("你好")
41_call_2["格式"](_call_2, 1, 2, 3)(1, 2, 3)
42local _call_3 = ("你好")
43_call_3["世界"](_call_3)
44local _call_4 = ("你好")
45_call_4["格式"](_call_4)["问候"](1, 2, 3)
46local _call_5 = ("你好")
47_call_5["格式"](_call_5, 1, 2, 3)
48local _call_6 = _u67d0_u4e8b("你好")
49_call_6["世界"](_call_6)
50return _u67d0_u4e8b((function()
51 local _call_7 = ("你好")
52 return _call_7["世界"](_call_7)
53end)())