diff options
Diffstat (limited to 'spec/inputs/tables.mp')
-rw-r--r-- | spec/inputs/tables.mp | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/spec/inputs/tables.mp b/spec/inputs/tables.mp new file mode 100644 index 0000000..e816003 --- /dev/null +++ b/spec/inputs/tables.mp | |||
@@ -0,0 +1,207 @@ | |||
1 | |||
2 | backpack = | ||
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 | |||
16 | start = | ||
17 | something: "cold" | ||
18 | |||
19 | bathe = | ||
20 | on: "fire" | ||
21 | |||
22 | another = | ||
23 | [4]: 232 | ||
24 | ["good food"]: "is the best" | ||
25 | |||
26 | fwip = | ||
27 | something: hello"what", number: 2323, | ||
28 | what: yo "momma", "yeah", | ||
29 | fruit: basket | ||
30 | nuts: day | ||
31 | |||
32 | |||
33 | frick = hello: "world" | ||
34 | |||
35 | frack, best = hello: "world", rice: 3434, "what" | ||
36 | |||
37 | ya = { 1,2,3, key: 100, 343, "hello", umm: 232 } | ||
38 | |||
39 | |||
40 | x = { 1,2, | ||
41 | 4343, 343 ,343 } | ||
42 | |||
43 | |||
44 | g, p = { | ||
45 | 1,2, nowy: "yes", 3,4, | ||
46 | hey: 232, another: "day" | ||
47 | }, 234 | ||
48 | |||
49 | annother = { | ||
50 | 1,2,3 | ||
51 | 3,4,5 | ||
52 | 6,7,8 | ||
53 | } | ||
54 | |||
55 | yeah = { | ||
56 | [232]: 3434, "helo" | ||
57 | ice: "cake" | ||
58 | } | ||
59 | |||
60 | -- confusing stuff... | ||
61 | whatabout = { | ||
62 | hello world, another | ||
63 | what, about, now | ||
64 | |||
65 | hello"world", yeah | ||
66 | hello "world", yeah | ||
67 | } | ||
68 | |||
69 | x = | ||
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 | |||
84 | x = { :something, something: something } | ||
85 | |||
86 | y = { | ||
87 | :hi, :there, :how, :you | ||
88 | :thing | ||
89 | } | ||
90 | |||
91 | call_me "hello", :x, :y, :z | ||
92 | |||
93 | t = { | ||
94 | a: 'a' | ||
95 | [b]: 'b' | ||
96 | } | ||
97 | |||
98 | xam = { | ||
99 | hello: 1234 | ||
100 | "hello": 12354 | ||
101 | [[hello]]: 12354 | ||
102 | ["hello"]: 12354 | ||
103 | [ [[hello]] ]: 12354 | ||
104 | } | ||
105 | |||
106 | |||
107 | kam = { | ||
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 | ||
129 | keepit going: true, | ||
130 | okay: "yeah", | ||
131 | workd: "okay" | ||
132 | |||
133 | thing what: | ||
134 | "great", no: | ||
135 | "more" | ||
136 | okay: 123 | ||
137 | |||
138 | |||
139 | -- | ||
140 | thing what: | ||
141 | "great", no: | ||
142 | "more" | ||
143 | _ = okay: 123 -- a anon table | ||
144 | |||
145 | |||
146 | -- | ||
147 | |||
148 | k = { "hello": "world" } | ||
149 | k = { 'hello': 'world' } | ||
150 | k = { "hello": 'world', "hat": "zat" } | ||
151 | |||
152 | please "hello": "world" | ||
153 | k = "hello": "world", "one": "zone" | ||
154 | |||
155 | f = "one", "two": three, "four" | ||
156 | f = "two": three, "four" | ||
157 | f = { "one", "two": three, "four" } | ||
158 | |||
159 | |||
160 | j = "one", "two": three, "four": five, 6, 7 | ||
161 | |||
162 | heroine = | ||
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 | |||
183 | inventory = | ||
184 | equipment: | ||
185 | * "sword" | ||
186 | * "shield" | ||
187 | items: | ||
188 | * name: "potion" | ||
189 | count: 10 | ||
190 | * name: "bread" | ||
191 | count: 3 | ||
192 | |||
193 | items = | ||
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 | |||
206 | nil | ||
207 | |||