aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/tables.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
committerLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
commit7066392d1c974065181d95d93274136dcd625d43 (patch)
treecf51eafc2c52cbc12246a306bca172d799193d30 /spec/inputs/tables.yue
parent90cd12ad9ef465f3e435e1bd034dcfbe4e19d016 (diff)
downloadyuescript-7066392d1c974065181d95d93274136dcd625d43.tar.gz
yuescript-7066392d1c974065181d95d93274136dcd625d43.tar.bz2
yuescript-7066392d1c974065181d95d93274136dcd625d43.zip
stop reusing variables, rename project.
Diffstat (limited to 'spec/inputs/tables.yue')
-rw-r--r--spec/inputs/tables.yue223
1 files changed, 223 insertions, 0 deletions
diff --git a/spec/inputs/tables.yue b/spec/inputs/tables.yue
new file mode 100644
index 0000000..2c6dff9
--- /dev/null
+++ b/spec/inputs/tables.yue
@@ -0,0 +1,223 @@
1
2backpack =
3 something:
4 yeah: 200
5 they: ->
6 print "hello"
7 yor_feet"small"
8 pretty: hair
9 gold: hmm
10 yow: 1000
11
12 eat: goo
13 yeah: dudd
14
15
16start =
17 something: "cold"
18
19bathe =
20 on: "fire"
21
22another =
23 [4]: 232
24 ["good food"]: "is the best"
25
26fwip =
27 something: hello"what", number: 2323,
28 what: yo "momma", "yeah",
29 fruit: basket
30 nuts: day
31
32
33frick = hello: "world"
34
35frack, best = hello: "world", rice: 3434, "what"
36
37ya = { 1,2,3, key: 100, 343, "hello", umm: 232 }
38
39
40x = { 1,2,
41 4343, 343 ,343 }
42
43
44g, p = {
45 1,2, nowy: "yes", 3,4,
46 hey: 232, another: "day"
47}, 234
48
49annother = {
50 1,2,3
51 3,4,5
52 6,7,8
53}
54
55yeah = {
56 [232]: 3434, "helo"
57 ice: "cake"
58}
59
60-- confusing stuff...
61whatabout = {
62 hello world, another
63 what, about, now
64
65 hello"world", yeah
66 hello "world", yeah
67}
68
69x =
70 -- yeah
71 something: => "hello"
72 cool: -- umm
73 --so ething
74 bed: {
75 2323,2323
76 }
77 red: 2343 -- here
78 -- what
79 name: (node) => @value node -- here
80 -- comment me
81-- okay
82
83
84x = { :something, something: something }
85
86y = {
87 :hi, :there, :how, :you
88 :thing
89}
90
91call_me "hello", :x, :y, :z
92
93t = {
94 a: 'a'
95 [b]: 'b'
96}
97
98xam = {
99 hello: 1234
100 "hello": 12354
101 [[hello]]: 12354
102 ["hello"]: 12354
103 [ [[hello]] ]: 12354
104}
105
106
107kam = {
108 hello: 12
109 goodcheese:
110 "mmm"
111
112 yeah:
113 12 + 232
114
115 lets:
116 keepit going: true,
117 okay: "yeah"
118
119 more:
120 {
121 1, [x for x=1,10]
122 }
123
124 [{"one", "two"}]:
125 one_thing =>
126}
127
128-- both of these have desirable output
129keepit going: true,
130 okay: "yeah",
131 workd: "okay"
132
133thing what:
134 "great", no:
135 "more"
136 okay: 123
137
138
139--
140thing what:
141 "great", no:
142 "more"
143_ = okay: 123 -- a anon table
144
145
146--
147
148k = { "hello": "world" }
149k = { 'hello': 'world' }
150k = { "hello": 'world', "hat": "zat" }
151
152please "hello": "world"
153k = "hello": "world", "one": "zone"
154
155f = "one", "two": three, "four"
156f = "two": three, "four"
157f = { "one", "two": three, "four" }
158
159
160j = "one", "two": three, "four": five, 6, 7
161
162heroine =
163 name: "Christina"
164 age: 18
165 job: "Princess"
166 likes:
167 * name: "kittens"
168 img: "/image/kittens.png"
169 * name: "flower"
170 img: "/image/flower.png"
171 items:
172 * name: "ring"
173 amount: 2
174 * name: "necklace"
175 amount: 1
176 status:
177 desc: "weak"
178 * attribute: "health"
179 value: 50
180 * attribute: "mana"
181 value: 100
182
183inventory =
184 equipment:
185 * "sword"
186 * "shield"
187 items:
188 * name: "potion"
189 count: 10
190 * name: "bread"
191 count: 3
192
193items =
194 * func!
195 * with tb
196 .abc = 123
197 * {1, 2, 3}
198 * f {1, 2, 3}
199 * f
200 * 1
201 * 2
202 * 3
203 * [i for i = 1, 3]
204 * "#{if a then b}"
205
206pairs =
207 *
208 * "king"
209 * "queen"
210 *
211 * "hero"
212 * "princess"
213
214items =
215 *
216 name: "ring"
217 amount: 2
218 *
219 name: "necklace"
220 amount: 1
221
222nil
223