diff options
author | Li Jin <dragon-fly@qq.com> | 2025-04-17 11:05:06 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2025-04-17 11:05:06 +0800 |
commit | 0446b12d7be2ba4e8534987864fedfc586510291 (patch) | |
tree | 3ed0b3efa0b6e4247cf7b4832704f3667fabd2ca /spec | |
parent | 1c47083a8e2fe8a08a9dcf7d4520b4de98134c5d (diff) | |
download | yuescript-0446b12d7be2ba4e8534987864fedfc586510291.tar.gz yuescript-0446b12d7be2ba4e8534987864fedfc586510291.tar.bz2 yuescript-0446b12d7be2ba4e8534987864fedfc586510291.zip |
Fixed issue #209.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/literals.yue | 9 | ||||
-rw-r--r-- | spec/outputs/5.1/literals.lua | 44 | ||||
-rw-r--r-- | spec/outputs/literals.lua | 8 |
3 files changed, 61 insertions, 0 deletions
diff --git a/spec/inputs/literals.yue b/spec/inputs/literals.yue index 6b666f0..32cf7e7 100644 --- a/spec/inputs/literals.yue +++ b/spec/inputs/literals.yue | |||
@@ -10,10 +10,19 @@ _ = { | |||
10 | 0xfF2323 | 10 | 0xfF2323 |
11 | 0xabcdef | 11 | 0xabcdef |
12 | 0xABCDEF | 12 | 0xABCDEF |
13 | 0XFB_C4_00 | ||
13 | 0x123p-123 | 14 | 0x123p-123 |
14 | 0xABCP+321 | 15 | 0xABCP+321 |
15 | 0x.1p-111 | 16 | 0x.1p-111 |
16 | 0xA_B_CP-3_2_1 | 17 | 0xA_B_CP-3_2_1 |
18 | 0x0.1E | ||
19 | 0xA23p-4 | ||
20 | 0X1.921FB54442D18P+1 | ||
21 | |||
22 | 0b01 | ||
23 | 0b00_00_10_00 | ||
24 | 0B1111 | ||
25 | 0B00_11_00_10_01 | ||
17 | 26 | ||
18 | .2323 | 27 | .2323 |
19 | .2323e-1 | 28 | .2323e-1 |
diff --git a/spec/outputs/5.1/literals.lua b/spec/outputs/5.1/literals.lua new file mode 100644 index 0000000..36c705a --- /dev/null +++ b/spec/outputs/5.1/literals.lua | |||
@@ -0,0 +1,44 @@ | |||
1 | local _ = { | ||
2 | 121, | ||
3 | 121.2323, | ||
4 | 121.2323e-1, | ||
5 | 121.2323e13434, | ||
6 | 2323E34, | ||
7 | 0x12323, | ||
8 | 0xfF2323, | ||
9 | 0xabcdef, | ||
10 | 0xABCDEF, | ||
11 | 0XFBC400, | ||
12 | 2.7365508487142853e-35, | ||
13 | 0xABCP321, | ||
14 | 2.4074124304840448e-35, | ||
15 | 6.4326233113470805e-94, | ||
16 | 0.1171875, | ||
17 | 162.1875, | ||
18 | 3.1415926535897931, | ||
19 | 1, | ||
20 | 8, | ||
21 | 15, | ||
22 | 201, | ||
23 | .2323, | ||
24 | .2323e-1, | ||
25 | .2323e13434, | ||
26 | 1LL, | ||
27 | 1ULL, | ||
28 | 9332LL, | ||
29 | 9332, | ||
30 | 0x2aLL, | ||
31 | 0x2aULL, | ||
32 | 1000000.0000001, | ||
33 | 1234e5678, | ||
34 | 1234E-5678, | ||
35 | 0xDEADBEEF, | ||
36 | [[ hello world ]], | ||
37 | [=[ hello world ]=], | ||
38 | [====[ hello world ]====], | ||
39 | "another world", | ||
40 | 'what world', | ||
41 | "\n hello world\n ", | ||
42 | 'yeah\n what is going on\n here is something cool' | ||
43 | } | ||
44 | return nil | ||
diff --git a/spec/outputs/literals.lua b/spec/outputs/literals.lua index a578d58..6de5411 100644 --- a/spec/outputs/literals.lua +++ b/spec/outputs/literals.lua | |||
@@ -8,10 +8,18 @@ local _ = { | |||
8 | 0xfF2323, | 8 | 0xfF2323, |
9 | 0xabcdef, | 9 | 0xabcdef, |
10 | 0xABCDEF, | 10 | 0xABCDEF, |
11 | 0XFBC400, | ||
11 | 0x123p-123, | 12 | 0x123p-123, |
12 | 0xABCP+321, | 13 | 0xABCP+321, |
13 | 0x.1p-111, | 14 | 0x.1p-111, |
14 | 0xABCP-321, | 15 | 0xABCP-321, |
16 | 0x0.1E, | ||
17 | 0xA23p-4, | ||
18 | 0X1.921FB54442D18P+1, | ||
19 | 1, | ||
20 | 8, | ||
21 | 15, | ||
22 | 201, | ||
15 | .2323, | 23 | .2323, |
16 | .2323e-1, | 24 | .2323e-1, |
17 | .2323e13434, | 25 | .2323e13434, |