diff options
author | Li Jin <dragon-fly@qq.com> | 2021-02-17 11:22:07 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-02-17 11:22:07 +0800 |
commit | 7066392d1c974065181d95d93274136dcd625d43 (patch) | |
tree | cf51eafc2c52cbc12246a306bca172d799193d30 /spec/inputs/export.yue | |
parent | 90cd12ad9ef465f3e435e1bd034dcfbe4e19d016 (diff) | |
download | yuescript-7066392d1c974065181d95d93274136dcd625d43.tar.gz yuescript-7066392d1c974065181d95d93274136dcd625d43.tar.bz2 yuescript-7066392d1c974065181d95d93274136dcd625d43.zip |
stop reusing variables, rename project.
Diffstat (limited to 'spec/inputs/export.yue')
-rw-r--r-- | spec/inputs/export.yue | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/spec/inputs/export.yue b/spec/inputs/export.yue new file mode 100644 index 0000000..085510e --- /dev/null +++ b/spec/inputs/export.yue | |||
@@ -0,0 +1,79 @@ | |||
1 | |||
2 | export a,b,c = 223, 343, 123 | ||
3 | export cool = "dad" | ||
4 | |||
5 | d,e,f = 3, 2, 1 | ||
6 | export d, e, f | ||
7 | |||
8 | export class Something | ||
9 | umm: "cool" | ||
10 | |||
11 | export if this | ||
12 | 232 | ||
13 | else | ||
14 | 4343 | ||
15 | |||
16 | export What = if this | ||
17 | 232 | ||
18 | else | ||
19 | 4343 | ||
20 | |||
21 | export y = -> | ||
22 | hallo = 3434 | ||
23 | |||
24 | export with tmp | ||
25 | j = 2000 | ||
26 | |||
27 | export cbVal = do | ||
28 | h = 100 | ||
29 | (x)<- f | ||
30 | return x h | ||
31 | |||
32 | export y = -> | ||
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 Constant = switch value | ||
42 | when "good" then 1 | ||
43 | when "better" then 2 | ||
44 | when "best" then 3 | ||
45 | |||
46 | export item = 123 | ||
47 | |> func | ||
48 | |||
49 | export x | ||
50 | |||
51 | f if a then b | ||
52 | f do 123 | ||
53 | f switch a | ||
54 | when b then c | ||
55 | f [i for i = 1,10] | ||
56 | f for i = 1,10 do i | ||
57 | f {k,v for k,v in pairs tb} | ||
58 | f for k,v in pairs tb do k,v | ||
59 | f while a do true | ||
60 | f with a | ||
61 | .b = 123 | ||
62 | f a?.b | ||
63 | f a\b | ||
64 | f class A | ||
65 | |||
66 | _ = "#{if a then b}" | ||
67 | _ = "#{do 123}" | ||
68 | _ = "#{switch a | ||
69 | when b then c}" | ||
70 | _ = "#{[i for i = 1,10]}" | ||
71 | _ = "#{for i = 1,10 do i}" | ||
72 | _ = "#{{k,v for k,v in pairs tb}}" | ||
73 | _ = "#{for k,v in pairs tb do k,v}" | ||
74 | _ = "#{while a do true}" | ||
75 | _ = "#{with a | ||
76 | .b = 123}" | ||
77 | _ = "#{a?.b}" | ||
78 | _ = "#{a\b}" | ||
79 | _ = "#{class A}" | ||