on master help sign in
134 files changed+16038−15114
since splitsnapshots
unifiedsplit
TODO.md+11 desk/desk.ship+1 desk/lib/interlist.hoon+79 desk/lib/lua.hoon+1 desk/lib/lua/interpreter.hoon+554 zod/luau/lib/lua/parser.hoon → desk/lib/lua/parser.hoon+256−80 zod/luau/lib/lua/printer.hoon → desk/lib/lua/printer.hoon+25−14 zod/luau/lib/lua.hoon → desk/lib/lua/utils.hoon desk/lib/st.hoon+64 zod/luau/lib/strand.hoon → desk/lib/strand.hoon zod/luau/lib/strandio.hoon → desk/lib/strandio.hoon+21−1 zod/luau/mar/atom.hoon → desk/mar/atom.hoon zod/luau/mar/bill.hoon → desk/mar/bill.hoon zod/luau/mar/docket-0.hoon → desk/mar/docket-0.hoon zod/luau/mar/hoon.hoon → desk/mar/hoon.hoon zod/luau/mar/kelvin.hoon → desk/mar/kelvin.hoon zod/luau/mar/lua.hoon → desk/mar/lua.hoon zod/luau/mar/mime.hoon → desk/mar/mime.hoon zod/luau/mar/noun.hoon → desk/mar/noun.hoon zod/luau/mar/ship.hoon → desk/mar/ship.hoon zod/luau/mar/txt.hoon → desk/mar/txt.hoon zod/luau/res/lua/all.lua → desk/res/lua/all.lua zod/luau/res/lua/api.lua → desk/res/lua/api.lua zod/luau/res/lua/attrib.lua → desk/res/lua/attrib.lua desk/res/lua/bar.lua+23 desk/res/lua/baz.lua+6 zod/luau/res/lua/big.lua → desk/res/lua/big.lua zod/luau/res/lua/bitwise.lua → desk/res/lua/bitwise.lua zod/luau/res/lua/bwcoercion.lua → desk/res/lua/bwcoercion.lua zod/luau/res/lua/calls.lua → desk/res/lua/calls.lua zod/luau/res/lua/closure.lua → desk/res/lua/closure.lua zod/luau/res/lua/code.lua → desk/res/lua/code.lua zod/luau/res/lua/constructs.lua → desk/res/lua/constructs.lua zod/luau/res/lua/coroutine.lua → desk/res/lua/coroutine.lua zod/luau/res/lua/cstack.lua → desk/res/lua/cstack.lua desk/res/lua/cycled/all.lua+203 desk/res/lua/cycled/api.lua+1167 desk/res/lua/cycled/attrib.lua+431 desk/res/lua/cycled/bar.lua+2 desk/res/lua/cycled/big.lua+67 desk/res/lua/cycled/bitwise.lua+309 desk/res/lua/cycled/bwcoercion.lua+59 desk/res/lua/cycled/calls.lua+492 desk/res/lua/cycled/closure.lua+327 desk/res/lua/cycled/code.lua+586 desk/res/lua/cycled/constructs.lua+469 desk/res/lua/cycled/coroutine.lua+1119 desk/res/lua/cycled/cstack.lua+166 desk/res/lua/cycled/db.lua+947 desk/res/lua/cycled/errors.lua+493 desk/res/lua/cycled/events.lua+610 desk/res/lua/cycled/files.lua+818 desk/res/lua/cycled/foo.lua+82 desk/res/lua/cycled/gc.lua+790 desk/res/lua/cycled/gengc.lua+108 desk/res/lua/cycled/goto.lua+275 desk/res/lua/cycled/heavy.lua+126 desk/res/lua/cycled/literals.lua+199 desk/res/lua/cycled/locals.lua+1050 desk/res/lua/cycled/main.lua+312 desk/res/lua/cycled/math.lua+879 desk/res/lua/cycled/nextvar.lua+1055 desk/res/lua/cycled/pm.lua+404 desk/res/lua/cycled/sort.lua+309 desk/res/lua/cycled/strings.lua+441 desk/res/lua/cycled/tpack.lua+259 zod/luau/res/lua/cycled/tracegc.lua → desk/res/lua/cycled/tracegc.lua+2−2 desk/res/lua/cycled/utf8.lua+203 desk/res/lua/cycled/vararg.lua+137 desk/res/lua/cycled/verybig.lua+59 zod/luau/res/lua/db.lua → desk/res/lua/db.lua zod/luau/res/lua/errors.lua → desk/res/lua/errors.lua zod/luau/res/lua/events.lua → desk/res/lua/events.lua zod/luau/res/lua/files.lua → desk/res/lua/files.lua zod/luau/res/lua/foo.lua → desk/res/lua/foo.lua+2−5 zod/luau/res/lua/gc.lua → desk/res/lua/gc.lua zod/luau/res/lua/gengc.lua → desk/res/lua/gengc.lua zod/luau/res/lua/goto.lua → desk/res/lua/goto.lua zod/luau/res/lua/heavy.lua → desk/res/lua/heavy.lua zod/luau/res/lua/literals.lua → desk/res/lua/literals.lua zod/luau/res/lua/locals.lua → desk/res/lua/locals.lua zod/luau/res/lua/main.lua → desk/res/lua/main.lua zod/luau/res/lua/math.lua → desk/res/lua/math.lua zod/luau/res/lua/nextvar.lua → desk/res/lua/nextvar.lua zod/luau/res/lua/pm.lua → desk/res/lua/pm.lua zod/luau/res/lua/sort.lua → desk/res/lua/sort.lua zod/luau/res/lua/strings.lua → desk/res/lua/strings.lua zod/luau/res/lua/tpack.lua → desk/res/lua/tpack.lua zod/luau/res/lua/tracegc.lua → desk/res/lua/tracegc.lua zod/luau/res/lua/utf8.lua → desk/res/lua/utf8.lua zod/luau/res/lua/vararg.lua → desk/res/lua/vararg.lua zod/luau/res/lua/verybig.lua → desk/res/lua/verybig.lua desk/sur/interlist.hoon+8 zod/luau/sur/lua.hoon → desk/sur/lua.hoon+5−5 zod/luau/sur/spider.hoon → desk/sur/spider.hoon zod/luau/sys.kelvin → desk/sys.kelvin desk/ted/eval-lua.hoon+19 zod/luau/ted/test-lua.hoon → desk/ted/test-lua.hoon+8−9 zod/luau/TODO.md−6 zod/luau/lib/interlist.hoon−32 zod/luau/res/lua/cycled/all.lua−203 zod/luau/res/lua/cycled/api.lua−1167 zod/luau/res/lua/cycled/attrib.lua−431 zod/luau/res/lua/cycled/big.lua−67 zod/luau/res/lua/cycled/bitwise.lua−309 zod/luau/res/lua/cycled/bwcoercion.lua−59 zod/luau/res/lua/cycled/calls.lua−492 zod/luau/res/lua/cycled/closure.lua−327 zod/luau/res/lua/cycled/code.lua−586 zod/luau/res/lua/cycled/constructs.lua−469 zod/luau/res/lua/cycled/coroutine.lua−1119 zod/luau/res/lua/cycled/cstack.lua−166 zod/luau/res/lua/cycled/db.lua−947 zod/luau/res/lua/cycled/errors.lua−493 zod/luau/res/lua/cycled/events.lua−610 zod/luau/res/lua/cycled/files.lua−818 zod/luau/res/lua/cycled/foo.lua−82 zod/luau/res/lua/cycled/gc.lua−790 zod/luau/res/lua/cycled/gengc.lua−108 zod/luau/res/lua/cycled/goto.lua−275 zod/luau/res/lua/cycled/heavy.lua−126 zod/luau/res/lua/cycled/literals.lua−199 zod/luau/res/lua/cycled/locals.lua−1050 zod/luau/res/lua/cycled/main.lua−312 zod/luau/res/lua/cycled/math.lua−879 zod/luau/res/lua/cycled/nextvar.lua−1055 zod/luau/res/lua/cycled/pm.lua−404 zod/luau/res/lua/cycled/sort.lua−309 zod/luau/res/lua/cycled/strings.lua−441 zod/luau/res/lua/cycled/tpack.lua−259 zod/luau/res/lua/cycled/utf8.lua−203 zod/luau/res/lua/cycled/vararg.lua−137 zod/luau/res/lua/cycled/verybig.lua−59 zod/luau/tmp.hoon−9
TODO.mdnew file+11
@@ -0,0 +1,11 @@
1+# Parser
2+
3+- [x] functioncall
4+- [x] any string apart from the basic string with no escapes
5+- [x] check if int fits in int or make it a float
6+- [x] should `print-blok` have `do`-`end`? This is fucked.
7+- [x] binary operator priority
8+- [x] ^ should be higher priority than unary ops
9+- [x] Unifiy parened exprs
10+- [ ] pow
11+- [ ] attributes
desk/desk.shipnew file+1
@@ -0,0 +1 @@
1+~racfer-hattes
desk/lib/interlist.hoonnew file+79
@@ -0,0 +1,79 @@
1+/- *interlist
2+=<
3+|%
4+++ new
5+ |* [a=* b=(list [* *])]
6+ ^- (interlist _?<(?=(~ b) -.i.b) _a)
7+ ?~ b single+a
8+ double+[a -.i.b (new +.i.b t.b)]
9+++ turn-inter
10+ |* [l=(interlist) f=$-(* *)]
11+ ^- (interlist _$:f _?>(?=(%single -.l) +.l))
12+ ?- -.l
13+ %single [%single +.l]
14+ %double [%double val.l (f sep.l) $(l tail.l)]
15+ ==
16+++ turn
17+ |* [l=(interlist) f=$-(* *)]
18+ ^- (interlist _?>(?=(%double -.l) sep.l) _$:f)
19+ ?- -.l
20+ %single single+(f +.l)
21+ %double double+[(f val.l) sep.l $(l tail.l)]
22+ ==
23+++ reverse
24+ |* l=(interlist)
25+ ^+ l
26+ =/ tmp=(unit _?>(?=(%double -.l) +>.l)) ~
27+ |-
28+ ^+ l
29+ ?- -.l
30+ %single
31+ ?~ tmp l [%double +.l u.tmp]
32+ %double
33+ %= $
34+ l +>+.l
35+ tmp
36+ ?~ tmp `[+>-.l [%single +<.l]]
37+ `[+>-.l [%double +<.l u.tmp]]
38+ ==
39+ ==
40+++ parse
41+ |* [s=rule v=rule]
42+ =/ val (rule-type v)
43+ =/ sep (rule-type s)
44+ %+ cook
45+ |* [v=* rest=(list [* *])]
46+ ^- (interlist sep val)
47+ =/ rrest (flop rest)
48+ ?~ rrest [%single v]
49+ =/ tail
50+ %+ roll t.rrest
51+ |* [[s=* v=*] _[acc=`(interlist sep val)`[%single +.i.rrest] last-sep=-.i.rrest]]
52+ [[%double v last-sep acc] s]
53+ [%double v +.tail -.tail]
54+ ;~(plug v (star ;~(plug s v)))
55+++ split-left-on
56+ |* [is-pivot=$-(* ?) l=(interlist)]
57+ ^- (unit _[lhs=l pivot=+<.is-pivot rhs=l])
58+ ?- -.l
59+ %single ~
60+ %double
61+ ?: (is-pivot sep.l) `[[%single val.l] sep.l tail.l]
62+ =/ rest $(l tail.l)
63+ ?~ rest ~
64+ `[[%double val.l sep.l lhs.u.rest] pivot.u.rest rhs.u.rest]
65+ ==
66+++ split-right-on
67+ |* [is-pivot=$-(* ?) l=(interlist * *)]
68+ ^- (unit _[lhs=l pivot=+<.is-pivot rhs=l])
69+ %+ bind (split-left-on is-pivot (reverse l))
70+ |* [a=(interlist * *) b=* c=(interlist * *)] [(reverse c) b (reverse a)]
71+--
72+|%
73+++ rule-type
74+ |* =rule
75+ $_
76+ =/ ret q:$:rule
77+ ?> ?=(^ ret)
78+ p.u.ret
79+--
desk/lib/lua.hoonnew file+1
@@ -0,0 +1 @@
1+/+ lua-interpreter
desk/lib/lua/interpreter.hoonnew file+554
@@ -0,0 +1,554 @@
1+/- *lua
2+/+ st
3+=<
4+|= =chunk
5+((eval-chunk chunk) *state)
6+|%
7+++ eval-chunk
8+ |= =chunk
9+ ^- (eval-m value)
10+ ?- -.chunk
11+ %blok (eval-blok +.chunk)
12+ ==
13+++ object-id |$ obj @
14+++ objects
15+ |$ obj [objs=(map (object-id obj) obj) next-id=(object-id obj)]
16++$ value
17+ $%
18+ [%table val=(object-id table) meta=(unit (object-id table))]
19+ [%string string]
20+ [%num numeral]
21+ [%multires (lest value)]
22+ [%true ~]
23+ [%false ~]
24+ [%nil ~]
25+ ==
26++$ lval
27+ $%
28+ [%var name]
29+ [%table-field (object-id table) value]
30+ ==
31++$ table (map value value)
32++$ state
33+ $:
34+ tables=$~([(malt ~[[0 *table]]) 1] (objects table))
35+ global-env=table
36+ local-envs=$~(~[(malt ~[['_ENV' table+[0 ~]]])] (lest (map name value)))
37+ ==
38+++ eval-m
39+ |$ [val]
40+ $-(state [st=state val=val])
41+++ pure
42+ |* x=*
43+ ^- (eval-m _x)
44+ |=(st=state [st x])
45+++ bind
46+ |* =mold
47+ |* [prev=(eval-m) cont=$-(* (eval-m mold))]
48+ ^+ $:cont
49+ |= st=state
50+ =/ [st=state val=_val:$:prev] (prev st)
51+ ((cont val) st)
52+++ get-state
53+ ^- (eval-m state)
54+ |= st=state
55+ [st st]
56+++ set-state
57+ |= st=state
58+ ^- (eval-m ~)
59+ |= state
60+ [st ~]
61+++ eval-blok
62+ =<
63+ |= =blok
64+ ^- (eval-m value)
65+ %- with-local
66+ =/ body body.blok
67+ |-
68+ ^- (eval-m value)
69+ ?~ body
70+ ?~ ret.blok (pure nil+~)
71+ ?~ u.ret.blok (pure nil+~)
72+ ;< rets=(lest value) bind (eval-exprlist u.u.ret.blok)
73+ (pure (multires rets))
74+ ;< ~ bind (eval-stat i.body)
75+ ;< ret=value bind $(body t.body)
76+ (pure ret)
77+ |%
78+ ++ with-local
79+ |* act=(eval-m)
80+ ^- _act
81+ ;< ~ bind push-local
82+ ;< res=_val:$:act bind act
83+ ;< ~ bind pop-local
84+ (pure res)
85+ ++ push-local
86+ ^- (eval-m ~)
87+ |= st=state
88+ =. local-envs.st [*(map name value) local-envs.st]
89+ [st ~]
90+ ++ pop-local
91+ ^- (eval-m ~)
92+ |= st=state
93+ =. local-envs.st
94+ ?~ t.local-envs.st !!
95+ t.local-envs.st
96+ [st ~]
97+ --
98+++ multires
99+ |= vals=(lest value)
100+ ^- value
101+ ?~ t.vals i.vals
102+ multires+vals
103+++ eval-exprlist
104+ |= vals=exprlist
105+ ^- (eval-m (lest value))
106+ ;< val=value bind (eval-expr i.vals)
107+ ?~ t.vals (pure [val ~])
108+ ;< tail=(list value) bind $(vals t.vals)
109+ (pure [val tail])
110+++ eval-stat
111+ |= =stat
112+ ^- (eval-m ~)
113+ ?+ -.stat !!
114+ %asmnt
115+ ;< lhs=(lest lval) bind (process-varlist +<.stat)
116+ ;< rhs=(lest value) bind (eval-exprlist +>.stat)
117+ =/ asmnts (zip lhs (normalize-multires-exprlist rhs))
118+ |-
119+ ?~ asmnts (pure ~)
120+ ;< * bind
121+ ?- -<.i.asmnts
122+ %var ((set-var ->.i.asmnts) +.i.asmnts)
123+ %table-field
124+ ;< tabl=table bind (get-table ->-.i.asmnts)
125+ (set-table ->-.i.asmnts (~(put by tabl) ->+.i.asmnts +.i.asmnts))
126+ ==
127+ $(asmnts t.asmnts)
128+ %local-asmnt
129+ =/ lhs=(list name)
130+ %+ turn attrnamelist.stat
131+ |= [=name attr=(unit attrib)]
132+ ?> ?=(~ attr)
133+ name
134+ ;< actual-values=(list [name value]) bind
135+ ?~ rhs.stat (pure ~)
136+ ;< rhs=(list value) bind (eval-exprlist u.rhs.stat)
137+ (pure (zip lhs rhs))
138+ ;< st=state bind get-state
139+ =. i.local-envs.st
140+ %- ~(uni by i.local-envs.st)
141+ %- malt
142+ (weld (turn lhs |=(=name [name `value`nil+~])) actual-values)
143+ (set-state st)
144+ ==
145+++ set-var
146+ |= var=name
147+ |= val=value
148+ ^- (eval-m ~)
149+ ;< envs=(list (map name value)) bind get-local-envs
150+ =/ new-envs=(unit (lest (map name value)))
151+ |-
152+ ^- (unit (lest (map name value)))
153+ ?~ envs ~
154+ ?. (~(has by i.envs) var)
155+ =/ rest $(envs t.envs)
156+ ?~ rest ~
157+ `[i.envs u.rest]
158+ `[(~(put by i.envs) var val) t.envs]
159+ ^- (eval-m ~)
160+ ?. ?=(~ new-envs)
161+ |= st=state
162+ =. local-envs.st u.new-envs
163+ [st ~]
164+ =/ global-env (need ((get-from-local-envs envs) '_ENV'))
165+ :: TODO: proper error
166+ ?+ -.global-env !!
167+ %table
168+ ;< tabl=table bind (get-table +<.global-env)
169+ (set-table +<.global-env (~(put by tabl) (string-val var) val))
170+ ==
171+++ normalize-multires-exprlist
172+ |= vals=(list value)
173+ ^- (list value)
174+ ?~ vals ~
175+ ?~ t.vals ~[(normalize-multires i.vals)]
176+ [i.vals $(vals t.vals)]
177+++ normalize-multires
178+ |= val=value
179+ ^- value
180+ ?+ -.val val
181+ %multires
182+ =/ res=(lest value)
183+ =/ vals=(lest value) +.val
184+ |-
185+ ?~ t.vals
186+ =/ tail=value (normalize-multires i.vals)
187+ ?: ?=(%multires -.tail) +.tail [tail ~]
188+ [i.vals $(vals t.vals)]
189+ ?~ t.res i.res
190+ multires+res
191+ ==
192+++ process-varlist
193+ =<
194+ |= =varlist
195+ ^- (eval-m (lest lval))
196+ ;< val=lval bind (process-var i.varlist)
197+ ?~ t.varlist (pure ~[val])
198+ ;< tail=(list lval) bind $(varlist t.varlist)
199+ (pure [val tail])
200+ |%
201+ ++ process-var
202+ |= =var
203+ ^- (eval-m lval)
204+ ?- -.var
205+ %name (pure var++.var)
206+ %indexed
207+ ;< prefix=value bind (eval-prefix-expr +<.var)
208+ ;< idx=value bind (eval-expr +>.var)
209+ :: TODO: proper error
210+ ?. ?=(%table -.prefix) !!
211+ (pure table-field+[val.prefix idx])
212+ %dot
213+ ;< prefix=value bind (eval-prefix-expr +<.var)
214+ :: TODO: proper error
215+ ?. ?=(%table -.prefix) !!
216+ (pure table-field+[val.prefix (string-val +>.var)])
217+ ==
218+ --
219+++ eval-expr
220+ |= =expr
221+ ^- (eval-m value)
222+ ?+ -.expr !!
223+ %false (pure expr)
224+ %true (pure expr)
225+ %nil (pure expr)
226+ %string (pure expr)
227+ %num (pure expr)
228+ %binop (eval-binop +.expr)
229+ %prefix-expr (eval-prefix-expr +.expr)
230+ %unop (eval-unop +.expr)
231+ %table
232+ ;< tabl-id=(object-id table) bind (eval-table +.expr)
233+ (pure table+[tabl-id ~])
234+ ==
235+++ eval-table
236+ |= tabl=^table
237+ =<
238+ ^- (eval-m (object-id table))
239+ ;< felds=(list [value value]) bind
240+ =/ counter 1
241+ |-
242+ ?~ tabl (pure ~)
243+ ?- -.i.tabl
244+ %keyed
245+ ;< k=value bind (eval-expr +<.i.tabl)
246+ ;< v=value bind (eval-expr +>.i.tabl)
247+ ;< tail=(list [value value]) bind $(tabl t.tabl)
248+ (pure [[k v] tail])
249+ %unkeyed
250+ ;< v=value bind (eval-expr +.i.tabl)
251+ ?: &(?=(~ t.tabl) ?=(%multires -.v))
252+ =/ vals=(list value) +.v
253+ %- pure
254+ ^- (list [value value])
255+ |-
256+ ?~ vals ~
257+ [[num+int+(new:st counter) i.vals] $(vals t.vals, counter +(counter))]
258+ ;< tail=(list [value value]) bind $(tabl t.tabl, counter +(counter))
259+ (pure [[num+int+(new:st counter) v] tail])
260+ ==
261+ (new-table (malt felds))
262+ |%
263+ --
264+++ eval-unop
265+ |= [op=unop =expr]
266+ ^- (eval-m value)
267+ ?+ op !!
268+ %minus
269+ ;< val=value bind (eval-expr expr)
270+ ;< num=numeral bind (assert-numeral val)
271+ %- pure
272+ ?- -.num
273+ %int num+int+(neg:st +.num)
274+ %float num+float+(sub:rd *@rd +.num)
275+ ==
276+ %not
277+ ;< val=value bind (eval-expr expr)
278+ %- pure
279+ ?: (falsy val) [%false ~] [%true ~]
280+ %sig
281+ ;< val=value bind (eval-expr expr)
282+ ;< n=numeral bind (assert-numeral val)
283+ ;< i=@st bind (to-int n)
284+ %- pure
285+ num+int+(mix i mask:st)
286+ ==
287+++ eval-binop
288+ |= [lhs=expr op=binop rhs=expr]
289+ ^- (eval-m value)
290+ =<
291+ ?+ op !!
292+ %add
293+ ;< lhs=value bind (eval-expr lhs)
294+ ;< rhs=value bind (eval-expr rhs)
295+ ;< unified=unified-numerals bind (unify-numeral-values lhs rhs)
296+ %- pure
297+ :- %num
298+ ?- -.unified
299+ %i :- %int (add:st a.unified b.unified)
300+ %f :- %float (add:rd a.unified b.unified)
301+ ==
302+ %sub
303+ ;< lhs=value bind (eval-expr lhs)
304+ ;< rhs=value bind (eval-expr rhs)
305+ ;< unified=unified-numerals bind (unify-numeral-values lhs rhs)
306+ %- pure
307+ :- %num
308+ ?- -.unified
309+ %i :- %int (sub:st a.unified b.unified)
310+ %f :- %float (sub:rd a.unified b.unified)
311+ ==
312+ %mul
313+ ;< lhs=value bind (eval-expr lhs)
314+ ;< rhs=value bind (eval-expr rhs)
315+ ;< unified=unified-numerals bind (unify-numeral-values lhs rhs)
316+ %- pure
317+ :- %num
318+ ?- -.unified
319+ %i :- %int (mul:st a.unified b.unified)
320+ %f :- %float (mul:rd a.unified b.unified)
321+ ==
322+ %int-div
323+ ;< lhs=value bind (eval-expr lhs)
324+ ;< rhs=value bind (eval-expr rhs)
325+ ;< unified=unified-numerals bind (unify-numeral-values lhs rhs)
326+ %- pure
327+ :- %num
328+ ?- -.unified
329+ %i :- %int (div:st +.unified)
330+ %f :- %float (int-div-float +.unified)
331+ ==
332+ %mod
333+ ;< lhs=value bind (eval-expr lhs)
334+ ;< rhs=value bind (eval-expr rhs)
335+ ;< unified=unified-numerals bind (unify-numeral-values lhs rhs)
336+ %- pure
337+ :- %num
338+ ?- -.unified
339+ %i :- %int (mod:st +.unified)
340+ %f
341+ :- %float
342+ (sub:rd a.unified (mul:rd (int-div-float +.unified) b.unified))
343+ ==
344+ %div
345+ ;< lhs=value bind (eval-expr lhs)
346+ ;< rhs=value bind (eval-expr rhs)
347+ ;< lhs=numeral bind (assert-numeral lhs)
348+ ;< rhs=numeral bind (assert-numeral rhs)
349+ %- pure num+float+(div:rd (to-float lhs) (to-float rhs))
350+ %exp !!
351+ %band
352+ ;< lhs=value bind (eval-expr lhs)
353+ ;< rhs=value bind (eval-expr rhs)
354+ ;< lhs=numeral bind (assert-numeral lhs)
355+ ;< rhs=numeral bind (assert-numeral rhs)
356+ ;< lhs=@st bind (to-int lhs)
357+ ;< rhs=@st bind (to-int rhs)
358+ %- pure
359+ num+int+(dis lhs rhs)
360+ %bor
361+ ;< lhs=value bind (eval-expr lhs)
362+ ;< rhs=value bind (eval-expr rhs)
363+ ;< lhs=numeral bind (assert-numeral lhs)
364+ ;< rhs=numeral bind (assert-numeral rhs)
365+ ;< lhs=@st bind (to-int lhs)
366+ ;< rhs=@st bind (to-int rhs)
367+ %- pure
368+ num+int+(con lhs rhs)
369+ %bxor
370+ ;< lhs=value bind (eval-expr lhs)
371+ ;< rhs=value bind (eval-expr rhs)
372+ ;< lhs=numeral bind (assert-numeral lhs)
373+ ;< rhs=numeral bind (assert-numeral rhs)
374+ ;< lhs=@st bind (to-int lhs)
375+ ;< rhs=@st bind (to-int rhs)
376+ %- pure
377+ num+int+(mix lhs rhs)
378+ %rshft
379+ ;< lhs=value bind (eval-expr lhs)
380+ ;< rhs=value bind (eval-expr rhs)
381+ ;< lhs=numeral bind (assert-numeral lhs)
382+ ;< rhs=numeral bind (assert-numeral rhs)
383+ ;< lhs=@st bind (to-int lhs)
384+ ;< rhs=@st bind (to-int rhs)
385+ %- pure
386+ num+int+(dis mask:st (?:((sig:st rhs) lsh rsh) [0 (abs:st rhs)] lhs))
387+ %lshft
388+ ;< lhs=value bind (eval-expr lhs)
389+ ;< rhs=value bind (eval-expr rhs)
390+ ;< lhs=numeral bind (assert-numeral lhs)
391+ ;< rhs=numeral bind (assert-numeral rhs)
392+ ;< lhs=@st bind (to-int lhs)
393+ ;< rhs=@st bind (to-int rhs)
394+ %- pure
395+ num+int+(dis mask:st (?:((sig:st rhs) rsh lsh) [0 (abs:st rhs)] lhs))
396+ %or
397+ ;< lhs=value bind (eval-expr lhs)
398+ ?. (falsy lhs) (pure lhs)
399+ (eval-expr rhs)
400+ %and
401+ ;< lhs=value bind (eval-expr lhs)
402+ ?: (falsy lhs) (pure lhs)
403+ (eval-expr rhs)
404+ ==
405+ |%
406+ ++ show-numeral
407+ |= n=numeral
408+ ^- tape
409+ ?- -.n
410+ %int (scow %s (to-s:st +.n))
411+ %float (scow %rd +.n)
412+ ==
413+ ++ int-div-float
414+ |= [a=@rd b=@rd]
415+ =/ whole=(unit @s) (~(toi rd %d) (div:rd a b))
416+ ?~ whole (div:rd .~0 .~0)
417+ (san:rd u.whole)
418+ +$ unified-numerals $%([%i a=@st b=@st] [%f a=@rd b=@rd])
419+ ++ unify-numeral-values
420+ |= [a=value b=value]
421+ ^- (eval-m unified-numerals)
422+ ;< a=numeral bind (assert-numeral a)
423+ ;< b=numeral bind (assert-numeral b)
424+ (pure (unify-numerals a b))
425+ ++ unify-numerals
426+ |= [a=numeral b=numeral]
427+ ^- unified-numerals
428+ ?: &(?=(%int -.a) ?=(%int -.b)) [%i +.a +.b]
429+ [%f (to-float a) (to-float b)]
430+ ++ to-float
431+ |= n=numeral
432+ ^- @rd
433+ ?: ?=(%float -.n) +.n
434+ (san:rd (to-s:st +.n))
435+ --
436+++ to-int
437+ |= n=numeral
438+ ^- (eval-m @st)
439+ ?: ?=(%int -.n) (pure +.n)
440+ =/ i=(unit @s) (toi:rd +.n)
441+ :: TODO: proper error
442+ ?~ i !!
443+ =/ i u.i
444+ =/ cycled (san:rd i)
445+ :: TODO: proper error
446+ :: checks that we don't lose any information
447+ ?. =(+.n cycled) !!
448+ (pure (from-s:st i))
449+++ falsy
450+ |= v=value
451+ ^- ?
452+ ?+ -.v |
453+ %false &
454+ %nil &
455+ ==
456+++ assert-numeral
457+ |= [a=value]
458+ ^- (eval-m numeral)
459+ :: TODO: throw a proper error
460+ ?. ?=(%num -.a) !!
461+ (pure +.a)
462+++ eval-prefix-expr
463+ |= =prefix-expr
464+ ^- (eval-m value)
465+ ?- -.prefix-expr
466+ %expr (eval-expr +.prefix-expr)
467+ %call (eval-functioncall +.prefix-expr)
468+ %var
469+ ?- +<.prefix-expr
470+ %name (lookup-var +>.prefix-expr)
471+ %dot
472+ ;< tabl=value bind (eval-prefix-expr +>-.prefix-expr)
473+ (lookup-table-field tabl (string-val +>+.prefix-expr))
474+ %indexed
475+ ;< tabl=value bind (eval-prefix-expr +>-.prefix-expr)
476+ ;< idx=value bind (eval-expr +>+.prefix-expr)
477+ (lookup-table-field tabl idx)
478+ ==
479+ ==
480+++ lookup-table-field
481+ |= [val=value fild=value]
482+ ^- (eval-m value)
483+ :: TODO: proper error
484+ ?+ -.val !!
485+ %table
486+ ;< tabl=table bind (get-table val.val)
487+ =/ res (~(get by tabl) fild)
488+ :: TODO: error
489+ ?~ res !!
490+ (pure u.res)
491+ ==
492+++ lookup-var
493+ |= =name
494+ ^- (eval-m value)
495+ ;< envs=(list (map ^name value)) bind get-local-envs
496+ =/ get-local (get-from-local-envs envs)
497+ =/ local=(unit value) (get-local name)
498+ ?. ?=(~ local) (pure u.local)
499+ =/ global-env (get-local '_ENV')
500+ ?~ global-env !!
501+ (lookup-table-field u.global-env (string-val name))
502+++ get-from-local-envs
503+ |= envs=(list (map name value))
504+ |= =name
505+ ^- (unit value)
506+ ?~ envs ~
507+ =/ val=(unit value) (~(get by i.envs) name)
508+ ?~ val $(envs t.envs)
509+ val
510+++ string-val
511+ |= val=@t
512+ ^- value
513+ string+(trip val)
514+++ get
515+ |* f=$-(state *)
516+ ^- (eval-m _$:f)
517+ |= st=state
518+ [st (f st)]
519+++ get-table
520+ |= id=(object-id table)
521+ ^- (eval-m table)
522+ ;< tables=(objects table) bind
523+ %- get |=(st=state tables.st)
524+ =/ table (~(get by objs.tables) id)
525+ :: TODO: proper error
526+ ?~ table !!
527+ (pure u.table)
528+++ set-table
529+ |= [id=(object-id table) tabl=table]
530+ ^- (eval-m ~)
531+ |= st=state
532+ =. objs.tables.st (~(put by objs.tables.st) id tabl)
533+ [st ~]
534+++ get-local-envs
535+ ^- (eval-m (list (map name value)))
536+ %- get |=(st=state local-envs.st)
537+++ eval-functioncall
538+ |= =functioncall
539+ ^- (eval-m value)
540+ !!
541+++ new-table
542+ |= tabl=table
543+ ^- (eval-m (object-id table))
544+ |= st=state
545+ =/ id next-id.tables.st
546+ =. next-id.tables.st +(id)
547+ =. objs.tables.st (~(put by objs.tables.st) id tabl)
548+ [st id]
549+++ zip
550+ |* [lhs=(list) rhs=(list)]
551+ ^- (list [_?<(?=(~ lhs) i.lhs) _?<(?=(~ rhs) i.rhs)])
552+ ?: |(?=(~ lhs) ?=(~ rhs)) ~
553+ [[i.lhs i.rhs] $(lhs t.lhs, rhs t.rhs)]
554+--
zod/luau/lib/lua/parser.hoon → desk/lib/lua/parser.hoonrenamed+256−80
@@ -1,10 +1,12 @@
11/- *lua
2−/+ *interlist
2+/- *interlist
3+/+ st
4+/+ inter=interlist
35=<
46apex
57|%
68++ apex
7− %^ tnee %apex ast
9+ %^ tnee %apex chunk
810 ;~ pfix
911 %- punt
1012 ;~ plug
@@ -31,7 +33,7 @@ apex
3133 parse-numeral
3234 ::
3335 %+ cook
34− |=(=prefix-expr [%prefix-expr prefix-expr])
36+ |=(=prefix-expr (unwrap-prefix [%prefix-expr prefix-expr]))
3537 (knee *prefix-expr |.(parse-prefix-expr))
3638 ::
3739 %+ cook
@@ -52,42 +54,187 @@ apex
5254 parse-funcbody
5355 ==
5456 ::
55− %+ cook |= [=unop =expr] [%unop unop expr]
56− ;~ plug
57− ;~ pose
58− ;~ sfix
59− ;~ pose
60− (cold %minus (just '-'))
61− (cold %sig (just '~'))
62− (cold %hax (just '#'))
63− ==
64− ws
65− ==
66− ;~ sfix
67− (cold %not (jest 'not'))
68− ;~(less parse-name ws)
69− ==
70− ==
71− %+ knee *expr |.(parse-expr)
72− ==
7357 ==
7458:: Parse expressions separated by binary operators
7559::
7660++ parse-expr-list
77− %^ tnee %parse-expr-list (interlist binop expr)
78− %+ parse-interlist (ifix [ws ws] parse-binop) parse-atomic-expr
79−:: TODO: This is mock and should take operator priority into account.
80−::
61+ %^ tnee %parse-expr-list ,(interlist binop [(list unop) expr])
62+ %+ parse:inter (ifix [ws ws] parse-binop)
63+ ;~ plug
64+ %- star
65+ ;~ pose
66+ ;~ sfix
67+ ;~ pose
68+ (cold %minus (just '-'))
69+ (cold %sig (just '~'))
70+ (cold %hax (just '#'))
71+ ==
72+ ws
73+ ==
74+ ;~ sfix
75+ (cold %not (jest 'not'))
76+ ;~(less parse-name ws)
77+ ==
78+ ==
79+ ::
80+ parse-atomic-expr
81+ ==
8182++ process-expr-list
82− |= l=(interlist binop expr)
83+ =<
84+ |= l=(interlist binop [(list unop) expr])
8385 ^- expr
84− ?- -.l
85− %single val.l
86− %double [%binop val.l sep.l (process-expr-list tail.l)]
87− ==
86+ %- strip-tree
87+ %- (process-right-assoc ~[%pow])
88+ %- process-unops
89+ %- (process-left-assoc ~[%mul %div %int-div %mod])
90+ %- (process-left-assoc ~[%add %sub])
91+ %- (process-right-assoc ~[%concat])
92+ %- (process-left-assoc ~[%rshft %lshft])
93+ %- (process-left-assoc ~[%band])
94+ %- (process-left-assoc ~[%bxor])
95+ %- (process-left-assoc ~[%bor])
96+ %- (process-left-assoc ~[%lt %gt %lteq %gteq %neq %eq])
97+ %- (process-left-assoc ~[%and])
98+ %- (process-left-assoc ~[%or])
99+ (preprocess-tree l)
100+ |%
101+ +$ working-tree
102+ $%
103+ [%node l=working-tree n=binop r=working-tree]
104+ [%branch b=unop t=working-tree]
105+ [%tbd-unop l=(list [=expr =binop]) =unop r=working-tree]
106+ [%unoped l=(list [=expr =binop]) r=working-tree]
107+ [%leaf (interlist binop expr)]
108+ ==
109+ ++ preprocess-tree
110+ |= l=(interlist binop [(list unop) expr])
111+ ^- working-tree
112+ =/ splitted (find-unop l)
113+ ?~ splitted leaf+(turn:inter l |=([* =expr] expr))
114+ tbd-unop+[l.u.splitted unop.u.splitted $(l r.u.splitted)]
115+ ++ apply-unops
116+ |= [unops=(list unop) =expr]
117+ ^+ expr
118+ ?~ unops expr
119+ [%unop i.unops $(unops t.unops)]
120+ ++ strip-tree
121+ |= tree=working-tree
122+ ^- expr
123+ ?- -.tree
124+ %leaf ?> ?=(%single +<.tree) +>.tree
125+ %node [%binop $(tree l.tree) n.tree $(tree r.tree)]
126+ %branch [%unop b.tree $(tree t.tree)]
127+ %tbd-unop !!
128+ %unoped ?> =(~ l.tree) $(tree r.tree)
129+ ==
130+ ++ find-unop
131+ |= l=(interlist binop [(list unop) expr])
132+ ^- (unit [l=(list [=expr =binop]) =unop r=(interlist binop [(list unop) expr])])
133+ ?- -.l
134+ %single
135+ ?~ +<.l ~
136+ %- some
137+ [~ i.-.val.l single+[t.-.val.l +.val.l]]
138+ %double
139+ ?~ -.val.l
140+ %+ ^^bind $(l tail.l)
141+ |= [k=(list [expr binop]) =unop tail=(interlist binop [(list unop) expr])]
142+ [[[+.val.l sep.l] k] unop tail]
143+ %- some
144+ [~ i.-.val.l double+[[t.-.val.l +.val.l] sep.l tail.l]]
145+ ==
146+ ++ process-unops
147+ |= tree=working-tree
148+ ^- working-tree
149+ ?- -.tree
150+ %node node+[$(tree l.tree) n.tree $(tree r.tree)]
151+ %branch branch+[b.tree $(tree t.tree)]
152+ %tbd-unop unoped+[l.tree branch+[unop.tree $(tree r.tree)]]
153+ %leaf tree
154+ %unoped unoped+[l.tree $(tree r.tree)]
155+ ==
156+ ++ split-left-unop-list
157+ |= [is-pivot=$-(binop ?) l=(list [=expr =binop])]
158+ ^- (unit [l=(interlist binop expr) =binop r=(list [=expr =binop])])
159+ ?~ l ~
160+ ?: (is-pivot binop.i.l) `[single+expr.i.l binop.i.l t.l]
161+ =/ rest $(l t.l)
162+ ?~ rest ~
163+ `[double+[expr.i.l binop.i.l -.u.rest] +.u.rest]
164+ ++ split-right-unop-list
165+ |= [is-pivot=$-(binop ?) l=(list [=expr =binop])]
166+ ^- (unit [l=(interlist binop expr) =binop r=(list [=expr =binop])])
167+ =/ reversed=(unit [l=(list [=binop =expr]) =binop r=(interlist binop expr)])
168+ =/ l=(list [=binop =expr]) (flop (turn l swap))
169+ |-
170+ ?~ l ~
171+ ?: (is-pivot binop.i.l) `[~ binop.i.l (new:inter expr.i.l t.l)]
172+ =/ rest=(unit [l=(list [=binop =expr]) =binop r=(interlist binop expr)]) $(l t.l)
173+ ?~ rest ~
174+ `[[i.l l.u.rest] +.u.rest]
175+ ?~ reversed ~
176+ `[(reverse:inter r.u.reversed) binop.u.reversed (turn (flop l.u.reversed) swap)]
177+ ++ swap |*([a=* b=*] [b a])
178+ ++ process-right-assoc
179+ |= ops=(lest binop)
180+ |= tree=working-tree
181+ ^- working-tree
182+ ?- -.tree
183+ %leaf
184+ =/ l +.tree
185+ |-
186+ =/ splitted (split-left-on:inter |=(op=binop (elem op ops)) l)
187+ ?~ splitted [%leaf l]
188+ [%node $(l lhs.u.splitted) pivot.u.splitted $(l rhs.u.splitted)]
189+ %branch branch+[b.tree $(tree t.tree)]
190+ %tbd-unop
191+ =/ splitted
192+ (split-left-unop-list |=(op=binop (elem op ops)) l.tree)
193+ ?~ splitted tbd-unop+[l.tree unop.tree $(tree r.tree)]
194+ $(tree [%node $(tree leaf+l.u.splitted) binop.u.splitted tbd-unop+[r.u.splitted +>.tree]])
195+ %node
196+ [%node $(tree l.tree) n.tree $(tree r.tree)]
197+ %unoped
198+ =/ splitted
199+ (split-left-unop-list |=(op=binop (elem op ops)) l.tree)
200+ ?~ splitted unoped+[l.tree $(tree r.tree)]
201+ [%node $(tree leaf+l.u.splitted) binop.u.splitted $(tree unoped+[r.u.splitted r.tree])]
202+ ==
203+ ++ process-left-assoc
204+ |= ops=(lest binop)
205+ |= tree=working-tree
206+ ^- working-tree
207+ ?- -.tree
208+ %leaf
209+ =/ l +.tree
210+ |-
211+ ^- working-tree
212+ =/ splitted (split-right-on:inter |=(op=binop (elem op ops)) l)
213+ ?~ splitted [%leaf l]
214+ [%node $(l lhs.u.splitted) pivot.u.splitted $(l rhs.u.splitted)]
215+ %tbd-unop
216+ =/ splitted
217+ (split-right-unop-list |=(op=binop (elem op ops)) l.tree)
218+ ?~ splitted tbd-unop+[l.tree unop.tree $(tree r.tree)]
219+ $(tree [%node $(tree leaf+l.u.splitted) binop.u.splitted tbd-unop+[r.u.splitted +>.tree]])
220+ %node
221+ [%node $(tree l.tree) n.tree $(tree r.tree)]
222+ %branch
223+ [%branch b.tree $(tree t.tree)]
224+ %unoped
225+ =/ splitted
226+ (split-right-unop-list |=(op=binop (elem op ops)) l.tree)
227+ ?~ splitted unoped+[l.tree $(tree r.tree)]
228+ [%node $(tree leaf+l.u.splitted) binop.u.splitted $(tree unoped+[r.u.splitted +>.tree])]
229+ ==
230+ --
88231++ parse-expr
89232 %^ tnee %parse-expr expr
90− %+ cook process-expr-list parse-expr-list
233+ %+ cook unwrap-prefix
234+ ;~ pose
235+ %+ cook process-expr-list parse-expr-list
236+ (ifix [;~(plug (just '(') ws) ;~(plug ws (just ')'))] (knee *expr |.(parse-expr)))
237+ ==
91238++ parse-parened-expr
92239 %^ tnee %parse-parened-expr prefix-expr
93240 %+ cook
@@ -101,47 +248,49 @@ apex
101248 |= quot=char
102249 =/ quot (just quot)
103250 %+ cook
104− |=([* =tape *] (crip tape))
251+ |=([* =tape *] tape)
105252 ;~ plug
106253 quot
254+ %+ cook zing
107255 %- star
108256 ;~ less quot
109257 ;~ pose
110− %+ cold '\07' (jest '\\a')
111− %+ cold '\08' (jest '\\b')
112− %+ cold '\0c' (jest '\\f')
113− %+ cold '\0a' (jest '\\n')
114− %+ cold '\0d' (jest '\\r')
115− %+ cold '\09' (jest '\\t')
116− %+ cold '\0b' (jest '\\v')
117− %+ cold '\\' (jest '\\\\')
118− %+ cold '"' (jest '\\"')
119− %+ cold '\'' (jest '\\\'')
120− %+ cold '\0a' (jest '\\\0a')
121− %+ cold '' ;~(plug (jest '\\z') gaw)
258+ %+ cold ~['\07'] (jest '\\a')
259+ %+ cold ~['\08'] (jest '\\b')
260+ %+ cold ~['\0c'] (jest '\\f')
261+ %+ cold ~['\0a'] (jest '\\n')
262+ %+ cold ~['\0d'] (jest '\\r')
263+ %+ cold ~['\09'] (jest '\\t')
264+ %+ cold ~['\0b'] (jest '\\v')
265+ %+ cold ~['\\'] (jest '\\\\')
266+ %+ cold ~['"'] (jest '\\"')
267+ %+ cold ~['\''] (jest '\\\'')
268+ %+ cold ~['\0a'] (jest '\\\0a')
269+ %+ cold ~ ;~(plug (jest '\\z') gaw)
122270 ::
123271 ;~ pfix
124272 (jest '\\x')
125273 ;< hex-digits=tape bind ;~(plug next next (easy ~))
126274 =/ digit=(unit @) (rust hex-digits hex)
127− ?~ digit fail (easy `@t`u.digit)
275+ ?~ digit fail (easy ~[`@`u.digit])
128276 ==
129277 ::
130278 ;~ pfix
131279 (jest '\\')
132280 ;< digits=tape bind (stun [1 3] (shim '0' '9'))
133281 =/ digit=(unit @) (rust digits dem)
134− ?~ digit fail (easy `@t`u.digit)
282+ ?~ digit fail (easy ~[`@`u.digit])
135283 ==
136284 ::
137285 %+ cook
138− |= [* point=@ *] `@t`point
286+ |= [* point=@ *] ~[point]
139287 ;~ plug
140288 (jest '\\u{')
141289 hex
142290 (just '}')
143291 ==
144292 ::
293+ %+ cook |=(char=@ ~[char])
145294 next
146295 ==
147296 ==
@@ -152,7 +301,6 @@ apex
152301 (parse-string '"')
153302 (parse-string '\'')
154303 ::
155− %+ cook |=(=tape (crip tape))
156304 %- long-brackets
157305 |* closing=rule
158306 ;~ pfix
@@ -203,7 +351,7 @@ apex
203351 ==
204352 ::
205353 %+ cook
206− |=([=name * =expr] [%keyed [%string name] expr])
354+ |=([=name * =expr] [%keyed [%string (trip name)] expr])
207355 ;~ (glue ws)
208356 parse-name
209357 tis
@@ -247,7 +395,7 @@ apex
247395 parse-hex-float
248396 ::
249397 %+ cook
250− |= x=@u [%int x]
398+ |= x=@u [%int (new:st x)]
251399 ;~ pfix
252400 (just '0')
253401 (mask "xX")
@@ -259,7 +407,10 @@ apex
259407 parse-float
260408 ::
261409 %+ cook
262− |= x=@u [%int x]
410+ |= x=@u
411+ ?: (gth x max-int)
412+ [%float (sun:rd x)]
413+ [%int (new:st x)]
263414 (bass 10 (plus dit))
264415 ==
265416++ parse-exprlist
@@ -417,7 +568,7 @@ apex
417568++ parse-local-asmnt
418569 %^ tnee %parse-local-asmnt local-asmnt
419570 %+ cook
420− |= [* * =attnamelist rhs=(unit explist)] [attnamelist rhs]
571+ |= [* * =attrnamelist rhs=(unit explist)] [attrnamelist rhs]
421572 ;~ plug
422573 (jest 'local')
423574 wss
@@ -431,7 +582,7 @@ apex
431582 ==
432583 ==
433584++ parse-attnamelist
434− %^ tnee %parse-attnamelist attnamelist
585+ %^ tnee %parse-attnamelist attrnamelist
435586 %+ most (ifix [ws ws] com)
436587 ;~ plug
437588 parse-name
@@ -713,10 +864,10 @@ apex
713864 ++ name-fst-char ;~(pose alf:ab (just '_'))
714865 --
715866 %+ cook |= =tape (crip tape)
716− ;~(less ;~(plug keyword ;~(less name-char (easy ~))) ;~(plug name-fst-char (star name-char)))
867+ ;~(less keyword ;~(plug name-fst-char (star name-char)))
717868++ bind
718869 |* =mold
719− |* [prev=rule cont=$-(mold rule)]
870+ |* [prev=rule cont=$-(* rule)]
720871 |= =nail
721872 =/ prev-edge (prev nail)
722873 ?~ q.prev-edge prev-edge
@@ -847,31 +998,39 @@ apex
847998 ;< res=_p:(need q:$:$:inner) bind (inner closing)
848999 %+ cold res closing
8491000++ keyword
850− %+ cold ~
851− ;~ pose
852− (jest 'and')
853− (jest 'break')
854− (jest 'do')
855− (jest 'else')
856− (jest 'elseif')
857− (jest 'end')
858− (jest 'false')
859− (jest 'for')
860− (jest 'function')
861− (jest 'goto')
862− (jest 'if')
863− (jest 'in')
864− (jest 'local')
865− (jest 'nil')
866− (jest 'not')
867− (jest 'or')
868− (jest 'repeat')
869− (jest 'return')
870− (jest 'then')
871− (jest 'true')
872− (jest 'until')
873− (jest 'while')
874− ==
1001+ =<
1002+ %+ sear
1003+ |= word=tape
1004+ ^- (unit ~)
1005+ ?: (elem word keyword-names) `~ ~
1006+ (plus alf:ab)
1007+ |%
1008+ ++ keyword-names
1009+ :~
1010+ "and"
1011+ "break"
1012+ "do"
1013+ "else"
1014+ "elseif"
1015+ "end"
1016+ "false"
1017+ "for"
1018+ "function"
1019+ "goto"
1020+ "if"
1021+ "in"
1022+ "local"
1023+ "nil"
1024+ "not"
1025+ "or"
1026+ "repeat"
1027+ "return"
1028+ "then"
1029+ "true"
1030+ "until"
1031+ "while"
1032+ ==
1033+ --
8751034++ tnee
8761035 |* [=term gar=mold sef=rule]
8771036 |= tub=nail
@@ -883,8 +1042,25 @@ apex
8831042 ?~ q.res
8841043 ~& [term %nope] res
8851044 ~& > [term %ok] res
1045+++ neg
1046+ |* =rule
1047+ |= =nail
1048+ ^- (like ~)
1049+ =/ x (rule nail)
1050+ :- p.nail
1051+ ?~ q.x `[~ nail] ~
8861052++ blok-is-empty
8871053 |= =blok
8881054 ^- ?
8891055 &(?=(~ body.blok) ?=(~ ret.blok))
1056+++ max-int 9.223.372.036.854.775.807
1057+++ elem
1058+ |= [nedl=* stak=(list *)]
1059+ ^- ?
1060+ ?=(^ (find ~[nedl] stak))
1061+++ unwrap-prefix
1062+ |= x=expr
1063+ ^- expr
1064+ ?: ?=([%prefix-expr %expr *] x) $(x +>.x)
1065+ x
8901066--
zod/luau/lib/lua/printer.hoon → desk/lib/lua/printer.hoonrenamed+25−14
@@ -1,14 +1,15 @@
11/- *lua
2+/+ st
23=<
34print
45|%
56:: AST
67::
78++ print
8− |= [=ast]
9+ |= [=chunk]
910 ^- tape
10− ?- -.ast
11− %blok (print-blok +.ast)
11+ ?- -.chunk
12+ %blok (print-blok +.chunk)
1213 ==
1314:: Expr
1415::
@@ -23,11 +24,13 @@ print
2324 %binop
2425 %- zing
2526 :~
27+ "("
2628 (print-expr +<.expr)
2729 " "
2830 (print-binop +>-.expr)
2931 " "
3032 (print-expr +>+.expr)
33+ ")"
3134 ==
3235 %num (print-numeral +.expr)
3336 %table (print-table +.expr)
@@ -37,9 +40,11 @@ print
3740 %unop
3841 %- zing
3942 :~
43+ "("
4044 (print-unop +<.expr)
4145 " "
4246 (print-expr +>.expr)
47+ ")"
4348 ==
4449 ==
4550:: unop
@@ -55,7 +60,6 @@ print
5560 ==
5661:: string
5762::
58−:: NOTE: does not handle escaping chars
5963++ print-string
6064 |= =string
6165 %- zing
@@ -64,10 +68,15 @@ print
6468 ::
6569 ^- tape
6670 %- zing
67− %+ turn (trip string)
71+ %+ turn string
6872 |= char=@t
6973 ^- tape
70− :- '\\' (show-u `@`char)
74+ %- zing
75+ :~
76+ "\\u\{"
77+ ((x-co:co 1) char)
78+ "}"
79+ ==
7180 "\""
7281 ==
7382:: table
@@ -138,7 +147,7 @@ print
138147 |= [num=numeral]
139148 ^- tape
140149 ?- -.num
141− %int (show-u +.num)
150+ %int (z-co:co +.num)
142151 %float (show-float +.num)
143152 ==
144153:: exprlist
@@ -182,7 +191,9 @@ print
182191 |= [=prefix-expr]
183192 ?- -.prefix-expr
184193 %var (print-var +.prefix-expr)
185− %expr
194+ %expr
195+ :: since binops already have parens
196+ ?: ?=(%binop +<.prefix-expr) (print-expr +.prefix-expr)
186197 %- zing
187198 :~
188199 "("
@@ -253,7 +264,7 @@ print
253264 %- zing
254265 :~
255266 "local "
256− (print-attnamelist attnamelist.local-asmnt)
267+ (print-attrnamelist attrnamelist.local-asmnt)
257268 ?~ rhs.local-asmnt ""
258269 %- zing
259270 :~
@@ -261,13 +272,13 @@ print
261272 (print-explist u.rhs.local-asmnt)
262273 ==
263274 ==
264−:: attnamelist
275+:: attrnamelist
265276::
266−++ print-attnamelist
267− |= =attnamelist
277+++ print-attrnamelist
278+ |= =attrnamelist
268279 ^- tape
269280 %- commaed
270− %+ turn attnamelist
281+ %+ turn attrnamelist
271282 |= [=name attr=(unit attrib)]
272283 %- zing
273284 :~
@@ -498,7 +509,7 @@ print
498509 %- zing
499510 %+ join "." l
500511++ show-s
501− |=(s=@s `tape`[?:((syn:si s) %$ '-') (slag 2 (scow %ui (abs:si s)))])
512+ |=(s=@s `tape`(zing [?:((syn:si s) "" "-") ~[(slag 2 (scow %ui (abs:si s)))]]))
502513++ show-u
503514 |=(u=@u `tape`(slag 2 (scow %ui u)))
504515++ show-float
zod/luau/lib/lua.hoon → desk/lib/lua/utils.hoonrenamed

The content is the same.

desk/lib/st.hoonnew file+64
@@ -0,0 +1,64 @@
1+:: Two's complement encoded 64-bit signed integer
2+=<
3+|%
4+:: coerce an unsigned int to a signed int
5+::
6+++ new
7+ |= x=@u
8+ ^- @st
9+ (dis mask x)
10+++ to-s
11+ |= x=@st
12+ ^- @s
13+ (new:si ?!((sig x)) (abs x))
14+++ from-s
15+ |= x=@s
16+ ^- @st
17+ %- ?. (syn:si x) neg |=(x=@st x)
18+ (dis abs-mask (abs:si x))
19+++ neg
20+ |= x=@st
21+ ^- @st
22+ (dis mask +((mix mask x)))
23+++ sig
24+ |= x=@st
25+ ^- ?
26+ ?! =(0 (dis sign-mask x))
27+++ abs
28+ |= x=@st
29+ ^- @u
30+ ?. (sig x) `@u`x `@u`(neg x)
31+++ inc
32+ |= x=@st
33+ ^- @st
34+ (dis mask +(x))
35+++ add
36+ |= [x=@st y=@st]
37+ ^- @st
38+ (dis mask (^add x y))
39+++ sub
40+ |= [x=@st y=@st]
41+ ^- @st
42+ (from-s (dif:si (to-s x) (to-s y)))
43+++ mul
44+ |= [x=@st y=@st]
45+ ^- @st
46+ (from-s (pro:si (to-s x) (to-s y)))
47+++ div
48+ |= [x=@st y=@st]
49+ ^- @st
50+ =/ [x=@s y=@s] [(to-s x) (to-s y)]
51+ =/ fra (fra:si x y)
52+ =/ res (from-s fra)
53+ ?: |(=(0 (rem:si x y)) (syn:si fra)) res
54+ (dec res)
55+++ mod
56+ |= [x=@st y=@st]
57+ ^- @st
58+ (sub x (mul (div x y) y))
59+++ mask 0xffff.ffff.ffff.ffff
60+--
61+|%
62+++ abs-mask 0x7fff.ffff.ffff.ffff
63+++ sign-mask 0x8000.0000.0000.0000
64+--
zod/luau/lib/strand.hoon → desk/lib/strand.hoonrenamed

The content is the same.

zod/luau/lib/strandio.hoon → desk/lib/strandio.hoonrenamed+21−1
@@ -197,6 +197,20 @@
197197 `[%done +>.sign-arvo.u.in.tin]
198198 ==
199199::
200+++ take-near
201+ |= =wire
202+ =/ m (strand ,[spar:ames (unit (unit page))])
203+ ^- form:m
204+ |= tin=strand-input:strand
205+ ?+ in.tin `[%skip ~]
206+ ~ `[%wait ~]
207+ ::
208+ [~ %sign * %ames %near ^ *]
209+ ?. =(wire wire.u.in.tin)
210+ `[%skip ~]
211+ `[%done +>.sign-arvo.u.in.tin]
212+ ==
213+::
200214++ take-poke-ack
201215 |= =wire
202216 =/ m (strand ,~)
@@ -335,7 +349,13 @@
335349 |= [=wire =spar:ames]
336350 =/ m (strand ,~)
337351 ^- form:m
338− (send-raw-card %pass wire %arvo %a %keen spar)
352+ (send-raw-card %pass wire %arvo %a %keen ~ spar)
353+::
354+++ keen-shut
355+ |= [=wire =spar:ames]
356+ =/ m (strand ,~)
357+ ^- form:m
358+ (send-raw-card %pass wire %keen & spar)
339359::
340360++ sleep
341361 |= for=@dr
zod/luau/mar/atom.hoon → desk/mar/atom.hoonrenamed

The content is the same.

zod/luau/mar/bill.hoon → desk/mar/bill.hoonrenamed

The content is the same.

zod/luau/mar/docket-0.hoon → desk/mar/docket-0.hoonrenamed

The content is the same.

zod/luau/mar/hoon.hoon → desk/mar/hoon.hoonrenamed

The content is the same.

zod/luau/mar/kelvin.hoon → desk/mar/kelvin.hoonrenamed

The content is the same.

zod/luau/mar/lua.hoon → desk/mar/lua.hoonrenamed

The content is the same.

zod/luau/mar/mime.hoon → desk/mar/mime.hoonrenamed

The content is the same.

zod/luau/mar/noun.hoon → desk/mar/noun.hoonrenamed

The content is the same.

zod/luau/mar/ship.hoon → desk/mar/ship.hoonrenamed

The content is the same.

zod/luau/mar/txt.hoon → desk/mar/txt.hoonrenamed

The content is the same.

zod/luau/res/lua/all.lua → desk/res/lua/all.luarenamed

The content is the same.

zod/luau/res/lua/api.lua → desk/res/lua/api.luarenamed

The content is the same.

zod/luau/res/lua/attrib.lua → desk/res/lua/attrib.luarenamed

The content is the same.

desk/res/lua/bar.luanew file+23
@@ -0,0 +1,23 @@
1+assert(010 .. 020 .. -030 == "1020-30")
2+x = - 2 ^ - 3^4
3+
4+x = 1
5+
6+print(_ENV)
7+print(_ENV._ENV)
8+
9+local foo = _ENV
10+
11+-- local x = 8
12+
13+do
14+ _ENV = {x = 2, print = print}
15+ -- local x = 3
16+ print(x)
17+ print(_ENV)
18+end
19+
20+print(_ENV)
21+print(_ENV._ENV)
22+
23+print(foo._ENV)
desk/res/lua/baz.luanew file+6
@@ -0,0 +1,6 @@
1+x = 8
2+
3+local y = x + 3
4+
5+
6+return y / 2
zod/luau/res/lua/big.lua → desk/res/lua/big.luarenamed

The content is the same.

zod/luau/res/lua/bitwise.lua → desk/res/lua/bitwise.luarenamed

The content is the same.

zod/luau/res/lua/bwcoercion.lua → desk/res/lua/bwcoercion.luarenamed

The content is the same.

zod/luau/res/lua/calls.lua → desk/res/lua/calls.luarenamed

The content is the same.

zod/luau/res/lua/closure.lua → desk/res/lua/closure.luarenamed

The content is the same.

zod/luau/res/lua/code.lua → desk/res/lua/code.luarenamed

The content is the same.

zod/luau/res/lua/constructs.lua → desk/res/lua/constructs.luarenamed

The content is the same.

zod/luau/res/lua/coroutine.lua → desk/res/lua/coroutine.luarenamed

The content is the same.

zod/luau/res/lua/cstack.lua → desk/res/lua/cstack.luarenamed

The content is the same.

desk/res/lua/cycled/all.luanew file+203
@@ -0,0 +1,203 @@
1+local version = "\u{4c}\u{75}\u{61}\u{20}\u{35}\u{2e}\u{34}"
2+if (_VERSION ~= version) then
3+io.stderr:write("\u{54}\u{68}\u{69}\u{73}\u{20}\u{74}\u{65}\u{73}\u{74}\u{20}\u{73}\u{75}\u{69}\u{74}\u{65}\u{20}\u{69}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}",version,"\u{2c}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{6f}\u{72}\u{20}",_VERSION,"\u{a}\u{45}\u{78}\u{69}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}")
4+return
5+end
6+_G.ARG=arg
7+_soft=(rawget(_G,"\u{5f}\u{73}\u{6f}\u{66}\u{74}") or false)
8+_port=(rawget(_G,"\u{5f}\u{70}\u{6f}\u{72}\u{74}") or false)
9+_nomsg=(rawget(_G,"\u{5f}\u{6e}\u{6f}\u{6d}\u{73}\u{67}") or false)
10+local usertests = rawget(_G,"\u{5f}\u{55}")
11+if usertests then
12+_soft=true
13+_port=true
14+_nomsg=true
15+end
16+debug=nil
17+if usertests then
18+T=nil
19+else
20+T=rawget(_G,"\u{54}")
21+end
22+print("\u{a}\u{9}\u{53}\u{74}\u{61}\u{72}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{54}\u{65}\u{73}\u{74}\u{73}")
23+do
24+local random_x,random_y = math.randomseed()
25+print(string.format("\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{73}\u{65}\u{65}\u{64}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{25}\u{64}",random_x,random_y))
26+end
27+print(("\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{20}\u{70}\u{61}\u{74}\u{68}\u{3a}\u{a}\u{2a}\u{2a}\u{2a}\u{2a}" .. (package.path .. "\u{2a}\u{2a}\u{2a}\u{2a}\u{a}")))
28+local initclock = os.clock()
29+local lastclock = initclock
30+local walltime = os.time()
31+local collectgarbage = collectgarbage
32+do
33+local msgs = {}
34+function Message(m)
35+if (not _nomsg) then
36+print(m)
37+msgs[(# (msgs + 0x1))]=string.sub(m,0x3,(- 0x3))
38+end
39+end
40+assert(os.setlocale("\u{43}"))
41+local T,print,format,write,assert,type,unpack,floor = T,print,string.format,io.write,assert,type,table.unpack,math.floor
42+local function F
43+(m)
44+local function round
45+(m)
46+m=(m + 0.04999)
47+return format("\u{25}\u{2e}\u{31}\u{66}",m)
48+end
49+if (m < 0x3e8) then
50+return m
51+else
52+m=(m / 0x3e8)
53+if (m < 0x3e8) then
54+return (round(m) .. "\u{4b}")
55+else
56+return (round((m / 0x3e8)) .. "\u{4d}")
57+end
58+end
59+end
60+local Cstacklevel
61+local showmem
62+if (not T) then
63+local max = 0x0
64+showmem=function ()
65+local m = (collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") * 0x400)
66+max=(((m > max) and m) or max)
67+print(format("\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{2d}\u{2d}\u{20}\u{74}\u{6f}\u{74}\u{61}\u{6c}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}\u{25}\u{73}\u{2c}\u{20}\u{6d}\u{61}\u{78}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}\u{25}\u{73}\u{20}\u{2d}\u{2d}\u{2d}\u{2d}\u{a}",F(m),F(max)))
68+end
69+Cstacklevel=function ()
70+return 0x0
71+end
72+else
73+showmem=function ()
74+T.checkmemory()
75+local total,numblocks,maxmem = T.totalmem()
76+local count = collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
77+print(format("\u{a}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{2d}\u{2d}\u{20}\u{74}\u{6f}\u{74}\u{61}\u{6c}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}\u{25}\u{73}\u{20}\u{28}\u{25}\u{2e}\u{30}\u{66}\u{4b}\u{29}\u{2c}\u{20}\u{6d}\u{61}\u{78}\u{20}\u{75}\u{73}\u{65}\u{3a}\u{20}\u{25}\u{73}\u{2c}\u{20}\u{20}\u{62}\u{6c}\u{6f}\u{63}\u{6b}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{a}",F(total),count,F(maxmem),numblocks))
78+print(format(("\u{9}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}\u{3a}\u{20}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}" .. "\u{a}\u{9}\u{75}\u{64}\u{61}\u{74}\u{61}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{29}"),T.totalmem("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"),T.totalmem("\u{74}\u{61}\u{62}\u{6c}\u{65}"),T.totalmem("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}"),T.totalmem("\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}"),T.totalmem("\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}")))
79+end
80+Cstacklevel=function ()
81+local _,_,ncalls = T.stacklevel()
82+return ncalls
83+end
84+end
85+local Cstack = Cstacklevel()
86+local function report
87+(n)
88+print(("\u{a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{20}\u{46}\u{49}\u{4c}\u{45}\u{20}\u{27}" .. (n .. "\u{27}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}")))
89+end
90+local olddofile = dofile
91+local dofile = function (n,strip)
92+showmem()
93+local c = os.clock()
94+print(string.format("\u{74}\u{69}\u{6d}\u{65}\u{3a}\u{20}\u{25}\u{67}\u{20}\u{28}\u{2b}\u{25}\u{67}\u{29}",(c - initclock),(c - lastclock)))
95+lastclock=c
96+report(n)
97+local f = assert(loadfile(n))
98+local b = string.dump(f,strip)
99+f=assert(load(b))
100+return f()
101+end
102+dofile("\u{6d}\u{61}\u{69}\u{6e}\u{2e}\u{6c}\u{75}\u{61}")
103+require("\u{74}\u{72}\u{61}\u{63}\u{65}\u{67}\u{63}").start()
104+report("\u{67}\u{63}\u{2e}\u{6c}\u{75}\u{61}")
105+local f = assert(loadfile("\u{67}\u{63}\u{2e}\u{6c}\u{75}\u{61}"))
106+f()
107+dofile("\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}")
108+assert(((dofile("\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{2e}\u{6c}\u{75}\u{61}") == deep) and deep))
109+_G.deep=nil
110+olddofile("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}\u{2e}\u{6c}\u{75}\u{61}")
111+olddofile("\u{6c}\u{69}\u{74}\u{65}\u{72}\u{61}\u{6c}\u{73}\u{2e}\u{6c}\u{75}\u{61}")
112+dofile("\u{74}\u{70}\u{61}\u{63}\u{6b}\u{2e}\u{6c}\u{75}\u{61}")
113+assert((dofile("\u{61}\u{74}\u{74}\u{72}\u{69}\u{62}\u{2e}\u{6c}\u{75}\u{61}") == 0x1b))
114+dofile("\u{67}\u{65}\u{6e}\u{67}\u{63}\u{2e}\u{6c}\u{75}\u{61}")
115+assert((dofile("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{73}\u{2e}\u{6c}\u{75}\u{61}") == 0x5))
116+dofile("\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{73}\u{2e}\u{6c}\u{75}\u{61}")
117+dofile("\u{63}\u{6f}\u{64}\u{65}\u{2e}\u{6c}\u{75}\u{61}",true)
118+if (not _G._soft) then
119+report("\u{62}\u{69}\u{67}\u{2e}\u{6c}\u{75}\u{61}")
120+local f = coroutine.wrap(assert(loadfile("\u{62}\u{69}\u{67}\u{2e}\u{6c}\u{75}\u{61}")))
121+assert((f() == "\u{62}"))
122+assert((f() == "\u{61}"))
123+end
124+dofile("\u{63}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{2e}\u{6c}\u{75}\u{61}")
125+dofile("\u{6e}\u{65}\u{78}\u{74}\u{76}\u{61}\u{72}\u{2e}\u{6c}\u{75}\u{61}")
126+dofile("\u{70}\u{6d}\u{2e}\u{6c}\u{75}\u{61}")
127+dofile("\u{75}\u{74}\u{66}\u{38}\u{2e}\u{6c}\u{75}\u{61}")
128+dofile("\u{61}\u{70}\u{69}\u{2e}\u{6c}\u{75}\u{61}")
129+assert((dofile("\u{65}\u{76}\u{65}\u{6e}\u{74}\u{73}\u{2e}\u{6c}\u{75}\u{61}") == 0xc))
130+dofile("\u{76}\u{61}\u{72}\u{61}\u{72}\u{67}\u{2e}\u{6c}\u{75}\u{61}")
131+dofile("\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{2e}\u{6c}\u{75}\u{61}")
132+dofile("\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{6c}\u{75}\u{61}")
133+dofile("\u{67}\u{6f}\u{74}\u{6f}\u{2e}\u{6c}\u{75}\u{61}",true)
134+dofile("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}\u{2e}\u{6c}\u{75}\u{61}")
135+dofile("\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{6c}\u{75}\u{61}")
136+dofile("\u{73}\u{6f}\u{72}\u{74}\u{2e}\u{6c}\u{75}\u{61}",true)
137+dofile("\u{62}\u{69}\u{74}\u{77}\u{69}\u{73}\u{65}\u{2e}\u{6c}\u{75}\u{61}")
138+assert((dofile("\u{76}\u{65}\u{72}\u{79}\u{62}\u{69}\u{67}\u{2e}\u{6c}\u{75}\u{61}",true) == 0xa))
139+;
140+collectgarbage()
141+dofile("\u{66}\u{69}\u{6c}\u{65}\u{73}\u{2e}\u{6c}\u{75}\u{61}")
142+if (# (msgs > 0x0)) then
143+local m = table.concat(msgs,"\u{a}\u{20}\u{20}")
144+warn("\u{23}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{70}\u{65}\u{72}\u{66}\u{6f}\u{72}\u{6d}\u{65}\u{64}\u{3a}\u{a}\u{20}\u{20}",m,"\u{a}")
145+end
146+print("\u{28}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{74}\u{77}\u{6f}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{73}\u{20}\u{6e}\u{6f}\u{77}\u{29}")
147+warn("\u{40}\u{6f}\u{6e}")
148+warn("\u{23}\u{54}\u{68}\u{69}\u{73}\u{20}\u{69}\u{73}\u{20}","\u{61}\u{6e}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}","\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}")
149+warn("\u{40}\u{6f}\u{66}\u{66}")
150+warn("\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{20}\u{54}\u{48}\u{49}\u{53}\u{20}\u{57}\u{41}\u{52}\u{4e}\u{49}\u{4e}\u{47}\u{20}\u{53}\u{48}\u{4f}\u{55}\u{4c}\u{44}\u{20}\u{4e}\u{4f}\u{54}\u{20}\u{41}\u{50}\u{50}\u{45}\u{41}\u{52}\u{20}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}")
151+warn("\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{20}\u{54}\u{48}\u{49}\u{53}\u{20}\u{57}\u{41}\u{52}\u{4e}\u{49}\u{4e}\u{47}\u{20}\u{41}\u{4c}\u{53}\u{4f}\u{20}\u{53}\u{48}\u{4f}\u{55}\u{4c}\u{44}\u{20}\u{4e}\u{4f}\u{54}\u{20}\u{41}\u{50}\u{50}\u{45}\u{41}\u{52}\u{20}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}\u{2a}")
152+warn("\u{40}\u{6f}\u{6e}")
153+warn("\u{23}\u{54}\u{68}\u{69}\u{73}\u{20}\u{69}\u{73}","\u{20}\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{6f}\u{6e}\u{65}")
154+assert((debug == nil))
155+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
156+print(string.format("\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{2c}\u{20}\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}",(string.packsize("\u{6a}") * 0x8),(string.packsize("\u{6e}") * 0x8)))
157+debug.sethook(function (a)
158+assert((type(a) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
159+end,"\u{63}\u{72}")
160+_G.showmem=showmem
161+assert((Cstack == Cstacklevel()),"\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{61}\u{74}\u{20}\u{74}\u{68}\u{65}\u{20}\u{73}\u{61}\u{6d}\u{65}\u{20}\u{43}\u{2d}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6c}\u{65}\u{76}\u{65}\u{6c}\u{20}\u{69}\u{74}\u{20}\u{77}\u{61}\u{73}\u{20}\u{77}\u{68}\u{65}\u{6e}\u{20}\u{73}\u{74}\u{61}\u{72}\u{74}\u{65}\u{64}\u{20}\u{74}\u{68}\u{65}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}")
162+end
163+local _G,showmem,print,format,clock,time,difftime,assert,open,warn = _G,showmem,print,string.format,os.clock,os.time,os.difftime,assert,io.open,warn
164+local fname = ((T and "\u{74}\u{69}\u{6d}\u{65}\u{2d}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{74}\u{78}\u{74}") or "\u{74}\u{69}\u{6d}\u{65}\u{2e}\u{74}\u{78}\u{74}")
165+local lasttime
166+if (not usertests) then
167+local f = io.open(fname)
168+if f then
169+lasttime=assert(tonumber(f:read("\u{61}")))
170+f:close()
171+;
172+else
173+lasttime=nil
174+end
175+end
176+print("\u{63}\u{6c}\u{65}\u{61}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{6c}\u{6c}\u{21}\u{21}\u{21}\u{21}")
177+for n in pairs(_G)
178+do
179+if (not ({["\u{5f}\u{5f}\u{5f}\u{47}\u{6c}\u{6f}\u{62}"] = 0x1,["\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"] = 0x1})[n]) then
180+_G[n]=undef
181+end
182+end
183+collectgarbage()
184+collectgarbage()
185+collectgarbage()
186+collectgarbage()
187+collectgarbage()
188+collectgarbage()
189+;
190+showmem()
191+local clocktime = (clock() - initclock)
192+walltime=difftime(time(),walltime)
193+print(format("\u{a}\u{a}\u{74}\u{6f}\u{74}\u{61}\u{6c}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{3a}\u{20}\u{25}\u{2e}\u{32}\u{66}\u{73}\u{20}\u{28}\u{77}\u{61}\u{6c}\u{6c}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{3a}\u{20}\u{25}\u{67}\u{73}\u{29}\u{a}",clocktime,walltime))
194+if (not usertests) then
195+lasttime=(lasttime or clocktime)
196+local diff = ((clocktime - lasttime) / lasttime)
197+local tolerance = 0.05
198+if ((diff >= tolerance) or (diff <= (- tolerance))) then
199+warn(format("\u{23}\u{74}\u{69}\u{6d}\u{65}\u{20}\u{64}\u{69}\u{66}\u{66}\u{65}\u{72}\u{65}\u{6e}\u{63}\u{65}\u{20}\u{66}\u{72}\u{6f}\u{6d}\u{20}\u{70}\u{72}\u{65}\u{76}\u{69}\u{6f}\u{75}\u{73}\u{20}\u{74}\u{65}\u{73}\u{74}\u{3a}\u{20}\u{25}\u{2b}\u{2e}\u{31}\u{66}\u{25}\u{25}",(diff * 0x64)))
200+end
201+assert(open(fname,"\u{77}")):write(clocktime):close()
202+end
203+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{4f}\u{4b}\u{20}\u{21}\u{21}\u{21}")
desk/res/lua/cycled/api.luanew file+1167
@@ -0,0 +1,1167 @@
1+if (T == nil) then
2+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{41}\u{50}\u{49}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
3+return
4+end
5+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
6+local pack = table.pack
7+local MEMERRMSG = "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}"
8+local function tcheck
9+(t1,t2)
10+assert((t1.n == ((t2.n or (# t2)) + 0x1)))
11+for i = 0x2, t1.n
12+do
13+assert((t1[i] == t2[(i - 0x1)]))
14+end
15+end
16+local function checkerr
17+(msg,f, ...)
18+local stat,err = pcall(f,...)
19+assert((not (stat and string.find(err,msg))))
20+end
21+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{43}\u{20}\u{41}\u{50}\u{49}")
22+local a = T.testC("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{52}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
23+assert((a == debug.getregistry()))
24+assert((T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{61}\u{62}\u{73}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0xa))
25+assert((T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{35}\u{3b}\u{20}\u{61}\u{62}\u{73}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{2d}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0x1))
26+assert((T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{61}\u{62}\u{73}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0x1))
27+assert((T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{61}\u{62}\u{73}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{52}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") < (- 0xa)))
28+a=T.d2s(12458954321123.0)
29+assert((a == string.pack("\u{64}",12458954321123.0)))
30+assert((T.s2d(a) == 12458954321123.0))
31+local a,b,c = T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}")
32+assert((((a == 0x2) and (b == 0x3)) and (not c)))
33+local f = T.makeCfunc("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}")
34+a,b,c=f()
35+assert((((a == 0x2) and (b == 0x3)) and (not c)))
36+a,b,c=T.testC("\u{70}\u{75}\u{73}\u{68}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
37+assert((((a == b) and (a == true)) and (c == false)))
38+a,b,c=T.testC("\u{70}\u{75}\u{73}\u{68}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{69}\u{6c}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{2d}\u{33}\u{3b}\u{20}\u{74}\u{6f}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{2d}\u{33}\u{3b}\u{20}\u{74}\u{6f}\u{62}\u{6f}\u{6f}\u{6c}\u{20}\u{2d}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
39+assert((((a == false) and (b == true)) and (c == false)))
40+a,b,c=T.testC("\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",0xa,0x14,0x1e,0x28)
41+assert((((a == 0x28) and (b == 0x5)) and (not c)))
42+local t = pack(T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3))
43+tcheck(t,{["\u{6e}"] = 0x4,0x2,0x3})
44+t=pack(T.testC("\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{30}\u{3b}\u{20}\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{31}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{30}",0x3,0x1,0x17))
45+assert((((t.n == 0xa) and (t[0x1] == nil)) and (t[0xa] == nil)))
46+t=pack(T.testC("\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4))
47+tcheck(t,{["\u{6e}"] = 0x2,0x2,0x4})
48+t=pack(T.testC("\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3))
49+tcheck(t,{["\u{6e}"] = 0x2,0x2,0x3})
50+t=pack(T.testC("\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
51+tcheck(t,{["\u{6e}"] = 0x4,0x2,0x5,0x3,0x4})
52+t=pack(T.testC("\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
53+tcheck(t,{["\u{6e}"] = 0x3,0x5,0x3,0x4})
54+t=pack(T.testC("\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
55+tcheck(t,{["\u{6e}"] = 0x3,0x2,0x3,0x5})
56+t=pack(T.testC("\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
57+tcheck(t,{["\u{6e}"] = 0x3,0x2,0x4,0x5})
58+t=pack(T.testC("\u{63}\u{6f}\u{70}\u{79}\u{20}\u{33}\u{20}\u{34}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
59+tcheck(t,{["\u{6e}"] = 0x4,0x2,0x3,0x3,0x5})
60+t=pack(T.testC("\u{63}\u{6f}\u{70}\u{79}\u{20}\u{2d}\u{33}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5))
61+tcheck(t,{["\u{6e}"] = 0x4,0x2,0x3,0x4,0x3})
62+do
63+local t = {0xa,0x14,0x1e,0x28,0x32,0x3c}
64+for i = (- 0x6), 0x6
65+do
66+local s = string.format("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{32}\u{20}\u{25}\u{64}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{37}",i)
67+local t1 = pack(T.testC(s,0xa,0x14,0x1e,0x28,0x32,0x3c))
68+tcheck(t1,t)
69+table.insert(t,0x1,table.remove(t))
70+end
71+t=pack(T.testC("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{2d}\u{32}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0xa,0x14,0x1e,0x28))
72+tcheck(t,{0xa,0x14,0x28,0x1e})
73+t=pack(T.testC("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{2d}\u{32}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0xa,0x14,0x1e,0x28))
74+tcheck(t,{0xa,0x14,0x28,0x1e})
75+t=pack(T.testC("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0xa,0x14,0x1e,0x28))
76+tcheck(t,{0xa,0x14,0x1e,0x28})
77+t=pack(T.testC("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0xa,0x14,0x1e,0x28))
78+tcheck(t,{0xa,0x14,0x1e,0x28})
79+t=pack(T.testC("\u{72}\u{6f}\u{74}\u{61}\u{74}\u{65}\u{20}\u{35}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0xa,0x14,0x1e,0x28))
80+tcheck(t,{0xa,0x14,0x1e,0x28})
81+end
82+T.testC("\u{20}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{43}\u{20}\u{22}\u{23}\u{54}\u{68}\u{69}\u{73}\u{20}\u{73}\u{68}\u{6f}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{61}\u{22}\u{a}\u{20}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{43}\u{20}\u{22}\u{20}\u{73}\u{69}\u{6e}\u{67}\u{6c}\u{65}\u{20}\u{22}\u{a}\u{20}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{22}\u{a}\u{20}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{43}\u{20}\u{22}\u{23}\u{54}\u{68}\u{69}\u{73}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{22}\u{a}\u{20}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{6f}\u{6e}\u{65}\u{22}\u{a}")
83+do
84+local f = T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{62}\u{6f}\u{6c}\u{61}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{31}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{27}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{27}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{67}\u{69}\u{76}\u{65}\u{6e}\u{20}\u{68}\u{61}\u{6e}\u{64}\u{6c}\u{65}\u{72}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}")
85+local msg,st = f(string.upper)
86+assert(((st == "\u{45}\u{52}\u{52}\u{52}\u{55}\u{4e}") and (msg == "\u{42}\u{4f}\u{4c}\u{41}")))
87+local msg,st = f(string.len)
88+assert(((st == "\u{45}\u{52}\u{52}\u{52}\u{55}\u{4e}") and (msg == 0x4)))
89+end
90+t=pack(T.testC("\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{31}\u{3b}\u{20}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{31}\u{3b}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{2d}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",0x2,0x3,0x4,0x5,0xa,0x28,0x5a))
91+tcheck(t,{["\u{6e}"] = 0x7,0x2,0x3,0x4,0x5,0xa,0x28,0x5a})
92+t=pack(T.testC("\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}","\u{61}\u{6c}\u{6f}",0x2,0x3,"\u{6a}\u{6f}\u{61}\u{6f}",0xc))
93+tcheck(t,{["\u{6e}"] = 0x1,"\u{61}\u{6c}\u{6f}\u{32}\u{33}\u{6a}\u{6f}\u{61}\u{6f}\u{31}\u{32}"})
94+t=pack(T.testC("\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{32}\u{2c}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",function (a,b)
95+return 0x1,0x2,0x3,0x4,a,b
96+end,"\u{61}\u{6c}\u{6f}","\u{6a}\u{6f}\u{61}\u{6f}"))
97+tcheck(t,{["\u{6e}"] = 0x6,0x1,0x2,0x3,0x4,"\u{61}\u{6c}\u{6f}","\u{6a}\u{6f}\u{61}\u{6f}"})
98+do
99+local a = {}
100+for i = 0x1, 0x3e8
101+do
102+a[i]=true
103+end
104+;
105+a[0x3e7]=0xa
106+local b = T.testC("\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{2d}\u{31}\u{20}\u{30}\u{3b}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{3b}\u{20}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",table.unpack,a)
107+assert((b == "\u{31}\u{30}"))
108+end
109+_G.AA=0xe
110+;
111+_G.BB="\u{61}\u{33}\u{31}"
112+local a = {T.testC("\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{41}\u{41}\u{3b}\u{a}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{42}\u{42}\u{3b}\u{a}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{42}\u{42}\u{3b}\u{a}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{41}\u{41}\u{3b}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}\u{a}")}
113+assert(((((a[0x2] == 0xe) and (a[0x3] == "\u{61}\u{33}\u{31}")) and (a[0x4] == nil)) and (_G.AA == "\u{61}\u{33}\u{31}")))
114+_G.AA,_G.BB=nil
115+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2f}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0.5))
116+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2d}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == (- 0xa)))
117+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{2d}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2a}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == (- 0xc8)))
118+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5e}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0x3e8))
119+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2f}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0.5))
120+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2d}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == (- 0xa)))
121+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{32}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2a}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == (- 0xc8)))
122+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5e}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == 0x3e8))
123+assert((T.testC("\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2f}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x2,0x0) == (10.0 / 0x0)))
124+a=T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5c}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
125+assert(((a == 3.0) and (math.type(a) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")))
126+a=T.testC("\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5c}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
127+assert(((a == 0x3) and (math.type(a) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}")))
128+a=assert(T.testC("\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2b}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"))
129+assert(((a == 0xd) and (math.type(a) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}")))
130+a=assert(T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{33}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2b}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"))
131+assert(((a == 0xd) and (math.type(a) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")))
132+a,b,c=T.testC("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5f}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
133+assert(((a == 0x1) and (b == (- (0xa and (c == "\u{35}"))))))
134+local mt = {["\u{5f}\u{5f}\u{61}\u{64}\u{64}"] = function (a,b)
135+return setmetatable({(a[0x1] + b[0x1])},mt)
136+end,["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}"] = function (a,b)
137+return setmetatable({(a[0x1] % b[0x1])},mt)
138+end,["\u{5f}\u{5f}\u{75}\u{6e}\u{6d}"] = function (a)
139+return setmetatable({(a[0x1] * 0x2)},mt)
140+end}
141+a,b,c=setmetatable({0x4},mt),setmetatable({0x8},mt),setmetatable({(- 0x3)},mt)
142+local x,y,z = T.testC("\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2b}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",0xa,a,b)
143+assert((((x == 0xa) and (y[0x1] == 0xc)) and (z == nil)))
144+assert((T.testC("\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{25}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a,c)[0x1] == (0x4 % (- 0x3))))
145+assert((T.testC("\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5f}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{2b}\u{3b}\u{20}\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{25}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",b,a,c)[0x1] == (0x8 % (0x4 + ((- 0x3) * 0x2)))))
146+checkerr("\u{64}\u{69}\u{76}\u{69}\u{64}\u{65}\u{20}\u{62}\u{79}\u{20}\u{7a}\u{65}\u{72}\u{6f}",T.testC,"\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{5c}",0xa,0x0)
147+checkerr("\u{25}\u{25}\u{30}",T.testC,"\u{61}\u{72}\u{69}\u{74}\u{68}\u{20}\u{25}",0xa,0x0)
148+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{32}\u{20}\u{35}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x3,0x2,0x2,0x4,0x2,0x2))
149+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{32}\u{20}\u{35}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x3,0x2,0x2,0x4,0x2,0x2))
150+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{33}\u{20}\u{34}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x3,0x2,0x2,0x4,0x2,0x2)))
151+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{33}\u{20}\u{34}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x3,0x2,0x2,0x4,0x2,0x2))
152+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{35}\u{20}\u{32}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x4,0x2,0x2,0x3,0x2,0x2))
153+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{32}\u{20}\u{2d}\u{33}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}","\u{34}","\u{32}","\u{32}","\u{33}","\u{32}","\u{32}")))
154+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{2d}\u{33}\u{20}\u{32}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}","\u{33}","\u{32}","\u{32}","\u{34}","\u{32}","\u{32}")))
155+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{31}\u{20}\u{34}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
156+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{39}\u{20}\u{31}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
157+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{39}\u{20}\u{39}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
158+local b = {["\u{5f}\u{5f}\u{6c}\u{74}"] = function (a,b)
159+return (a[0x1] < b[0x1])
160+end}
161+local a1,a3,a4 = setmetatable({0x1},b),setmetatable({0x3},b),setmetatable({0x4},b)
162+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{32}\u{20}\u{35}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a3,0x2,0x2,a4,0x2,0x2))
163+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{32}\u{20}\u{35}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a3,0x2,0x2,a4,0x2,0x2))
164+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{35}\u{20}\u{2d}\u{36}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a4,0x2,0x2,a3,0x2,0x2))
165+a,b=T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{35}\u{20}\u{2d}\u{36}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a1,0x2,0x2,a3,0x2,0x14)
166+assert(((a == 0x14) and (b == false)))
167+a,b=T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{35}\u{20}\u{2d}\u{36}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a1,0x2,0x2,a3,0x2,0x14)
168+assert(((a == 0x14) and (b == false)))
169+a,b=T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{35}\u{20}\u{2d}\u{36}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a1,0x2,0x2,a1,0x2,0x14)
170+assert(((a == 0x14) and (b == true)))
171+do
172+local mt = {["\u{5f}\u{5f}\u{6c}\u{74}"] = function (a,b)
173+return (a[0x1] < b[0x1])
174+end,["\u{5f}\u{5f}\u{6c}\u{65}"] = function (a,b)
175+return (a[0x1] <= b[0x1])
176+end,["\u{5f}\u{5f}\u{65}\u{71}"] = function (a,b)
177+return (a[0x1] == b[0x1])
178+end}
179+local function O
180+(x)
181+return setmetatable({x},mt)
182+end
183+local a,b = T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{54}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",O(0x1),O(0x2))
184+assert(((a == true) and (b == 0xa)))
185+local a,b = T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{4c}\u{45}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",O(0x3),O(0x2))
186+assert(((a == false) and (b == 0xa)))
187+local a,b = T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",O(0x3),O(0x3))
188+assert(((a == true) and (b == 0xa)))
189+end
190+local t = setmetatable({["\u{78}"] = 0x14},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function (t)
191+return t.x
192+end})
193+a,b,c=T.testC("\u{20}\u{20}\u{20}\u{6c}\u{65}\u{6e}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{4c}\u{6c}\u{65}\u{6e}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{a}",t)
194+assert((((a == 0x14) and (b == 0x14)) and (c == 0x0)))
195+t.x="\u{32}\u{33}\u{34}"
196+;
197+t[0x1]=0x14
198+a,b,c=T.testC("\u{20}\u{20}\u{20}\u{6c}\u{65}\u{6e}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{4c}\u{6c}\u{65}\u{6e}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{a}",t)
199+assert((((a == "\u{32}\u{33}\u{34}") and (b == 0xea)) and (c == 0x1)))
200+t.x=print
201+;
202+t[0x1]=0x14
203+a,c=T.testC("\u{20}\u{20}\u{20}\u{6c}\u{65}\u{6e}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{a}",t)
204+assert(((a == print) and (c == 0x1)))
205+a=setmetatable({["\u{78}"] = "\u{75}"},{["\u{5f}\u{5f}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"] = function (a,b)
206+return (a.x .. ("\u{2e}" .. b.x))
207+end})
208+x,y=T.testC("\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{35}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{3b}\u{a}",a,a)
209+assert(((x == (a .. a)) and (y == 0x5)))
210+assert((T.testC("\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == ""))
211+assert((T.testC("\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}","\u{78}\u{75}\u{78}\u{75}") == "\u{78}\u{75}\u{78}\u{75}"))
212+local function B
213+(x)
214+return ((x and 0x1) or 0x0)
215+end
216+local function count
217+(x,n)
218+n=(n or 0x2)
219+local prog = "\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{63}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{6e}\u{69}\u{6c}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{73}\u{6e}\u{75}\u{6c}\u{6c}\u{20}\u{25}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{38}\u{a}\u{20}\u{20}"
220+prog=string.format(prog,n,n,n,n,n,n,n,n)
221+local a,b,c,d,e,f,g,h = T.testC(prog,x)
222+return (((((((B(a) + B(b)) + B(c)) + B(d)) + B(e)) + B(f)) + B(g)) + (0x64 * B(h)))
223+end
224+assert((count(0x3) == 0x2))
225+assert((count("\u{61}\u{6c}\u{6f}") == 0x1))
226+assert((count("\u{33}\u{32}") == 0x2))
227+assert((count({}) == 0x1))
228+assert((count(print) == 0x2))
229+assert((count(function ()
230+
231+end) == 0x1))
232+assert((count(nil) == 0x1))
233+assert((count(io.stdin) == 0x1))
234+assert((count(nil,0xf) == 0x64))
235+local function to
236+(s,x,n)
237+n=(n or 0x2)
238+return T.testC(string.format("\u{25}\u{73}\u{20}\u{25}\u{64}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",s,n),x)
239+end
240+local null = T.pushuserdata(0x0)
241+local hfunc = string.gmatch("","")
242+assert(debug.getupvalue(hfunc,0x1))
243+assert((to("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",{}) == nil))
244+assert((to("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}","\u{61}\u{6c}\u{6f}") == "\u{61}\u{6c}\u{6f}"))
245+assert((to("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",0xc) == "\u{31}\u{32}"))
246+assert((to("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",0xc,0x3) == nil))
247+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",{}) == 0x0))
248+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",{0x1,0x2,0x3}) == 0x3))
249+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}","\u{61}\u{6c}\u{6f}\u{0}\u{0}\u{61}") == 0x6))
250+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",T.newuserdata(0x0)) == 0x0))
251+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",T.newuserdata(0x65)) == 0x65))
252+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",0x7c) == 0x0))
253+assert((to("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}",true) == 0x0))
254+assert((to("\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}",{}) == 0x0))
255+assert((to("\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}","\u{31}\u{32}") == 0xc))
256+assert((to("\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}","\u{73}\u{32}") == 0x0))
257+assert((to("\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}",0x1,0x14) == 0x0))
258+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",0xa) == null))
259+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",true) == null))
260+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",nil) == null))
261+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}","\u{61}\u{62}\u{63}") ~= null))
262+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",string.rep("\u{78}",0xa)) == to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",string.rep("\u{78}",0xa))))
263+do
264+local s1 = string.rep("\u{78}",0x12c)
265+local s2 = string.rep("\u{78}",0x12c)
266+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",s1) ~= to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",s2)))
267+end
268+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",T.pushuserdata(0x14)) ~= null))
269+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",io.read) ~= null))
270+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",hfunc) ~= null))
271+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",function ()
272+
273+end) ~= null))
274+assert((to("\u{74}\u{6f}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{65}\u{72}",io.stdin) ~= null))
275+assert((to("\u{66}\u{75}\u{6e}\u{63}\u{32}\u{6e}\u{75}\u{6d}",0x14) == 0x0))
276+assert((to("\u{66}\u{75}\u{6e}\u{63}\u{32}\u{6e}\u{75}\u{6d}",T.pushuserdata(0xa)) == 0x0))
277+assert((to("\u{66}\u{75}\u{6e}\u{63}\u{32}\u{6e}\u{75}\u{6d}",io.read) ~= 0x0))
278+assert((to("\u{66}\u{75}\u{6e}\u{63}\u{32}\u{6e}\u{75}\u{6d}",hfunc) ~= 0x0))
279+a=to("\u{74}\u{6f}\u{63}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}",math.deg)
280+assert(((a(0x3) == math.deg(0x3)) and (a == math.deg)))
281+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{6e}\u{69}\u{63}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
282+do
283+assert((T.checkpanic("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{68}\u{69}\u{3b}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}") == "\u{68}\u{69}"))
284+assert((T.checkpanic("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{68}\u{69}\u{3b}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{3b}","\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{35}\u{20}\u{58}\u{58}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{20}\u{61}\u{6c}\u{6f}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{20}\u{6d}\u{75}\u{6e}\u{64}\u{6f}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{33}") == "\u{68}\u{69}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{6d}\u{75}\u{6e}\u{64}\u{6f}"))
285+assert((T.checkpanic("\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{34}") == "\u{62}\u{61}\u{64}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{23}\u{34}\u{20}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{2c}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{6e}\u{6f}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{29}"))
286+T.totalmem((T.totalmem() + 0x2710))
287+assert((T.checkpanic("\u{6e}\u{65}\u{77}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}\u{20}\u{32}\u{30}\u{30}\u{30}\u{30}") == MEMERRMSG))
288+T.totalmem(0x0)
289+if (not _soft) then
290+local msg = T.checkpanic("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{28}\u{29}\u{20}\u{66}\u{28}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{22}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{66}\u{3b}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}")
291+assert(string.find(msg,"\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))
292+end
293+assert((T.checkpanic("\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{59}\u{20}\u{3d}\u{20}\u{27}\u{68}\u{6f}\u{27}\u{3b}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{22}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6e}\u{65}\u{77}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{68}\u{69}\u{22}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{a}\u{20}\u{20}","\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{59}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{32}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{20}\u{6f}\u{72}\u{69}\u{67}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{59}\u{a}\u{20}\u{20}") == "\u{68}\u{69}\u{68}\u{6f}"))
294+end
295+if (not _soft) then
296+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")
297+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
298+checkerr("\u{58}\u{58}\u{58}\u{58}",T.testC,"\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{31}\u{30}\u{30}\u{30}\u{30}\u{32}\u{33}\u{20}\u{58}\u{58}\u{58}\u{58}")
299+checkerr("\u{5e}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{24}",T.testC,"\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{31}\u{30}\u{30}\u{30}\u{30}\u{32}\u{33}\u{20}\u{27}\u{27}")
300+local s = string.rep("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{69}\u{6c}\u{3b}\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{31}\u{20}\u{58}\u{58}\u{3b}",0xf4240)
301+checkerr("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",T.testC,s)
302+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
303+print("\u{2b}")
304+end
305+local lim = ((_soft and 0x1f4) or 0x2ee0)
306+local prog = {("\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}" .. (((lim * 0x2) + 0x64) .. "\u{6d}\u{73}\u{67}")),"\u{6e}\u{65}\u{77}\u{74}\u{61}\u{62}\u{6c}\u{65}"}
307+for i = 0x1, lim
308+do
309+prog[(# (prog + 0x1))]=("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}" .. i)
310+prog[(# (prog + 0x1))]=("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}" .. (i * 0xa))
311+end
312+prog[(# (prog + 0x1))]="\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{32}"
313+prog[(# (prog + 0x1))]=("\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}" .. (- ((0x2 * lim) + 0x2)))
314+for i = 0x1, lim
315+do
316+prog[(# (prog + 0x1))]=("\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}" .. (- ((0x2 * ((lim - i) + 0x1)) + 0x1)))
317+end
318+prog[(# (prog + 0x1))]="\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}"
319+prog=table.concat(prog,"\u{3b}")
320+local g,t = T.testC(prog)
321+assert((g == _G))
322+for i = 0x1, lim
323+do
324+assert((t[i] == (i * 0xa)))
325+;
326+t[i]=undef
327+end
328+assert((next(t) == nil))
329+prog,g,t=nil
330+a=T.testC("\u{20}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{3b}\u{20}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{31}\u{20}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{30}\u{20}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{a}","\u{58}\u{58}\u{3d}\u{31}\u{35}\u{30}",function (a)
331+assert((a == nil))
332+;
333+return 0x3
334+end)
335+assert(((type(a) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (XX == 0x96)))
336+_G.XX=nil
337+local function check3
338+(p, ...)
339+local arg = {...}
340+assert((# (arg == 0x3)))
341+assert(string.find(arg[0x3],p))
342+end
343+check3("\u{3a}\u{31}\u{3a}",T.testC("\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}","\u{78}\u{3d}"))
344+check3("\u{25}\u{2e}",T.testC("\u{6c}\u{6f}\u{61}\u{64}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}","\u{2e}"))
345+check3("\u{78}\u{78}\u{78}\u{78}",T.testC("\u{6c}\u{6f}\u{61}\u{64}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}","\u{78}\u{78}\u{78}\u{78}"))
346+local function checkerrnopro
347+(code,msg)
348+local th = coroutine.create(function ()
349+
350+end)
351+local stt,err = pcall(T.testC,th,code)
352+assert((not (stt and string.find(err,msg))))
353+end
354+if (not _soft) then
355+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
356+checkerrnopro("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{3b}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{30}","\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{61}\u{6c}\u{6c}")
357+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{69}\u{6e}\u{20}\u{75}\u{6e}\u{70}\u{72}\u{6f}\u{74}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}")
358+function F()
359+F()
360+end
361+checkerrnopro("\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{46}\u{27}\u{3b}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{30}\u{3b}","\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")
362+F=nil
363+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
364+end
365+print("\u{2b}")
366+do
367+local a = {}
368+local a1 = T.testC("\u{72}\u{61}\u{77}\u{73}\u{65}\u{74}\u{70}\u{20}\u{32}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a,0x14)
369+assert((a == a1))
370+assert((a[T.pushuserdata(0x1)] == 0x14))
371+local a1,res = T.testC("\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{70}\u{20}\u{2d}\u{31}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a)
372+assert(((a == a1) and (res == 0x14)))
373+end
374+do
375+local a = {}
376+a[a]=0xa
377+local prog = "\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
378+local res = {T.testC(prog,a)}
379+assert((# (((res == 0x2) and (res[0x1] == prog)) and (res[0x2] == 0xa))))
380+local prog = "\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
381+local res = {T.testC(prog,a,0x14)}
382+assert((a[a] == 0x14))
383+assert((# ((res == 0x1) and (res[0x1] == prog))))
384+a[a]=0xa
385+local prog = "\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
386+local res = {T.testC(prog,a)}
387+assert((# (((res == 0x2) and (res[0x1] == prog)) and (res[0x2] == 0xa))))
388+local prog = "\u{72}\u{61}\u{77}\u{73}\u{65}\u{74}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
389+local res = {T.testC(prog,a,0x14)}
390+assert((a[a] == 0x14))
391+assert((# ((res == 0x1) and (res[0x1] == prog))))
392+local prog = "\u{72}\u{61}\u{77}\u{73}\u{65}\u{74}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
393+local res = {T.testC(prog,0x1e,a)}
394+assert((a[0x1e] == a))
395+assert((# ((res == 0x1) and (res[0x1] == prog))))
396+local prog = "\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
397+local res = {T.testC(prog,0x28,a)}
398+assert((a[0x28] == a))
399+assert((# ((res == 0x1) and (res[0x1] == prog))))
400+local prog = "\u{72}\u{61}\u{77}\u{73}\u{65}\u{74}\u{69}\u{20}\u{2d}\u{31}\u{20}\u{31}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
401+local res = {T.testC(prog,a)}
402+assert((a[0x64] == a))
403+assert((# ((res == 0x1) and (res[0x1] == prog))))
404+local prog = "\u{73}\u{65}\u{74}\u{69}\u{20}\u{2d}\u{31}\u{20}\u{32}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}"
405+local res = {T.testC(prog,a)}
406+assert((a[0xc8] == a))
407+assert((# ((res == 0x1) and (res[0x1] == prog))))
408+end
409+a={["\u{78}"] = 0x0,["\u{79}"] = 0xc}
410+x,y=T.testC("\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{34}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a,0x3,"\u{79}",0x4,"\u{78}")
411+assert(((x == 0x0) and (y == 0xc)))
412+T.testC("\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{35}",a,0x3,0x4,"\u{78}",0xf)
413+assert((a.x == 0xf))
414+a[a]=print
415+x=T.testC("\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a)
416+assert((x == print))
417+T.testC("\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}",a,"\u{78}")
418+assert((a[a] == "\u{78}"))
419+b=setmetatable({["\u{70}"] = a},{})
420+getmetatable(b).__index=function (t,i)
421+return t.p[i]
422+end
423+local k,x = T.testC("\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{33}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",0x4,b,0x14,0x23,"\u{78}")
424+assert(((x == 0xf) and (k == 0x23)))
425+k=T.testC("\u{67}\u{65}\u{74}\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{32}\u{20}\u{79}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",b)
426+assert((k == 0xc))
427+getmetatable(b).__index=function (t,i)
428+return a[i]
429+end
430+getmetatable(b).__newindex=function (t,i,v)
431+a[i]=v
432+end
433+y=T.testC("\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{32}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x2,0x3,0x4,"\u{79}",b)
434+assert((y == 0xc))
435+k=T.testC("\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{35}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",b,0x3,0x4,"\u{78}",0x10)
436+assert(((a.x == 0x10) and (k == 0x4)))
437+a[b]="\u{78}\u{75}\u{78}\u{75}"
438+y=T.testC("\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}\u{2c}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",b)
439+assert((y == "\u{78}\u{75}\u{78}\u{75}"))
440+T.testC("\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}",b,0x13)
441+assert((a[b] == 0x13))
442+do
443+local t = {["\u{5f}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"] = 0x20}
444+local a = T.testC("\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{32}\u{20}\u{5f}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{a}\u{20}\u{20}",t)
445+assert((a == 0x20))
446+local a = T.testC("\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{33}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{5f}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{20}\u{20}")
447+assert((_012345678901234567890123456789012345678901234567890123456789 == 0x21))
448+_012345678901234567890123456789012345678901234567890123456789=nil
449+end
450+a={}
451+t=pack(T.testC("\u{6e}\u{65}\u{78}\u{74}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",a,nil))
452+tcheck(t,{["\u{6e}"] = 0x1,a})
453+a={["\u{61}"] = 0x3}
454+t=pack(T.testC("\u{6e}\u{65}\u{78}\u{74}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",a,nil))
455+tcheck(t,{["\u{6e}"] = 0x3,a,"\u{61}",0x3})
456+t=pack(T.testC("\u{6e}\u{65}\u{78}\u{74}\u{3b}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{3b}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}",a,nil))
457+tcheck(t,{["\u{6e}"] = 0x1,a})
458+do
459+local A = T.testC("\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{63}\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
460+t,b,c=A("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
461+assert((((b == 0xa) and (c == 0x14)) and (type(t) == "\u{74}\u{61}\u{62}\u{6c}\u{65}")))
462+a,b=A("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{55}\u{33}\u{3b}\u{20}\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{55}\u{34}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}")
463+assert(((a == nil) and (b == 0x0)))
464+A("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{55}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{55}\u{31}")
465+b,c=A("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}")
466+assert(((b == 0x64) and (c == 0xc8)))
467+A("\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{55}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{20}\u{55}\u{31}",{["\u{78}"] = 0x1},{["\u{78}"] = 0x2})
468+b,c=A("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}")
469+assert(((b.x == 0x1) and (c.x == 0x2)))
470+T.checkmemory()
471+end
472+assert((T.testC("\u{69}\u{73}\u{6e}\u{75}\u{6c}\u{6c}\u{20}\u{55}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == true))
473+assert((T.testC("\u{69}\u{73}\u{6e}\u{75}\u{6c}\u{6c}\u{20}\u{55}\u{31}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == true))
474+assert((T.testC("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}") == nil))
475+local f = T.testC("\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{63}\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
476+assert((((T.upvalue(f,0x1) == 0xa) and (T.upvalue(f,0x2) == 0x14)) and (T.upvalue(f,0x3) == nil)))
477+T.upvalue(f,0x2,"\u{78}\u{75}\u{78}\u{75}")
478+assert((T.upvalue(f,0x2) == "\u{78}\u{75}\u{78}\u{75}"))
479+do
480+local A = ("\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{33}\u{30}\u{30}\u{20}\u{6d}\u{73}\u{67}\u{3b}" .. (string.rep("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}",0xff) .. "\u{70}\u{75}\u{73}\u{68}\u{63}\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{20}\u{32}\u{35}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"))
481+A=T.testC(A)
482+for i = 0x1, 0xff
483+do
484+assert((A(("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{25}\u{64}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"):format(i)) == 0xa))
485+end
486+assert(A("\u{69}\u{73}\u{6e}\u{75}\u{6c}\u{6c}\u{20}\u{55}\u{32}\u{35}\u{36}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"))
487+assert((not A("\u{69}\u{73}\u{6e}\u{69}\u{6c}\u{20}\u{55}\u{32}\u{35}\u{36}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
488+end
489+checkerr("\u{67}\u{6f}\u{74}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}",debug.setuservalue,0x3,{})
490+checkerr("\u{67}\u{6f}\u{74}\u{20}\u{6e}\u{69}\u{6c}",debug.setuservalue,nil,{})
491+checkerr("\u{67}\u{6f}\u{74}\u{20}\u{6c}\u{69}\u{67}\u{68}\u{74}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}",debug.setuservalue,T.pushuserdata(0x1),{})
492+local b = T.newuserdata(0x0,0xa)
493+for i = 0x1, 0xa
494+do
495+local v,p = debug.getuservalue(b,i)
496+assert(((v == nil) and p))
497+end
498+do
499+local v,p = debug.getuservalue(b,(- 0x2))
500+assert(((v == nil) and (not p)))
501+local v,p = debug.getuservalue(b,0xb)
502+assert(((v == nil) and (not p)))
503+end
504+local t = {true,false,4.56,print,{},b,"\u{58}\u{59}\u{5a}"}
505+for k,v in ipairs(t)
506+do
507+debug.setuservalue(b,v,k)
508+end
509+for k,v in ipairs(t)
510+do
511+local v1,p = debug.getuservalue(b,k)
512+assert(((v1 == v) and p))
513+end
514+assert((not debug.getuservalue(0x4)))
515+debug.setuservalue(b,function ()
516+return 0xa
517+end,0xa)
518+collectgarbage()
519+assert((debug.getuservalue(b,0xa)() == 0xa))
520+debug.setuservalue(b,0x86)
521+collectgarbage()
522+assert((debug.getuservalue(b) == 0x86))
523+do
524+local oldmode = collectgarbage("\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}")
525+T.gcstate("\u{61}\u{74}\u{6f}\u{6d}\u{69}\u{63}")
526+assert((T.gccolor(b) == "\u{62}\u{6c}\u{61}\u{63}\u{6b}"))
527+debug.setuservalue(b,{["\u{78}"] = 0x64})
528+T.gcstate("\u{70}\u{61}\u{75}\u{73}\u{65}")
529+assert((debug.getuservalue(b).x == 0x64))
530+collectgarbage(oldmode)
531+end
532+for i = 0x1, 0x3e8
533+do
534+local bb = T.newuserdata(0x0,0x1)
535+debug.setuservalue(bb,b)
536+b=bb
537+end
538+collectgarbage()
539+for i = 0x1, 0x3e8
540+do
541+b=debug.getuservalue(b)
542+end
543+assert((debug.getuservalue(b).x == 0x64))
544+b=nil
545+local i = T.ref({})
546+T.unref(i)
547+assert((T.ref({}) == i))
548+local Arr = {}
549+local Lim = 0x64
550+for i = 0x1, Lim
551+do
552+Arr[i]=T.ref({})
553+end
554+assert((T.ref(nil) == (- (0x1 and (T.getref((- 0x1)) == nil)))))
555+T.unref((- 0x1))
556+;
557+T.unref((- 0x1))
558+for i = 0x1, Lim
559+do
560+T.unref(Arr[i])
561+end
562+local function printlocks
563+()
564+local f = T.makeCfunc("\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{52}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
565+local n = f("\u{6e}")
566+print("\u{6e}",n)
567+for i = 0x0, n
568+do
569+print(i,f(i))
570+end
571+end
572+for i = 0x1, Lim
573+do
574+Arr[i]=T.ref({})
575+end
576+for i = 0x1, Lim, 0x2
577+do
578+T.unref(Arr[i])
579+end
580+assert((type(T.getref(Arr[0x2])) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
581+assert((T.getref((- 0x1)) == nil))
582+a=T.ref({})
583+collectgarbage()
584+assert((type(T.getref(a)) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
585+local tt = {}
586+local cl = {["\u{6e}"] = 0x0}
587+A=nil
588+;
589+B=nil
590+local F
591+F=function (x)
592+local udval = T.udataval(x)
593+table.insert(cl,udval)
594+local d = T.newuserdata(0x64)
595+d=nil
596+assert((debug.getmetatable(x).__gc == F))
597+assert(load("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{2e}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{7d}\u{29}"))()
598+assert((not collectgarbage()))
599+local dummy = {}
600+if (A ~= nil) then
601+assert((type(A) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}"))
602+assert((T.udataval(A) == B))
603+debug.getmetatable(A)
604+end
605+A=x
606+B=udval
607+return 0x1,0x2,0x3
608+end
609+tt.__gc=F
610+do
611+collectgarbage()
612+;
613+collectgarbage()
614+;
615+local x = collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
616+;
617+local a = T.newuserdata(0x1389)
618+assert((T.testC("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",a) == 0x1389))
619+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") >= (x + 0x4)))
620+a=nil
621+collectgarbage()
622+;
623+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") <= (x + 0x1)))
624+x=collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
625+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
626+for i = 0x1, 0x3e8
627+do
628+T.newuserdata(0x0)
629+end
630+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") > (x + 0xa)))
631+collectgarbage()
632+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") <= (x + 0x1)))
633+collectgarbage()
634+x=collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
635+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
636+a={["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
637+
638+end}
639+for i = 0x1, 0x3e8
640+do
641+debug.setmetatable(T.newuserdata(0x0),a)
642+end
643+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") >= (x + 0xa)))
644+collectgarbage()
645+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") >= (x + 0xa)))
646+collectgarbage()
647+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") <= (x + 0x1)))
648+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
649+end
650+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
651+a=T.newuserdata(0x0)
652+;
653+debug.setmetatable(a,tt)
654+;
655+local na = T.udataval(a)
656+b=T.newuserdata(0x0)
657+;
658+debug.setmetatable(b,tt)
659+;
660+local nb = T.udataval(b)
661+c=T.newuserdata(0x0)
662+;
663+debug.setmetatable(c,tt)
664+;
665+local nc = T.udataval(c)
666+x=T.newuserdata(0x4)
667+y=T.newuserdata(0x0)
668+checkerr("\u{46}\u{49}\u{4c}\u{45}\u{25}\u{2a}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{2c}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}",io.input,a)
669+checkerr("\u{46}\u{49}\u{4c}\u{45}\u{25}\u{2a}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{2c}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}",io.input,x)
670+assert(((debug.getmetatable(x) == nil) and (debug.getmetatable(y) == nil)))
671+local d = T.ref(a)
672+;
673+local e = T.ref(b)
674+;
675+local f = T.ref(c)
676+;
677+t={T.getref(d),T.getref(e),T.getref(f)}
678+assert((((t[0x1] == a) and (t[0x2] == b)) and (t[0x3] == c)))
679+t=nil
680+;
681+a=nil
682+;
683+c=nil
684+;
685+T.unref(e)
686+;
687+T.unref(f)
688+collectgarbage()
689+assert((# ((cl == 0x1) and (cl[0x1] == nc))))
690+x=T.getref(d)
691+assert(((type(x) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}") and (debug.getmetatable(x) == tt)))
692+x=nil
693+tt.b=b
694+tt=nil
695+A=nil
696+b=nil
697+T.unref(d)
698+;
699+local n5 = T.newuserdata(0x0)
700+debug.setmetatable(n5,{["\u{5f}\u{5f}\u{67}\u{63}"] = F})
701+n5=T.udataval(n5)
702+collectgarbage()
703+assert((# (cl == 0x4)))
704+assert((((cl[0x2] == n5) and (cl[0x3] == nb)) and (cl[0x4] == na)))
705+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
706+a,na={},{}
707+for i = 0x1e, 0x1, (- 0x1)
708+do
709+a[i]=T.newuserdata(0x0)
710+debug.setmetatable(a[i],{["\u{5f}\u{5f}\u{67}\u{63}"] = F})
711+na[i]=T.udataval(a[i])
712+end
713+cl={}
714+a=nil
715+;
716+collectgarbage()
717+assert((# (cl == 0x1e)))
718+for i = 0x1, 0x1e
719+do
720+assert((cl[i] == na[i]))
721+end
722+na=nil
723+for i = 0x2, Lim, 0x2
724+do
725+T.unref(Arr[i])
726+end
727+x=T.newuserdata(0x29)
728+;
729+debug.setmetatable(x,{["\u{5f}\u{5f}\u{67}\u{63}"] = F})
730+assert((T.testC("\u{6f}\u{62}\u{6a}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",x) == 0x29))
731+cl={}
732+a={[x] = 0x1}
733+x=T.udataval(x)
734+collectgarbage()
735+assert((# (cl == 0x0)))
736+for n in pairs(a)
737+do
738+a[n]=undef
739+end
740+collectgarbage()
741+assert((# ((cl == 0x1) and (cl[0x1] == x))))
742+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{34}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",print,0x1,print,0x14))
743+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{33}\u{20}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}","\u{61}\u{6c}\u{6f}","\u{61}\u{6c}\u{6f}"))
744+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",nil,nil))
745+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",{},{})))
746+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
747+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",0x3)))
748+do
749+local map = {}
750+local t = {["\u{5f}\u{5f}\u{65}\u{71}"] = function (a,b)
751+return (map[a] == map[b])
752+end}
753+local function f
754+(x)
755+local u = T.newuserdata(0x0)
756+debug.setmetatable(u,t)
757+map[u]=x
758+return u
759+end
760+assert((f(0xa) == f(0xa)))
761+assert((f(0xa) ~= f(0xb)))
762+assert(T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",f(0xa),f(0xa)))
763+assert((not T.testC("\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}\u{20}\u{45}\u{51}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",f(0xa),f(0x14))))
764+t.__eq=nil
765+assert((f(0xa) ~= f(0xa)))
766+end
767+print("\u{2b}")
768+_G.TT={}
769+T.sethook("\u{20}\u{20}\u{23}\u{20}\u{73}\u{65}\u{74}\u{20}\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{68}\u{6f}\u{6f}\u{6b}\u{20}\u{61}\u{66}\u{74}\u{65}\u{72}\u{20}\u{33}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{20}\u{68}\u{6f}\u{6f}\u{6b}\u{73}\u{a}\u{20}\u{20}\u{73}\u{65}\u{74}\u{68}\u{6f}\u{6f}\u{6b}\u{20}\u{34}\u{20}\u{30}\u{20}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{54}\u{54}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{2d}\u{33}\u{3b}\u{20}\u{61}\u{70}\u{70}\u{65}\u{6e}\u{64}\u{20}\u{2d}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{61}\u{70}\u{70}\u{65}\u{6e}\u{64}\u{20}\u{2d}\u{32}\u{a}\u{20}\u{20}\u{27}","\u{63}",0x3)
770+local a = 0x1
771+a=0x1
772+a=0x1
773+a=0x1
774+a=0x1
775+debug.sethook()
776+local t = _G.TT
777+assert((t[0x1] == "\u{6c}\u{69}\u{6e}\u{65}"))
778+local line = t[0x2]
779+assert(((t[0x3] == "\u{6c}\u{69}\u{6e}\u{65}") and (t[0x4] == (line + 0x1))))
780+assert(((t[0x5] == "\u{6c}\u{69}\u{6e}\u{65}") and (t[0x6] == (line + 0x2))))
781+assert((t[0x7] == nil))
782+_G.TT=nil
783+do
784+warn("\u{40}\u{6f}\u{66}\u{66}")
785+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
786+local a = {}
787+for i = 0x1, 0x14
788+do
789+a[i]=T.newuserdata(i)
790+end
791+for i = 0x1, 0x14, 0x2
792+do
793+debug.setmetatable(a[i],{["\u{5f}\u{5f}\u{67}\u{63}"] = function (x)
794+error("\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{69}\u{6e}\u{20}\u{67}\u{63}")
795+end})
796+end
797+for i = 0x2, 0x14, 0x2
798+do
799+debug.setmetatable(a[i],{["\u{5f}\u{5f}\u{67}\u{63}"] = function (x)
800+load("\u{41}\u{3d}\u{41}\u{2b}\u{31}")()
801+end})
802+end
803+a=nil
804+_G.A=0x0
805+collectgarbage()
806+assert((A == 0xa))
807+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
808+warn("\u{40}\u{6f}\u{6e}")
809+end
810+_G.A=nil
811+do
812+local a = {}
813+;
814+local lim = 0x1e
815+for i = 0x0, lim
816+do
817+a[i]=T.pushuserdata(i)
818+end
819+for i = 0x0, lim
820+do
821+assert((T.udataval(a[i]) == i))
822+end
823+for i = 0x0, lim
824+do
825+assert((T.pushuserdata(i) == a[i]))
826+end
827+for i = 0x0, lim
828+do
829+a[a[i]]=i
830+end
831+for i = 0x0, lim
832+do
833+a[T.pushuserdata(i)]=i
834+end
835+assert((type(tostring(a[0x1])) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
836+end
837+T.closestate(T.newstate())
838+;
839+L1=T.newstate()
840+assert(L1)
841+assert((T.doremote(L1,"\u{58}\u{3d}\u{27}\u{61}\u{27}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{61}\u{27}") == "\u{61}"))
842+assert((# (pack(T.doremote(L1,"\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{61}\u{6c}\u{6f}\u{27}\u{2c}\u{20}\u{33}\u{20}\u{65}\u{6e}\u{64}\u{3b}\u{20}\u{66}\u{28}\u{29}")) == 0x0)))
843+a,b=T.doremote(L1,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{28}\u{29}")
844+assert(((a == "\u{61}\u{6c}\u{6f}") and (b == "\u{33}")))
845+T.doremote(L1,"\u{5f}\u{45}\u{52}\u{52}\u{4f}\u{52}\u{4d}\u{45}\u{53}\u{53}\u{41}\u{47}\u{45}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}")
846+a,b,c=T.doremote(L1,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}")
847+assert(((a == nil) and (c == 0x2)))
848+a,b,c=T.doremote(L1,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{2b}")
849+assert((((a == nil) and (c == 0x3)) and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")))
850+T.loadlib(L1)
851+a,b,c=T.doremote(L1,"\u{20}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{5f}\u{47}\u{27}\u{3b}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{20}\u{3d}\u{3d}\u{20}\u{5f}\u{47}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{28}\u{22}\u{5f}\u{47}\u{22}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{61}\u{29}\u{a}\u{20}\u{20}\u{69}\u{6f}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{69}\u{6f}\u{27}\u{3b}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{79}\u{70}\u{65}\u{28}\u{69}\u{6f}\u{2e}\u{72}\u{65}\u{61}\u{64}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{22}\u{29}\u{a}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{28}\u{22}\u{69}\u{6f}\u{22}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{69}\u{6f}\u{29}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{27}\u{3b}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{79}\u{70}\u{65}\u{28}\u{61}\u{2e}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{22}\u{29}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{27}\u{3b}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{79}\u{70}\u{65}\u{28}\u{61}\u{2e}\u{67}\u{65}\u{74}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{22}\u{29}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{6d}\u{61}\u{74}\u{68}\u{27}\u{3b}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{79}\u{70}\u{65}\u{28}\u{61}\u{2e}\u{73}\u{69}\u{6e}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{22}\u{29}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{73}\u{75}\u{62}\u{28}\u{27}\u{6f}\u{6b}\u{69}\u{6e}\u{61}\u{6d}\u{61}\u{27}\u{2c}\u{20}\u{31}\u{2c}\u{20}\u{32}\u{29}\u{a}")
852+assert((a == "\u{6f}\u{6b}"))
853+T.closestate(L1)
854+;
855+L1=T.newstate()
856+T.loadlib(L1)
857+T.doremote(L1,"\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}")
858+T.testC(L1,"\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{22}\u{61}\u{22}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{78}\u{22}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{33}")
859+assert((T.doremote(L1,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{2e}\u{78}") == "\u{31}"))
860+T.closestate(L1)
861+L1=nil
862+print("\u{2b}")
863+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}")
864+do
865+local openresource = {}
866+local function newresource
867+()
868+local x = setmetatable({0xa},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function (y)
869+assert((openresource[(# openresource)] == y))
870+openresource[(# openresource)]=nil
871+y[0x1]=(y[0x1] + 0x1)
872+end})
873+openresource[(# (openresource + 0x1))]=x
874+return x
875+end
876+local a,b = T.testC("\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{69}\u{6c}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{32}\u{20}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{6e}\u{69}\u{6c}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{28}\u{77}\u{69}\u{6c}\u{6c}\u{20}\u{62}\u{65}\u{20}\u{69}\u{67}\u{6e}\u{6f}\u{72}\u{65}\u{64}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{a}\u{20}\u{20}",newresource)
877+assert(((a[0x1] == 0xb) and (b == nil)))
878+assert((# (openresource == 0x0)))
879+local a = {T.testC("\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{32}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{a}\u{20}\u{20}",newresource)}
880+assert(((type(a[0x1]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (a[0x2][0x1] == 0xb)))
881+assert((# (openresource == 0x0)))
882+local a,b = pcall(T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{20}\u{69}\u{73}\u{20}\u{74}\u{68}\u{65}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{a}\u{20}\u{20}"),newresource)
883+assert(((a == false) and (b[0x1] == 0xb)))
884+assert((# (openresource == 0x0)))
885+local a,b = pcall(T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{6e}\u{65}\u{77}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{6e}\u{6f}\u{6e}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{28}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{72}\u{61}\u{69}\u{73}\u{65}\u{20}\u{61}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{62}\u{6f}\u{72}\u{74}\u{20}\u{20}\u{23}\u{20}\u{77}\u{69}\u{6c}\u{6c}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{65}\u{78}\u{65}\u{63}\u{75}\u{74}\u{65}\u{64}\u{a}\u{20}\u{20}"))
886+assert(((a == false) and string.find(b,"\u{6e}\u{6f}\u{6e}\u{25}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")))
887+local function check
888+(n)
889+assert((# (openresource == n)))
890+end
891+_ENV.xxx=true
892+local a = T.testC("\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{4e}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{3b}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{23}\u{20}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{4e}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{3b}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{32}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{74}\u{77}\u{6f}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{30}\u{20}\u{20}\u{23}\u{20}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{73}\u{6c}\u{6f}\u{74}\u{20}\u{2d}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{6f}\u{6e}\u{65}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{30}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{73}\u{6c}\u{6f}\u{74}\u{20}\u{34}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{22}\u{78}\u{78}\u{78}\u{22}\u{20}\u{20}\u{23}\u{20}\u{70}\u{72}\u{65}\u{76}\u{69}\u{6f}\u{75}\u{73}\u{20}\u{6f}\u{70}\u{2e}\u{20}\u{65}\u{72}\u{61}\u{73}\u{65}\u{64}\u{20}\u{74}\u{68}\u{65}\u{20}\u{73}\u{6c}\u{6f}\u{74}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{20}\u{66}\u{72}\u{6f}\u{6d}\u{20}\u{74}\u{68}\u{65}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{2a}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{a}\u{20}\u{20}",newresource,check)
893+assert(((a == 0x3) and (_ENV.xxx == nil)))
894+local a = T.testC("\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{4e}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{3b}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{23}\u{20}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{4e}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{3b}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{20}\u{23}\u{20}\u{6d}\u{61}\u{72}\u{6b}\u{20}\u{69}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{32}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{74}\u{77}\u{6f}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{30}\u{20}\u{20}\u{23}\u{20}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{6f}\u{6e}\u{65}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{30}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{52}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{20}\u{66}\u{72}\u{6f}\u{6d}\u{20}\u{74}\u{68}\u{65}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{33}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{30}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{68}\u{65}\u{72}\u{65}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{6e}\u{6f}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{6f}\u{75}\u{72}\u{63}\u{65}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{31}\u{20}\u{30}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{3a}\u{20}\u{53}\u{2c}\u{20}\u{4e}\u{52}\u{2c}\u{20}\u{43}\u{48}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{2a}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{a}\u{20}\u{20}",newresource,check)
895+assert((a == 0x3))
896+local a,b = pcall(T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{33}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{2d}\u{31}\u{a}\u{20}\u{20}"))
897+assert((not (a and string.find(b,"\u{28}\u{43}\u{20}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}"))))
898+end
899+print("\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{2d}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}")
900+checkerr("\u{62}\u{6c}\u{6f}\u{63}\u{6b}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{62}\u{69}\u{67}",T.newuserdata,math.maxinteger)
901+collectgarbage()
902+local f = load("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{69}\u{3d}\u{31}\u{2c}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{61}\u{5b}\u{69}\u{5d}\u{3d}\u{69}\u{20}\u{65}\u{6e}\u{64}")
903+T.alloccount(0xa)
904+checkerr(MEMERRMSG,f)
905+T.alloccount()
906+local function testbytes
907+(s,f)
908+collectgarbage()
909+local M = T.totalmem()
910+local oldM = M
911+local a,b = nil
912+while true do
913+collectgarbage()
914+;
915+collectgarbage()
916+T.totalmem(M)
917+a,b=T.testC("\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",f)
918+T.totalmem(0x0)
919+if (a and (b == "\u{4f}\u{4b}")) then
920+break
921+end
922+if ((b ~= "\u{4f}\u{4b}") and (b ~= MEMERRMSG)) then
923+error(a,0x0)
924+end
925+M=(M + 0x7)
926+end
927+print(string.format("\u{6d}\u{69}\u{6e}\u{69}\u{6d}\u{75}\u{6d}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{25}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{20}\u{62}\u{79}\u{74}\u{65}\u{73}",s,(M - oldM)))
928+return a
929+end
930+local function testalloc
931+(s,f)
932+collectgarbage()
933+local M = 0x0
934+local a,b = nil
935+while true do
936+collectgarbage()
937+;
938+collectgarbage()
939+T.alloccount(M)
940+a,b=T.testC("\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{20}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",f)
941+T.alloccount()
942+if (a and (b == "\u{4f}\u{4b}")) then
943+break
944+end
945+if ((b ~= "\u{4f}\u{4b}") and (b ~= MEMERRMSG)) then
946+error(a,0x0)
947+end
948+M=(M + 0x1)
949+end
950+print(string.format("\u{6d}\u{69}\u{6e}\u{69}\u{6d}\u{75}\u{6d}\u{20}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{25}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{20}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{73}",s,M))
951+return a
952+end
953+local function testamem
954+(s,f)
955+testalloc(s,f)
956+return testbytes(s,f)
957+end
958+b=testamem("\u{64}\u{6f}\u{69}\u{6e}\u{67}\u{20}\u{6e}\u{6f}\u{74}\u{68}\u{69}\u{6e}\u{67}",function ()
959+return 0xa
960+end)
961+assert((b == 0xa))
962+testamem("\u{73}\u{74}\u{61}\u{74}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
963+local st = T.newstate()
964+if st then
965+T.closestate(st)
966+end
967+return st
968+end)
969+testamem("\u{65}\u{6d}\u{70}\u{74}\u{79}\u{2d}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
970+return {}
971+end)
972+testamem("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
973+return ("\u{58}\u{58}\u{58}" .. "\u{59}\u{59}\u{59}")
974+end)
975+testamem("\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
976+return coroutine.create(print)
977+end)
978+testamem("\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}",function ()
979+local flag
980+do
981+local x <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
982+flag=true
983+end})
984+flag=false
985+local x = {}
986+end
987+return flag
988+end)
989+local mt = T.testC("\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
990+assert(((type(mt) == "\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}") and (coroutine.running() == mt)))
991+local function expand
992+(n,s)
993+if (n == 0x0) then
994+return ""
995+end
996+local e = string.rep("\u{3d}",n)
997+return string.format("\u{54}\u{2e}\u{64}\u{6f}\u{6f}\u{6e}\u{6e}\u{65}\u{77}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{28}\u{5b}\u{25}\u{73}\u{5b}\u{20}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{28}\u{29}\u{3b}\u{20}\u{25}\u{73}\u{5d}\u{25}\u{73}\u{5d}\u{29}\u{a}",e,s,expand((n - 0x1),s),e)
998+end
999+G=0x0
1000+;
1001+collectgarbage()
1002+;
1003+a=collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
1004+load(expand(0x14,"\u{47}\u{3d}\u{47}\u{2b}\u{31}"))()
1005+assert((G == 0x14))
1006+;
1007+collectgarbage()
1008+;
1009+G=nil
1010+testamem("\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{64}\u{65}\u{20}\u{6f}\u{6e}\u{20}\u{6e}\u{65}\u{77}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}",function ()
1011+return (T.doonnewstack("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{3d}\u{31}") == 0x0)
1012+end)
1013+testamem("\u{6c}\u{6f}\u{61}\u{64}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",function ()
1014+return load("\u{78}\u{3d}\u{31}")
1015+end)
1016+local testprog = "\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{74}\u{20}\u{3d}\u{20}\u{7b}\u{22}\u{78}\u{22}\u{7d}\u{a}\u{41}\u{41}\u{20}\u{3d}\u{20}\u{22}\u{61}\u{61}\u{61}\u{22}\u{a}\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{23}\u{74}\u{20}\u{64}\u{6f}\u{20}\u{41}\u{41}\u{20}\u{3d}\u{20}\u{41}\u{41}\u{20}\u{2e}\u{2e}\u{20}\u{74}\u{5b}\u{69}\u{5d}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{74}\u{72}\u{75}\u{65}\u{a}"
1017+_G.AA=nil
1018+local t = os.tmpname()
1019+local f = assert(io.open(t,"\u{77}"))
1020+f:write(testprog)
1021+f:close()
1022+testamem("\u{64}\u{6f}\u{66}\u{69}\u{6c}\u{65}",function ()
1023+local a = loadfile(t)
1024+return (a and a())
1025+end)
1026+assert(os.remove(t))
1027+assert((_G.AA == "\u{61}\u{61}\u{61}\u{78}"))
1028+testamem("\u{67}\u{73}\u{75}\u{62}",function ()
1029+local a,b = string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{61}\u{29}",function (x)
1030+return (x .. "\u{62}")
1031+end)
1032+return (a == "\u{61}\u{62}\u{6c}\u{6f}\u{20}\u{61}\u{62}\u{6c}\u{6f}")
1033+end)
1034+testamem("\u{64}\u{75}\u{6d}\u{70}\u{2f}\u{75}\u{6e}\u{64}\u{75}\u{6d}\u{70}",function ()
1035+local a = load(testprog)
1036+local b = (a and string.dump(a))
1037+a=(b and load(b))
1038+return (a and a())
1039+end)
1040+_G.AA=nil
1041+local t = os.tmpname()
1042+testamem("\u{66}\u{69}\u{6c}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
1043+local f = assert(io.open(t,"\u{77}"))
1044+assert((not io.open("\u{6e}\u{6f}\u{6d}\u{65}\u{6e}\u{61}\u{6f}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}\u{6e}\u{74}\u{65}")))
1045+io.close(f)
1046+;
1047+return (not loadfile("\u{6e}\u{6f}\u{6d}\u{65}\u{6e}\u{61}\u{6f}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}\u{6e}\u{74}\u{65}"))
1048+end)
1049+assert(os.remove(t))
1050+testamem("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
1051+local a,lim = {},0xa
1052+for i = 0x1, lim
1053+do
1054+a[i]=i
1055+;
1056+a[(i .. "\u{61}")]={}
1057+end
1058+return ((type(a[(lim .. "\u{61}")]) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") and (a[lim] == lim))
1059+end)
1060+testamem("\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{6f}\u{72}\u{73}",function ()
1061+local a = {0xa,0x14,0x1e,0x28,0x32,["\u{61}"] = 0x1,["\u{62}"] = 0x2,["\u{63}"] = 0x3,["\u{64}"] = 0x4,["\u{65}"] = 0x5}
1062+return ((type(a) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") and (a.e == 0x5))
1063+end)
1064+local a = 0x1
1065+local close = nil
1066+testamem("\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6f}\u{6e}",function ()
1067+function close(b)
1068+return function (x)
1069+return (b + x)
1070+end
1071+end
1072+return (close(0x2)(0x4) == 0x6)
1073+end)
1074+testamem("\u{75}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}",function ()
1075+local a = coroutine.wrap(function ()
1076+coroutine.yield(string.rep("\u{61}",0xa))
1077+return {}
1078+end)
1079+assert((string.len(a()) == 0xa))
1080+return a()
1081+end)
1082+do
1083+local lim = 0x64
1084+local a = {}
1085+;
1086+for i = 0x1, lim
1087+do
1088+a[i]="\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
1089+end
1090+testamem("\u{61}\u{75}\u{78}\u{69}\u{6c}\u{69}\u{61}\u{72}\u{79}\u{20}\u{62}\u{75}\u{66}\u{66}\u{65}\u{72}",function ()
1091+return (# (table.concat(a,"\u{2c}") == (((0x14 * lim) + lim) - 0x1)))
1092+end)
1093+end
1094+testamem("\u{67}\u{72}\u{6f}\u{77}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}",function ()
1095+local function foo
1096+(n)
1097+if (n == 0x0) then
1098+return 0x1
1099+else
1100+return (0x1 + foo((n - 0x1)))
1101+end
1102+end
1103+return foo(0x64)
1104+end)
1105+do
1106+local res = T.testC("\u{72}\u{61}\u{77}\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{35}\u{30}\u{30}\u{30}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
1107+assert((res == false))
1108+local L = T.newstate()
1109+T.alloccount(0x0)
1110+res=T.testC(L,"\u{72}\u{61}\u{77}\u{63}\u{68}\u{65}\u{63}\u{6b}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{35}\u{30}\u{30}\u{30}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")
1111+T.alloccount()
1112+T.closestate(L)
1113+assert((res == false))
1114+end
1115+do
1116+local L = T.newstate()
1117+T.alloccount(0x0)
1118+T.closestate(L)
1119+T.alloccount()
1120+end
1121+do
1122+local L = T.newstate()
1123+T.loadlib(L)
1124+local res = T.doremote(L,"\u{20}\u{20}\u{20}\u{20}\u{5f}\u{45}\u{4e}\u{56}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{22}\u{5f}\u{47}\u{22}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{54}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{22}\u{54}\u{22}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{a}\u{20}\u{20}\u{20}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{31}\u{30}\u{30}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{61}\u{5b}\u{69}\u{5d}\u{20}\u{3d}\u{20}\u{27}\u{69}\u{27}\u{20}\u{2e}\u{2e}\u{20}\u{69}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{67}\u{72}\u{6f}\u{77}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{73}\u{74}\u{73}\u{69}\u{7a}\u{65}\u{2c}\u{20}\u{73}\u{74}\u{75}\u{73}\u{65}\u{20}\u{3d}\u{20}\u{54}\u{2e}\u{71}\u{75}\u{65}\u{72}\u{79}\u{73}\u{74}\u{72}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{75}\u{73}\u{65}\u{20}\u{3e}\u{20}\u{31}\u{30}\u{30}\u{30}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{6e}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{6e}\u{20}\u{3e}\u{20}\u{30}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{6e}\u{20}\u{2d}\u{20}\u{31}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{31}\u{38}\u{30}\u{29}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{67}\u{72}\u{6f}\u{77}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{5f}\u{2c}\u{20}\u{73}\u{74}\u{6b}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{3d}\u{20}\u{54}\u{2e}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{6c}\u{65}\u{76}\u{65}\u{6c}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{6b}\u{73}\u{69}\u{7a}\u{65}\u{20}\u{3e}\u{20}\u{31}\u{38}\u{30}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{20}\u{20}\u{20}\u{20}\u{54}\u{2e}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{28}\u{30}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{54}\u{2e}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{63}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{72}\u{65}\u{61}\u{6c}\u{6c}\u{6f}\u{63}\u{61}\u{74}\u{65}\u{64}\u{2c}\u{a}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{73}\u{6f}\u{20}\u{74}\u{68}\u{65}\u{79}\u{20}\u{6b}\u{65}\u{70}\u{74}\u{20}\u{74}\u{68}\u{65}\u{69}\u{72}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{73}\u{20}\u{28}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{28}\u{32}\u{2c}\u{20}\u{54}\u{2e}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{6c}\u{65}\u{76}\u{65}\u{6c}\u{28}\u{29}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{73}\u{74}\u{6b}\u{73}\u{69}\u{7a}\u{65}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{54}\u{2e}\u{71}\u{75}\u{65}\u{72}\u{79}\u{73}\u{74}\u{72}\u{28}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{73}\u{74}\u{73}\u{69}\u{7a}\u{65}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{6f}\u{6b}\u{27}\u{a}\u{20}\u{20}")
1125+assert((res == "\u{6f}\u{6b}"))
1126+T.closestate(L)
1127+end
1128+print("\u{2b}")
1129+local function gsub
1130+(a,b,c)
1131+a,b=T.testC("\u{67}\u{73}\u{75}\u{62}\u{20}\u{32}\u{20}\u{33}\u{20}\u{34}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",a,b,c)
1132+assert((b == 0x5))
1133+return a
1134+end
1135+assert((gsub("\u{61}\u{6c}\u{6f}\u{2e}\u{61}\u{6c}\u{6f}\u{2e}\u{75}\u{68}\u{75}\u{68}\u{2e}","\u{2e}","\u{2f}\u{2f}") == "\u{61}\u{6c}\u{6f}\u{2f}\u{2f}\u{61}\u{6c}\u{6f}\u{2f}\u{2f}\u{75}\u{68}\u{75}\u{68}\u{2f}\u{2f}"))
1136+assert((gsub("\u{61}\u{6c}\u{6f}\u{2e}\u{61}\u{6c}\u{6f}\u{2e}\u{75}\u{68}\u{75}\u{68}\u{2e}","\u{61}\u{6c}\u{6f}","\u{2f}\u{2f}") == "\u{2f}\u{2f}\u{2e}\u{2f}\u{2f}\u{2e}\u{75}\u{68}\u{75}\u{68}\u{2e}"))
1137+assert((gsub("","\u{61}\u{6c}\u{6f}","\u{2f}\u{2f}") == ""))
1138+assert((gsub("\u{2e}\u{2e}\u{2e}","\u{2e}","\u{2f}\u{2e}") == "\u{2f}\u{2e}\u{2f}\u{2e}\u{2f}\u{2e}"))
1139+assert((gsub("\u{2e}\u{2e}\u{2e}","\u{2e}\u{2e}\u{2e}","") == ""))
1140+local mt_xuxu,res,top = T.testC("\u{6e}\u{65}\u{77}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{78}\u{75}\u{78}\u{75}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
1141+assert((((type(mt_xuxu) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") and res) and (top == 0x3)))
1142+local d,res,top = T.testC("\u{6e}\u{65}\u{77}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{78}\u{75}\u{78}\u{75}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
1143+assert(((mt_xuxu == d) and (not (res and (top == 0x3)))))
1144+d,res,top=T.testC("\u{6e}\u{65}\u{77}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{78}\u{75}\u{78}\u{75}\u{31}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}")
1145+assert((((mt_xuxu ~= d) and res) and (top == 0x3)))
1146+x=T.newuserdata(0x0)
1147+;
1148+y=T.newuserdata(0x0)
1149+;
1150+T.testC("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{78}\u{75}\u{78}\u{75}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{52}\u{3b}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{32}",x)
1151+assert((getmetatable(x) == mt_xuxu))
1152+local res1,res2,top = T.testC("\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{2d}\u{31}\u{20}\u{78}\u{75}\u{78}\u{75}\u{a}\u{20}\u{20}\u{20}\u{9}\u{20}\u{9}\u{9}\u{9}\u{20}\u{20}\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{32}\u{20}\u{78}\u{75}\u{78}\u{75}\u{a}\u{9}\u{9}\u{9}\u{9}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{a}\u{9}\u{9}\u{9}\u{9}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",x)
1153+assert(((res1 and res2) and (top == 0x4)))
1154+res1,res2,top=T.testC("\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{2d}\u{31}\u{20}\u{78}\u{75}\u{78}\u{75}\u{31}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{32}\u{20}\u{78}\u{75}\u{78}\u{75}\u{31}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",x)
1155+assert((not (res1 and (not (res2 and (top == 0x4))))))
1156+res1,res2,top=T.testC("\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{2d}\u{31}\u{20}\u{78}\u{75}\u{78}\u{75}\u{32}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{32}\u{20}\u{78}\u{75}\u{78}\u{75}\u{32}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",x)
1157+assert((not (res1 and (not (res2 and (top == 0x4))))))
1158+res1,res2,top=T.testC("\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{2d}\u{31}\u{20}\u{78}\u{75}\u{78}\u{75}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{74}\u{65}\u{73}\u{74}\u{75}\u{64}\u{61}\u{74}\u{61}\u{20}\u{32}\u{20}\u{78}\u{75}\u{78}\u{75}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{a}\u{9}\u{9}\u{9}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",y)
1159+assert((not (res1 and (not (res2 and (top == 0x4))))))
1160+do
1161+local r = debug.getregistry()
1162+assert(((r.xuxu == mt_xuxu) and (r.xuxu1 == d)))
1163+r.xuxu=nil
1164+;
1165+r.xuxu1=nil
1166+end
1167+print("\u{4f}\u{4b}")
desk/res/lua/cycled/attrib.luanew file+431
@@ -0,0 +1,431 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}")
2+assert((require("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") == string))
3+assert((require("\u{6d}\u{61}\u{74}\u{68}") == math))
4+assert((require("\u{74}\u{61}\u{62}\u{6c}\u{65}") == table))
5+assert((require("\u{69}\u{6f}") == io))
6+assert((require("\u{6f}\u{73}") == os))
7+assert((require("\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}") == coroutine))
8+assert((type(package.path) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
9+assert((type(package.cpath) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
10+assert((type(package.loaded) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
11+assert((type(package.preload) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
12+assert((type(package.config) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
13+print(("\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{20}\u{63}\u{6f}\u{6e}\u{66}\u{69}\u{67}\u{3a}\u{20}" .. string.gsub(package.config,"\u{a}","\u{7c}")))
14+do
15+local max = ((_soft and 0x64) or 0x7d0)
16+local t = {}
17+for i = 0x1, max
18+do
19+t[i]=string.rep("\u{3f}",((i % 0xa) + 0x1))
20+end
21+t[(# (t + 0x1))]="\u{3b}"
22+local path = table.concat(t,"\u{3b}")
23+local s,err = package.searchpath("\u{78}\u{75}\u{78}\u{75}",path)
24+assert((not ((s and string.find(err,string.rep("\u{78}\u{75}\u{78}\u{75}",0xa))) and (# (string.gsub(err,"\u{5b}\u{5e}\u{a}\u{5d}","") >= max)))))
25+local path = string.rep("\u{3f}",max)
26+local s,err = package.searchpath("\u{78}\u{75}\u{78}\u{75}",path)
27+assert((not (s and string.find(err,string.rep("\u{78}\u{75}\u{78}\u{75}",max)))))
28+end
29+do
30+local oldpath = package.path
31+package.path={}
32+local s,err = pcall(require,"\u{6e}\u{6f}\u{2d}\u{73}\u{75}\u{63}\u{68}\u{2d}\u{66}\u{69}\u{6c}\u{65}")
33+assert((not (s and string.find(err,"\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{70}\u{61}\u{74}\u{68}"))))
34+package.path=oldpath
35+end
36+do
37+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}")
38+local oldpath = package.path
39+local oldcpath = package.cpath
40+package.path="\u{3f}\u{2e}\u{6c}\u{75}\u{61}\u{3b}\u{3f}\u{2f}\u{3f}"
41+package.cpath="\u{3f}\u{2e}\u{73}\u{6f}\u{3b}\u{3f}\u{2f}\u{69}\u{6e}\u{69}\u{74}"
42+local st,msg = pcall(require,"\u{58}\u{58}\u{58}")
43+local expected = "\u{6d}\u{6f}\u{64}\u{75}\u{6c}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{27}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{6f}\u{75}\u{6e}\u{64}\u{3a}\u{a}\u{9}\u{6e}\u{6f}\u{20}\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{70}\u{72}\u{65}\u{6c}\u{6f}\u{61}\u{64}\u{5b}\u{27}\u{58}\u{58}\u{58}\u{27}\u{5d}\u{a}\u{9}\u{6e}\u{6f}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{2e}\u{6c}\u{75}\u{61}\u{27}\u{a}\u{9}\u{6e}\u{6f}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{2f}\u{58}\u{58}\u{58}\u{27}\u{a}\u{9}\u{6e}\u{6f}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{2e}\u{73}\u{6f}\u{27}\u{a}\u{9}\u{6e}\u{6f}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{2f}\u{69}\u{6e}\u{69}\u{74}\u{27}"
44+assert((msg == expected))
45+package.path=oldpath
46+package.cpath=oldcpath
47+end
48+print("\u{2b}")
49+if (not _port) then
50+local dirsep = string.match(package.config,"\u{5e}\u{28}\u{5b}\u{5e}\u{a}\u{5d}\u{2b}\u{29}\u{a}")
51+local DIR = ("\u{6c}\u{69}\u{62}\u{73}" .. dirsep)
52+local function D
53+(x)
54+local x = string.gsub(x,"\u{2f}",dirsep)
55+return (DIR .. x)
56+end
57+local function DC
58+(x)
59+local ext = (((dirsep == "\u{5c}") and "\u{2e}\u{64}\u{6c}\u{6c}") or "\u{2e}\u{73}\u{6f}")
60+return D((x .. ext))
61+end
62+local function createfiles
63+(files,preextras,posextras)
64+for n,c in pairs(files)
65+do
66+io.output(D(n))
67+io.write(string.format(preextras,n))
68+io.write(c)
69+io.write(string.format(posextras,n))
70+io.close(io.output())
71+end
72+end
73+local function removefiles
74+(files)
75+for n in pairs(files)
76+do
77+os.remove(D(n))
78+end
79+end
80+local files = {["\u{6e}\u{61}\u{6d}\u{65}\u{73}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{64}\u{6f}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{2e}\u{2e}\u{2e}\u{7d}\u{20}\u{65}\u{6e}\u{64}\u{a}",["\u{65}\u{72}\u{72}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{42}\u{20}\u{3d}\u{20}\u{31}\u{35}\u{3b}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{3b}",["\u{73}\u{79}\u{6e}\u{65}\u{72}\u{72}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{42}\u{20}\u{3d}",["\u{41}\u{2e}\u{6c}\u{75}\u{61}"] = "",["\u{42}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{2e}\u{2e}\u{2e}\u{3d}\u{3d}\u{27}\u{42}\u{27}\u{29}\u{3b}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{20}\u{27}\u{41}\u{27}",["\u{41}\u{2e}\u{6c}\u{63}"] = "",["\u{41}"] = "",["\u{4c}"] = "",["\u{58}\u{58}\u{78}\u{58}"] = "",["\u{43}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{6c}\u{6f}\u{61}\u{64}\u{65}\u{64}\u{5b}\u{2e}\u{2e}\u{2e}\u{5d}\u{20}\u{3d}\u{20}\u{32}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{43}\u{27}"}
81+AA=nil
82+local extras = "\u{4e}\u{41}\u{4d}\u{45}\u{20}\u{3d}\u{20}\u{27}\u{25}\u{73}\u{27}\u{a}\u{52}\u{45}\u{51}\u{55}\u{49}\u{52}\u{45}\u{44}\u{20}\u{3d}\u{20}\u{2e}\u{2e}\u{2e}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{41}\u{41}"
83+createfiles(files,"",extras)
84+assert((package.searchpath("\u{43}\u{2e}\u{6c}\u{75}\u{61}",D("\u{3f}"),"","") == D("\u{43}\u{2e}\u{6c}\u{75}\u{61}")))
85+assert((package.searchpath("\u{43}\u{2e}\u{6c}\u{75}\u{61}",D("\u{3f}"),"\u{2e}","\u{2e}") == D("\u{43}\u{2e}\u{6c}\u{75}\u{61}")))
86+assert((package.searchpath("\u{2d}\u{2d}\u{78}\u{2d}",D("\u{3f}"),"\u{2d}","\u{58}") == D("\u{58}\u{58}\u{78}\u{58}")))
87+assert((package.searchpath("\u{2d}\u{2d}\u{2d}\u{78}\u{58}",D("\u{3f}"),"\u{2d}\u{2d}\u{2d}","\u{58}\u{58}") == D("\u{58}\u{58}\u{78}\u{58}")))
88+assert((package.searchpath(D("\u{43}\u{2e}\u{6c}\u{75}\u{61}"),"\u{3f}",dirsep) == D("\u{43}\u{2e}\u{6c}\u{75}\u{61}")))
89+assert((package.searchpath("\u{2e}\u{5c}\u{43}\u{2e}\u{6c}\u{75}\u{61}",D("\u{3f}"),"\u{5c}") == D("\u{2e}\u{2f}\u{43}\u{2e}\u{6c}\u{75}\u{61}")))
90+local oldpath = package.path
91+package.path=string.gsub("\u{44}\u{2f}\u{3f}\u{2e}\u{6c}\u{75}\u{61}\u{3b}\u{44}\u{2f}\u{3f}\u{2e}\u{6c}\u{63}\u{3b}\u{44}\u{2f}\u{3f}\u{3b}\u{44}\u{2f}\u{3f}\u{3f}\u{78}\u{3f}\u{3b}\u{44}\u{2f}\u{4c}","\u{44}\u{2f}",DIR)
92+local try = function (p,n,r,ext)
93+NAME=nil
94+local rr,x = require(p)
95+assert((NAME == n))
96+assert((REQUIRED == p))
97+assert((rr == r))
98+assert((ext == x))
99+end
100+local a = require("\u{6e}\u{61}\u{6d}\u{65}\u{73}")
101+assert(((a[0x1] == "\u{6e}\u{61}\u{6d}\u{65}\u{73}") and (a[0x2] == D("\u{6e}\u{61}\u{6d}\u{65}\u{73}\u{2e}\u{6c}\u{75}\u{61}"))))
102+local st,msg = pcall(require,"\u{65}\u{72}\u{72}")
103+assert((not ((st and string.find(msg,"\u{61}\u{72}\u{69}\u{74}\u{68}\u{6d}\u{65}\u{74}\u{69}\u{63}")) and (B == 0xf))))
104+st,msg=pcall(require,"\u{73}\u{79}\u{6e}\u{65}\u{72}\u{72}")
105+assert((not (st and string.find(msg,"\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{6d}\u{6f}\u{64}\u{75}\u{6c}\u{65}"))))
106+assert((package.searchpath("\u{43}",package.path) == D("\u{43}\u{2e}\u{6c}\u{75}\u{61}")))
107+assert((require("\u{43}") == 0x19))
108+assert((require("\u{43}") == 0x19))
109+AA=nil
110+try("\u{42}","\u{42}\u{2e}\u{6c}\u{75}\u{61}",true,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{42}\u{2e}\u{6c}\u{75}\u{61}")
111+assert(package.loaded.B)
112+assert((require("\u{42}") == true))
113+assert(package.loaded.A)
114+assert((require("\u{43}") == 0x19))
115+package.loaded.A=nil
116+try("\u{42}",nil,true,nil)
117+try("\u{41}","\u{41}\u{2e}\u{6c}\u{75}\u{61}",true,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{41}\u{2e}\u{6c}\u{75}\u{61}")
118+package.loaded.A=nil
119+os.remove(D("\u{41}\u{2e}\u{6c}\u{75}\u{61}"))
120+AA={}
121+try("\u{41}","\u{41}\u{2e}\u{6c}\u{63}",AA,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{41}\u{2e}\u{6c}\u{63}")
122+assert((package.searchpath("\u{41}",package.path) == D("\u{41}\u{2e}\u{6c}\u{63}")))
123+assert((require("\u{41}") == AA))
124+AA=false
125+try("\u{4b}","\u{4c}",false,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{4c}")
126+try("\u{4b}","\u{4c}",false,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{4c}")
127+assert((rawget(_G,"\u{5f}\u{52}\u{45}\u{51}\u{55}\u{49}\u{52}\u{45}\u{44}\u{4e}\u{41}\u{4d}\u{45}") == nil))
128+AA="\u{78}"
129+try("\u{58}","\u{58}\u{58}\u{78}\u{58}",AA,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{58}\u{58}\u{78}\u{58}")
130+removefiles(files)
131+NAME,REQUIRED,AA,B=nil
132+local _G = _G
133+package.path=string.gsub("\u{44}\u{2f}\u{3f}\u{2e}\u{6c}\u{75}\u{61}\u{3b}\u{44}\u{2f}\u{3f}\u{2f}\u{69}\u{6e}\u{69}\u{74}\u{2e}\u{6c}\u{75}\u{61}","\u{44}\u{2f}",DIR)
134+files={["\u{50}\u{31}\u{2f}\u{69}\u{6e}\u{69}\u{74}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{41}\u{41}\u{20}\u{3d}\u{20}\u{31}\u{30}",["\u{50}\u{31}\u{2f}\u{78}\u{75}\u{78}\u{75}\u{2e}\u{6c}\u{75}\u{61}"] = "\u{41}\u{41}\u{20}\u{3d}\u{20}\u{32}\u{30}"}
135+createfiles(files,"\u{5f}\u{45}\u{4e}\u{56}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{a}","\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{5f}\u{45}\u{4e}\u{56}\u{a}")
136+AA=0x0
137+local m,ext = assert(require("\u{50}\u{31}"))
138+assert((ext == "\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{50}\u{31}\u{2f}\u{69}\u{6e}\u{69}\u{74}\u{2e}\u{6c}\u{75}\u{61}"))
139+assert(((AA == 0x0) and (m.AA == 0xa)))
140+assert((require("\u{50}\u{31}") == m))
141+assert((require("\u{50}\u{31}") == m))
142+assert((package.searchpath("\u{50}\u{31}\u{2e}\u{78}\u{75}\u{78}\u{75}",package.path) == D("\u{50}\u{31}\u{2f}\u{78}\u{75}\u{78}\u{75}\u{2e}\u{6c}\u{75}\u{61}")))
143+m.xuxu,ext=assert(require("\u{50}\u{31}\u{2e}\u{78}\u{75}\u{78}\u{75}"))
144+assert(((AA == 0x0) and (m.xuxu.AA == 0x14)))
145+assert((ext == "\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{50}\u{31}\u{2f}\u{78}\u{75}\u{78}\u{75}\u{2e}\u{6c}\u{75}\u{61}"))
146+assert((require("\u{50}\u{31}\u{2e}\u{78}\u{75}\u{78}\u{75}") == m.xuxu))
147+assert((require("\u{50}\u{31}\u{2e}\u{78}\u{75}\u{78}\u{75}") == m.xuxu))
148+assert(((require("\u{50}\u{31}") == m) and (m.AA == 0xa)))
149+removefiles(files)
150+AA=nil
151+package.path=""
152+assert((not pcall(require,"\u{66}\u{69}\u{6c}\u{65}\u{5f}\u{64}\u{6f}\u{65}\u{73}\u{5f}\u{6e}\u{6f}\u{74}\u{5f}\u{65}\u{78}\u{69}\u{73}\u{74}")))
153+package.path="\u{3f}\u{3f}\u{0}\u{3f}"
154+assert((not pcall(require,"\u{66}\u{69}\u{6c}\u{65}\u{5f}\u{64}\u{6f}\u{65}\u{73}\u{5f}\u{6e}\u{6f}\u{74}\u{5f}\u{65}\u{78}\u{69}\u{73}\u{74}\u{31}")))
155+package.path=oldpath
156+local fname = "\u{66}\u{69}\u{6c}\u{65}\u{5f}\u{64}\u{6f}\u{65}\u{73}\u{5f}\u{6e}\u{6f}\u{74}\u{5f}\u{65}\u{78}\u{69}\u{73}\u{74}\u{32}"
157+local m,err = pcall(require,fname)
158+for t in string.gmatch((package.path .. ("\u{3b}" .. package.cpath)),"\u{5b}\u{5e}\u{3b}\u{5d}\u{2b}")
159+do
160+t=string.gsub(t,"\u{3f}",fname)
161+assert(string.find(err,t,0x1,true))
162+end
163+do
164+local searchers = package.searchers
165+package.searchers=0x3
166+local st,msg = pcall(require,"\u{61}")
167+assert((not (st and string.find(msg,"\u{6d}\u{75}\u{73}\u{74}\u{20}\u{62}\u{65}\u{20}\u{61}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}"))))
168+package.searchers=searchers
169+end
170+local function import
171+(...)
172+local f = {...}
173+return function (m)
174+for i = 0x1, (# f)
175+do
176+m[f[i]]=_G[f[i]]
177+end
178+end
179+end
180+assert((not pcall(module,"\u{58}\u{55}\u{58}\u{55}")))
181+local p = ""
182+local st,err,when = package.loadlib(DC("\u{6c}\u{69}\u{62}\u{31}"),"\u{2a}")
183+if (not st) then
184+local f,err,when = package.loadlib("\u{64}\u{6f}\u{6e}\u{6f}\u{74}\u{65}\u{78}\u{69}\u{73}\u{74}",(p .. "\u{78}\u{75}\u{78}\u{75}"))
185+assert((not ((f and (type(err) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (when == "\u{61}\u{62}\u{73}\u{65}\u{6e}\u{74}"))))
186+;
187+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{64}\u{79}\u{6e}\u{61}\u{6d}\u{69}\u{63}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
188+print(err,when)
189+else
190+local f = assert(package.loadlib(DC("\u{6c}\u{69}\u{62}\u{31}"),(p .. "\u{6f}\u{6e}\u{65}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")))
191+local a,b = f(0xf,0x19)
192+assert(((a == 0x19) and (b == 0xf)))
193+f=assert(package.loadlib(DC("\u{6c}\u{69}\u{62}\u{31}"),(p .. "\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{66}\u{75}\u{6e}\u{63}")))
194+assert((f(0xa,0x14) == "\u{31}\u{30}\u{25}\u{32}\u{30}\u{a}"))
195+local f,err,when = package.loadlib(DC("\u{6c}\u{69}\u{62}\u{31}"),(p .. "\u{78}\u{75}\u{78}\u{75}"))
196+assert((not ((f and (type(err) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (when == "\u{69}\u{6e}\u{69}\u{74}"))))
197+f,err,when=package.loadlib("\u{64}\u{6f}\u{6e}\u{6f}\u{74}\u{65}\u{78}\u{69}\u{73}\u{74}",(p .. "\u{78}\u{75}\u{78}\u{75}"))
198+assert((not ((f and (type(err) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (when == "\u{6f}\u{70}\u{65}\u{6e}"))))
199+f=assert(package.loadlib(DC("\u{6c}\u{69}\u{62}\u{31}\u{31}"),(p .. "\u{6c}\u{75}\u{61}\u{6f}\u{70}\u{65}\u{6e}\u{5f}\u{6c}\u{69}\u{62}\u{31}\u{31}")))
200+assert((f() == "\u{65}\u{78}\u{70}\u{6f}\u{72}\u{74}\u{65}\u{64}"))
201+package.cpath=DC("\u{3f}")
202+local lib2,ext = require("\u{6c}\u{69}\u{62}\u{32}\u{2d}\u{76}\u{32}")
203+assert(string.find(ext,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{6c}\u{69}\u{62}\u{32}\u{2d}\u{76}\u{32}",0x1,true))
204+assert(((_ENV.x == "\u{6c}\u{69}\u{62}\u{32}\u{2d}\u{76}\u{32}") and (_ENV.y == DC("\u{6c}\u{69}\u{62}\u{32}\u{2d}\u{76}\u{32}"))))
205+assert((lib2.id("\u{78}") == true))
206+local fs,ext = require("\u{6c}\u{69}\u{62}\u{31}\u{2e}\u{73}\u{75}\u{62}")
207+assert(((_ENV.x == "\u{6c}\u{69}\u{62}\u{31}\u{2e}\u{73}\u{75}\u{62}") and (_ENV.y == DC("\u{6c}\u{69}\u{62}\u{31}"))))
208+assert(string.find(ext,"\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{6c}\u{69}\u{62}\u{31}",0x1,true))
209+assert((fs.id(0x2d) == 0x2d))
210+_ENV.x,_ENV.y=nil
211+end
212+_ENV=_G
213+do
214+local p = package
215+package={}
216+p.preload.pl=function (...)
217+local _ENV = {...}
218+function xuxu(x)
219+return (x + 0x14)
220+end
221+return _ENV
222+end
223+local pl,ext = require("\u{70}\u{6c}")
224+assert((require("\u{70}\u{6c}") == pl))
225+assert((pl.xuxu(0xa) == 0x1e))
226+assert((((pl[0x1] == "\u{70}\u{6c}") and (pl[0x2] == "\u{3a}\u{70}\u{72}\u{65}\u{6c}\u{6f}\u{61}\u{64}\u{3a}")) and (ext == "\u{3a}\u{70}\u{72}\u{65}\u{6c}\u{6f}\u{61}\u{64}\u{3a}")))
227+package=p
228+assert((type(package.path) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
229+end
230+print("\u{2b}")
231+end
232+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{73}\u{73}\u{69}\u{67}\u{6e}\u{6d}\u{65}\u{6e}\u{74}\u{73}\u{2c}\u{20}\u{6c}\u{6f}\u{67}\u{69}\u{63}\u{61}\u{6c}\u{20}\u{6f}\u{70}\u{65}\u{72}\u{61}\u{74}\u{6f}\u{72}\u{73}\u{2c}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{6f}\u{72}\u{73}")
233+local res,res2 = 0x1b
234+local a,b = 0x1,(0x2 + 0x3)
235+assert(((a == 0x1) and (b == 0x5)))
236+a={}
237+local function f
238+()
239+return 0xa,0xb,0xc
240+end
241+a.x,b,a[0x1]=0x1,0x2,f()
242+assert((((a.x == 0x1) and (b == 0x2)) and (a[0x1] == 0xa)))
243+a[f()],b,a[(f() + 0x3)]=f(),a,"\u{78}"
244+assert((((a[0xa] == 0xa) and (b == a)) and (a[0xd] == "\u{78}")))
245+do
246+local f = function (n)
247+local x = {}
248+;
249+for i = 0x1, n
250+do
251+x[i]=i
252+end
253+;
254+return table.unpack(x)
255+end
256+;
257+local a,b,c
258+a,b=0x0,f(0x1)
259+assert(((a == 0x0) and (b == 0x1)))
260+a,b=0x0,f(0x1)
261+assert(((a == 0x0) and (b == 0x1)))
262+a,b,c=0x0,0x5,f(0x4)
263+assert((((a == 0x0) and (b == 0x5)) and (c == 0x1)))
264+a,b,c=0x0,0x5,f(0x0)
265+assert((((a == 0x0) and (b == 0x5)) and (c == nil)))
266+end
267+local a,b,c,d = (0x1 and nil),(0x1 or nil),(0x1 and (nil or 0x1)),0x6
268+assert((not (((a and b) and c) and (d == 0x6))))
269+d=0x14
270+a,b,c,d=f()
271+assert(((((a == 0xa) and (b == 0xb)) and (c == 0xc)) and (d == nil)))
272+a,b=f(),0x1,0x2,0x3,f()
273+assert(((a == 0xa) and (b == 0x1)))
274+assert((((a < b) == false) and ((a > b) == true)))
275+assert(((0xa and 0x2) == 0x2))
276+assert(((0xa or 0x2) == 0xa))
277+assert(((0xa or assert(nil)) == 0xa))
278+assert((not (nil and assert(nil))))
279+assert(((nil or "\u{61}\u{6c}\u{6f}") == "\u{61}\u{6c}\u{6f}"))
280+assert(((nil and 0xa) == nil))
281+assert(((false and 0xa) == false))
282+assert(((true or 0xa) == true))
283+assert(((false or 0xa) == 0xa))
284+assert((false ~= nil))
285+assert((nil ~= false))
286+assert((not (nil == true)))
287+assert((not (not (nil == false))))
288+assert((not (not (0x1 == true))))
289+assert((not (not (a == true))))
290+assert((not (not ((0x6 or nil) == true))))
291+assert((not (not ((nil and 0x38) == false))))
292+assert((not (not ((nil and true) == false))))
293+assert((not (0xa == false)))
294+assert((not ({} == false)))
295+assert((not (0.5 == false)))
296+assert((not ("\u{78}" == false)))
297+assert(({} ~= {}))
298+print("\u{2b}")
299+a={}
300+a[true]=0x14
301+a[false]=0xa
302+assert(((a[(0x1 < 0x2)] == 0x14) and (a[(0x1 > 0x2)] == 0xa)))
303+function f(a)
304+return a
305+end
306+local a = {}
307+for i = 0xbb8, (- 0xbb8), (- 0x1)
308+do
309+a[(i + 0.0)]=i
310+;
311+end
312+a[1e31]="\u{61}\u{6c}\u{6f}"
313+;
314+a[true]=0xa
315+;
316+a[false]=0x14
317+assert((((a[1e31] == "\u{61}\u{6c}\u{6f}") and (a[(not 0x1)] == 0x14)) and (a[(0xa < 0x14)] == 0xa)))
318+for i = 0xbb8, (- 0xbb8), (- 0x1)
319+do
320+assert((a[i] == i))
321+;
322+end
323+a[print]=assert
324+a[f]=print
325+a[a]=a
326+assert((a[a][a][a][a][print] == assert))
327+a[print]((a[a[f]] == a[print]))
328+assert((not pcall(function ()
329+local a = {}
330+;
331+a[nil]=0xa
332+end)))
333+assert((not pcall(function ()
334+local a = {[nil] = 0xa}
335+end)))
336+assert((a[nil] == undef))
337+a=nil
338+local a,b,c
339+a={0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,[(- 0x3)] = "\u{61}",[f] = print,["\u{61}"] = "\u{61}",["\u{62}"] = "\u{61}\u{62}"}
340+a,a.x,a.y=a,a[(- 0x3)]
341+assert((((((a[0x1] == 0xa) and (a[(- 0x3)] == a.a)) and (a[f] == print)) and (a.x == "\u{61}")) and (not a.y)))
342+a[0x1],f(a)[0x2],b,c={["\u{61}\u{6c}\u{6f}"] = assert},0xa,a[0x1],a[f],0x6,0xa,0x17,f(a),0x2
343+a[0x1].alo((((a[0x2] == 0xa) and (b == 0xa)) and (c == print)))
344+a.aVeryLongName012345678901234567890123456789012345678901234567890123456789=0xa
345+local function foo
346+()
347+return a.aVeryLongName012345678901234567890123456789012345678901234567890123456789
348+end
349+assert(((foo() == 0xa) and (a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 == 0xa)))
350+do
351+local function foo
352+()
353+local _ENV <const> = 0xb
354+X="\u{68}\u{69}"
355+end
356+local st,msg = pcall(foo)
357+assert((not (st and string.find(msg,"\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
358+end
359+local maxint = math.maxinteger
360+while ((maxint ~= (maxint + 0.0)) or ((maxint - 0x1) ~= (maxint - 1.0))) do
361+maxint=(maxint // 0x2)
362+end
363+local maxintF = (maxint + 0.0)
364+assert((((maxintF == maxint) and (math.type(maxintF) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")) and (maxintF >= (2.0 ^ 0xe))))
365+a[maxintF]=0xa
366+;
367+a[(maxintF - 1.0)]=0xb
368+;
369+a[(- maxintF)]=0xc
370+;
371+a[(- (maxintF + 1.0))]=0xd
372+;
373+assert(((((a[maxint] == 0xa) and (a[(maxint - 0x1)] == 0xb)) and (a[(- maxint)] == 0xc)) and (a[(- (maxint + 0x1))] == 0xd)))
374+a[maxint]=0x14
375+a[(- maxint)]=0x16
376+assert(((((a[maxintF] == 0x14) and (a[(maxintF - 1.0)] == 0xb)) and (a[(- maxintF)] == 0x16)) and (a[(- (maxintF + 1.0))] == 0xd)))
377+a=nil
378+do
379+local a,i,j,b
380+a={"\u{61}","\u{62}"}
381+;
382+i=0x1
383+;
384+j=0x2
385+;
386+b=a
387+i,a[i],a,j,a[j],a[(i + j)]=j,i,i,b,j,i
388+assert(((((((i == 0x2) and (b[0x1] == 0x1)) and (a == 0x1)) and (j == b)) and (b[0x2] == 0x2)) and (b[0x3] == 0x1)))
389+a={}
390+local function foo
391+()
392+b,a.x,a=a,0xa,0x14
393+end
394+foo()
395+assert(((a == 0x14) and (b.x == 0xa)))
396+end
397+do
398+local a,i,j,b
399+a={"\u{61}","\u{62}"}
400+;
401+i=0x1
402+;
403+j=0x2
404+;
405+b=a
406+local function foo
407+()
408+i,a[i],a,j,a[j],a[(i + j)]=j,i,i,b,j,i
409+end
410+foo()
411+assert(((((((i == 0x2) and (b[0x1] == 0x1)) and (a == 0x1)) and (j == b)) and (b[0x2] == 0x2)) and (b[0x3] == 0x1)))
412+local t = {}
413+(function (a)
414+t[a],a=0xa,0x14
415+end)(0x1)
416+;
417+assert((t[0x1] == 0xa))
418+end
419+local function foo
420+()
421+local a
422+return function ()
423+local b
424+a,b=0x3,0xe
425+return a,b
426+end
427+end
428+local a,b = foo()()
429+assert(((a == 0x3) and (b == 0xe)))
430+print("\u{4f}\u{4b}")
431+return res
desk/res/lua/cycled/bar.luanew file+2
@@ -0,0 +1,2 @@
1+assert((0xa .. (0x14 .. (- (0x1e == "\u{31}\u{30}\u{32}\u{30}\u{2d}\u{33}\u{30}")))))
2+x=(- (0x2 ^ (- (0x3 ^ 0x4))))
desk/res/lua/cycled/big.luanew file+67
@@ -0,0 +1,67 @@
1+if _soft then
2+return "\u{61}"
3+end
4+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}")
5+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
6+local lim = ((0x2 ^ 0x12) + 0x3e8)
7+local prog = {"\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{79}\u{20}\u{3d}\u{20}\u{7b}\u{30}"}
8+for i = 0x1, lim
9+do
10+prog[(# (prog + 0x1))]=i
11+end
12+prog[(# (prog + 0x1))]="\u{7d}\u{a}"
13+prog[(# (prog + 0x1))]="\u{58}\u{20}\u{3d}\u{20}\u{79}\u{a}"
14+prog[(# (prog + 0x1))]=("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{58}\u{5b}\u{25}\u{64}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{25}\u{64}\u{29}"):format((lim - 0x1),(lim - 0x2))
15+prog[(# (prog + 0x1))]="\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{30}"
16+prog=table.concat(prog,"\u{3b}")
17+local env = {["\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"] = string,["\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}"] = assert}
18+local f = assert(load(prog,nil,nil,env))
19+f()
20+assert(((env.X[lim] == (lim - 0x1)) and (env.X[(lim + 0x1)] == lim)))
21+for k in pairs(env)
22+do
23+env[k]=undef
24+end
25+setmetatable(env,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,n)
26+coroutine.yield("\u{67}")
27+;
28+return _G[n]
29+end,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,n,v)
30+coroutine.yield("\u{73}")
31+;
32+_G[n]=v
33+end})
34+X=nil
35+local co = coroutine.wrap(f)
36+assert((co() == "\u{73}"))
37+assert((co() == "\u{67}"))
38+assert((co() == "\u{67}"))
39+assert((co() == 0x0))
40+assert(((X[lim] == (lim - 0x1)) and (X[(lim + 0x1)] == lim)))
41+getmetatable(env).__index=function ()
42+
43+end
44+getmetatable(env).__newindex=function ()
45+
46+end
47+local e,m = pcall(f)
48+assert((not (e and m:find("\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{58}\u{27}"))))
49+getmetatable(env).__newindex=function ()
50+error("\u{68}\u{69}")
51+end
52+local e,m = xpcall(f,debug.traceback)
53+assert((not (e and m:find("\u{27}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{27}"))))
54+f,X=nil
55+coroutine.yield("\u{62}")
56+if ((0x2 ^ 0x20) == 0x0) then
57+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")
58+local repstrings = 0xc0
59+local ssize = (math.ceil(((2.0 ^ 0x20) / repstrings)) + 0x1)
60+assert(((repstrings * ssize) > (2.0 ^ 0x20)))
61+local longs = string.rep("\u{0}",ssize)
62+local rep = assert(load(("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{2e}\u{2e}\u{2e}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. string.rep("\u{61}",repstrings,"\u{2e}\u{2e}"))))
63+local a,b = pcall(rep,longs)
64+assert((not (a and string.find(b,"\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))))
65+end
66+print("\u{4f}\u{4b}")
67+return "\u{61}"
desk/res/lua/cycled/bitwise.luanew file+309
@@ -0,0 +1,309 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{62}\u{69}\u{74}\u{77}\u{69}\u{73}\u{65}\u{20}\u{6f}\u{70}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{73}")
2+require("\u{62}\u{77}\u{63}\u{6f}\u{65}\u{72}\u{63}\u{69}\u{6f}\u{6e}")
3+local numbits = (string.packsize("\u{6a}") * 0x8)
4+assert((~ (0x0 == (- 0x1))))
5+assert(((0x1 << (numbits - 0x1)) == math.mininteger))
6+local a,b,c,d
7+a=0xffffffffffffffff
8+assert((a == (- (0x1 and (a & (- ((0x1 == a) and ((a & 0x23) == 0x23))))))))
9+a=0xf0f0f0f0f0f0f0f0
10+assert((a | (- (0x1 == (- 0x1)))))
11+assert(((((a ~ a) == 0x0) and ((a ~ 0x0) == a)) and (a ~ (~ (a == (- 0x1))))))
12+assert(((a >> 0x4) == (~ a)))
13+a=0xf0
14+;
15+b=0xcc
16+;
17+c=0xaa
18+;
19+d=0xfd
20+assert(((a | (b ~ (c & d))) == 0xf4))
21+a=240.0
22+;
23+b=204.0
24+;
25+c="\u{30}\u{78}\u{41}\u{41}\u{2e}\u{30}"
26+;
27+d="\u{30}\u{78}\u{46}\u{44}\u{2e}\u{30}"
28+assert(((a | (b ~ (c & d))) == 0xf4))
29+a=0xf0000000
30+;
31+b=0xcc000000
32+;
33+c=0xaa000000
34+;
35+d=0xfd000000
36+assert(((a | (b ~ (c & d))) == 0xf4000000))
37+assert((~ (~ ((a == a) and (~ (a == (- ((0x1 ~ a) and (- (d == (~ (d + 0x1))))))))))))
38+a=(a << 0x20)
39+b=(b << 0x20)
40+c=(c << 0x20)
41+d=(d << 0x20)
42+assert(((a | (b ~ (c & d))) == (0xf4000000 << 0x20)))
43+assert((~ (~ ((a == a) and (~ (a == (- ((0x1 ~ a) and (- (d == (~ (d + 0x1))))))))))))
44+do
45+local code = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2d}\u{31}\u{20}\u{3e}\u{3e}\u{20}\u{25}\u{64}",math.maxinteger)
46+assert((load(code)() == 0x0))
47+local code = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2d}\u{31}\u{20}\u{3e}\u{3e}\u{20}\u{25}\u{64}",math.mininteger)
48+assert((load(code)() == 0x0))
49+local code = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2d}\u{31}\u{20}\u{3c}\u{3c}\u{20}\u{25}\u{64}",math.maxinteger)
50+assert((load(code)() == 0x0))
51+local code = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2d}\u{31}\u{20}\u{3c}\u{3c}\u{20}\u{25}\u{64}",math.mininteger)
52+assert((load(code)() == 0x0))
53+end
54+assert((- (((0x1 >> 0x1) == ((0x1 << (numbits - 0x1)) - 0x1)) and ((0x1 << 0x1f) == 0x80000000))))
55+assert((- ((0x1 >> (numbits - 0x1)) == 0x1)))
56+assert((- (((0x1 >> numbits) == 0x0) and (- (0x1 >> (- ((numbits == 0x0) and (- (((0x1 << numbits) == 0x0) and (- (0x1 << (- (numbits == 0x0)))))))))))))
57+assert(((0x1 >> math.mininteger) == 0x0))
58+assert(((0x1 >> math.maxinteger) == 0x0))
59+assert(((0x1 << math.mininteger) == 0x0))
60+assert(((0x1 << math.maxinteger) == 0x0))
61+assert(((((0x2 ^ 0x1e) - 0x1) << (0x2 ^ 0x1e)) == 0x0))
62+assert(((((0x2 ^ 0x1e) - 0x1) >> (0x2 ^ 0x1e)) == 0x0))
63+assert((0x1 >> (- ((0x3 == (0x1 << 0x3)) and ((0x3e8 >> 0x5) == (0x3e8 << (- 0x5)))))))
64+assert((("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}" | 0x0) == (- 0x1)))
65+assert((("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{65}" & "\u{2d}\u{31}") == (- 0x2)))
66+assert((("\u{20}\u{9}\u{2d}\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{65}\u{a}\u{9}" & "\u{2d}\u{31}") == 0x2))
67+assert((("\u{20}\u{20}\u{20}\u{a}\u{20}\u{20}\u{2d}\u{34}\u{35}\u{20}\u{20}\u{9}\u{20}" >> "\u{20}\u{20}\u{2d}\u{32}\u{20}\u{20}") == (- (0x2d * 0x4))))
68+assert((("\u{31}\u{32}\u{33}\u{34}\u{2e}\u{30}" << "\u{35}\u{2e}\u{30}") == (0x4d2 * 0x20)))
69+assert((("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{2e}\u{30}" ~ "\u{30}\u{78}\u{41}\u{41}\u{41}\u{41}") == 0x5555))
70+assert((~ ("\u{30}\u{78}\u{30}\u{2e}\u{30}\u{30}\u{30}\u{70}\u{34}" == (- 0x1))))
71+assert(((("\u{37}" .. 0x3) << 0x1) == 0x92))
72+assert(((0xffffffff >> (0x1 .. "\u{39}")) == 0x1fff))
73+assert(((0xa | (0x1 .. "\u{39}")) == 0x1b))
74+do
75+local st,msg = pcall(function ()
76+return (0x4 & "\u{61}")
77+end)
78+assert(string.find(msg,"\u{27}\u{62}\u{61}\u{6e}\u{64}\u{27}"))
79+local st,msg = pcall(function ()
80+return (~ "\u{61}")
81+end)
82+assert(string.find(msg,"\u{27}\u{62}\u{6e}\u{6f}\u{74}\u{27}"))
83+end
84+assert((not pcall(function ()
85+return ("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{2e}\u{30}" | 0x0)
86+end)))
87+assert((not pcall(function ()
88+return ("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{0}" | 0x0)
89+end)))
90+print("\u{2b}")
91+package.preload.bit32=function ()
92+local bit = {}
93+function bit.bnot(a)
94+return (~ (a & 0xffffffff))
95+end
96+function bit.band(x,y,z, ...)
97+if (not z) then
98+return (((x or (- 0x1)) & (y or (- 0x1))) & 0xffffffff)
99+else
100+local arg = {...}
101+local res = ((x & y) & z)
102+for i = 0x1, (# arg)
103+do
104+res=(res & arg[i])
105+end
106+return (res & 0xffffffff)
107+end
108+end
109+function bit.bor(x,y,z, ...)
110+if (not z) then
111+return (((x or 0x0) | (y or 0x0)) & 0xffffffff)
112+else
113+local arg = {...}
114+local res = ((x | y) | z)
115+for i = 0x1, (# arg)
116+do
117+res=(res | arg[i])
118+end
119+return (res & 0xffffffff)
120+end
121+end
122+function bit.bxor(x,y,z, ...)
123+if (not z) then
124+return (((x or 0x0) ~ (y or 0x0)) & 0xffffffff)
125+else
126+local arg = {...}
127+local res = ((x ~ y) ~ z)
128+for i = 0x1, (# arg)
129+do
130+res=(res ~ arg[i])
131+end
132+return (res & 0xffffffff)
133+end
134+end
135+function bit.btest(...)
136+return (bit.band(...) ~= 0x0)
137+end
138+function bit.lshift(a,b)
139+return (((a & 0xffffffff) << b) & 0xffffffff)
140+end
141+function bit.rshift(a,b)
142+return (((a & 0xffffffff) >> b) & 0xffffffff)
143+end
144+function bit.arshift(a,b)
145+a=(a & 0xffffffff)
146+if ((b <= 0x0) or ((a & 0x80000000) == 0x0)) then
147+return ((a >> b) & 0xffffffff)
148+else
149+return (((a >> b) | (~ (0xffffffff >> b))) & 0xffffffff)
150+end
151+end
152+function bit.lrotate(a,b)
153+b=(b & 0x1f)
154+a=(a & 0xffffffff)
155+a=((a << b) | (a >> (0x20 - b)))
156+return (a & 0xffffffff)
157+end
158+function bit.rrotate(a,b)
159+return bit.lrotate(a,(- b))
160+end
161+local function checkfield
162+(f,w)
163+w=(w or 0x1)
164+assert((f >= 0x0),"\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{6e}\u{65}\u{67}\u{61}\u{74}\u{69}\u{76}\u{65}")
165+assert((w > 0x0),"\u{77}\u{69}\u{64}\u{74}\u{68}\u{20}\u{6d}\u{75}\u{73}\u{74}\u{20}\u{62}\u{65}\u{20}\u{70}\u{6f}\u{73}\u{69}\u{74}\u{69}\u{76}\u{65}")
166+assert(((f + w) <= 0x20),"\u{74}\u{72}\u{79}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{6f}\u{20}\u{61}\u{63}\u{63}\u{65}\u{73}\u{73}\u{20}\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}\u{6e}\u{74}\u{20}\u{62}\u{69}\u{74}\u{73}")
167+return f,(~ (- (0x1 << w)))
168+end
169+function bit.extract(a,f,w)
170+local f,mask = checkfield(f,w)
171+return ((a >> f) & mask)
172+end
173+function bit.replace(a,v,f,w)
174+local f,mask = checkfield(f,w)
175+v=(v & mask)
176+a=((a & (~ (mask << f))) | (v << f))
177+return (a & 0xffffffff)
178+end
179+return bit
180+end
181+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{62}\u{69}\u{74}\u{77}\u{69}\u{73}\u{65}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}")
182+local bit32 = require("\u{62}\u{69}\u{74}\u{33}\u{32}")
183+assert((bit32.band() == bit32.bnot(0x0)))
184+assert((bit32.btest() == true))
185+assert((bit32.bor() == 0x0))
186+assert((bit32.bxor() == 0x0))
187+assert((bit32.band() == bit32.band(0xffffffff)))
188+assert((bit32.band(0x1,0x2) == 0x0))
189+assert((bit32.band((- 0x1)) == 0xffffffff))
190+assert((bit32.band(((0x1 << 0x21) - 0x1)) == 0xffffffff))
191+assert((bit32.band((- ((0x1 << 0x21) - 0x1))) == 0xffffffff))
192+assert((bit32.band(((0x1 << 0x21) + 0x1)) == 0x1))
193+assert((bit32.band((- ((0x1 << 0x21) + 0x1))) == 0x1))
194+assert((bit32.band((- (0x1 << 0x28))) == 0x0))
195+assert((bit32.band((0x1 << 0x28)) == 0x0))
196+assert((bit32.band((- ((0x1 << 0x28) - 0x2))) == 0xfffffffe))
197+assert((bit32.band(((0x1 << 0x28) - 0x4)) == 0xfffffffc))
198+assert((bit32.lrotate(0x0,(- 0x1)) == 0x0))
199+assert((bit32.lrotate(0x0,0x7) == 0x0))
200+assert((bit32.lrotate(0x12345678,0x0) == 0x12345678))
201+assert((bit32.lrotate(0x12345678,0x20) == 0x12345678))
202+assert((bit32.lrotate(0x12345678,0x4) == 0x23456781))
203+assert((bit32.rrotate(0x12345678,(- 0x4)) == 0x23456781))
204+assert((bit32.lrotate(0x12345678,(- 0x8)) == 0x78123456))
205+assert((bit32.rrotate(0x12345678,0x8) == 0x78123456))
206+assert((bit32.lrotate(0xaaaaaaaa,0x2) == 0xaaaaaaaa))
207+assert((bit32.lrotate(0xaaaaaaaa,(- 0x2)) == 0xaaaaaaaa))
208+for i = (- 0x32), 0x32
209+do
210+assert((bit32.lrotate(0x89abcdef,i) == bit32.lrotate(0x89abcdef,(i % 0x20))))
211+end
212+assert((bit32.lshift(0x12345678,0x4) == 0x23456780))
213+assert((bit32.lshift(0x12345678,0x8) == 0x34567800))
214+assert((bit32.lshift(0x12345678,(- 0x4)) == 0x1234567))
215+assert((bit32.lshift(0x12345678,(- 0x8)) == 0x123456))
216+assert((bit32.lshift(0x12345678,0x20) == 0x0))
217+assert((bit32.lshift(0x12345678,(- 0x20)) == 0x0))
218+assert((bit32.rshift(0x12345678,0x4) == 0x1234567))
219+assert((bit32.rshift(0x12345678,0x8) == 0x123456))
220+assert((bit32.rshift(0x12345678,0x20) == 0x0))
221+assert((bit32.rshift(0x12345678,(- 0x20)) == 0x0))
222+assert((bit32.arshift(0x12345678,0x0) == 0x12345678))
223+assert((bit32.arshift(0x12345678,0x1) == (0x12345678 // 0x2)))
224+assert((bit32.arshift(0x12345678,(- 0x1)) == (0x12345678 * 0x2)))
225+assert((bit32.arshift((- 0x1),0x1) == 0xffffffff))
226+assert((bit32.arshift((- 0x1),0x18) == 0xffffffff))
227+assert((bit32.arshift((- 0x1),0x20) == 0xffffffff))
228+assert((bit32.arshift((- 0x1),(- 0x1)) == bit32.band((- (0x1 * 0x2)),0xffffffff)))
229+assert(((0x12345678 << 0x4) == 0x123456780))
230+assert(((0x12345678 << 0x8) == 0x1234567800))
231+assert((0x12345678 << (- (0x4 == 0x1234567))))
232+assert((0x12345678 << (- (0x8 == 0x123456))))
233+assert(((0x12345678 << 0x20) == 0x1234567800000000))
234+assert((0x12345678 << (- (0x20 == 0x0))))
235+assert(((0x12345678 >> 0x4) == 0x1234567))
236+assert(((0x12345678 >> 0x8) == 0x123456))
237+assert(((0x12345678 >> 0x20) == 0x0))
238+assert((0x12345678 >> (- (0x20 == 0x1234567800000000))))
239+print("\u{2b}")
240+local c = {0x0,0x1,0x2,0x3,0xa,0x80000000,0xaaaaaaaa,0x55555555,0xffffffff,0x7fffffff}
241+for _,b in pairs(c)
242+do
243+assert((bit32.band(b) == b))
244+assert((bit32.band(b,b) == b))
245+assert((bit32.band(b,b,b,b) == b))
246+assert((bit32.btest(b,b) == (b ~= 0x0)))
247+assert((bit32.band(b,b,b) == b))
248+assert((bit32.band(b,b,b,(~ b)) == 0x0))
249+assert((bit32.btest(b,b,b) == (b ~= 0x0)))
250+assert((bit32.band(b,bit32.bnot(b)) == 0x0))
251+assert((bit32.bor(b,bit32.bnot(b)) == bit32.bnot(0x0)))
252+assert((bit32.bor(b) == b))
253+assert((bit32.bor(b,b) == b))
254+assert((bit32.bor(b,b,b) == b))
255+assert((bit32.bor(b,b,0x0,(~ b)) == 0xffffffff))
256+assert((bit32.bxor(b) == b))
257+assert((bit32.bxor(b,b) == 0x0))
258+assert((bit32.bxor(b,b,b) == b))
259+assert((bit32.bxor(b,b,b,b) == 0x0))
260+assert((bit32.bxor(b,0x0) == b))
261+assert((bit32.bnot(b) ~= b))
262+assert((bit32.bnot(bit32.bnot(b)) == b))
263+assert((bit32.bnot(b) == (((0x1 << 0x20) - 0x1) - b)))
264+assert((bit32.lrotate(b,0x20) == b))
265+assert((bit32.rrotate(b,0x20) == b))
266+assert((bit32.lshift(bit32.lshift(b,(- 0x4)),0x4) == bit32.band(b,bit32.bnot(0xf))))
267+assert((bit32.rshift(bit32.rshift(b,0x4),(- 0x4)) == bit32.band(b,bit32.bnot(0xf))))
268+end
269+c={0x0,0x1,0x2,0x3,0xa,0x800000,0xaaaaaa,0x555555,0xffffff,0x7fffff}
270+for _,b in pairs(c)
271+do
272+for i = (- 0x28), 0x28
273+do
274+local x = bit32.lshift(b,i)
275+local y = math.floor(math.fmod((b * (2.0 ^ i)),(2.0 ^ 0x20)))
276+assert((math.fmod((x - y),(2.0 ^ 0x20)) == 0x0))
277+end
278+end
279+assert((not pcall(bit32.band,{})))
280+assert((not pcall(bit32.bnot,"\u{61}")))
281+assert((not pcall(bit32.lshift,0x2d)))
282+assert((not pcall(bit32.lshift,0x2d,print)))
283+assert((not pcall(bit32.rshift,0x2d,print)))
284+print("\u{2b}")
285+assert((bit32.extract(0x12345678,0x0,0x4) == 0x8))
286+assert((bit32.extract(0x12345678,0x4,0x4) == 0x7))
287+assert((bit32.extract(0xa0001111,0x1c,0x4) == 0xa))
288+assert((bit32.extract(0xa0001111,0x1f,0x1) == 0x1))
289+assert((bit32.extract(0x50000111,0x1f,0x1) == 0x0))
290+assert((bit32.extract(0xf2345679,0x0,0x20) == 0xf2345679))
291+assert((not pcall(bit32.extract,0x0,(- 0x1))))
292+assert((not pcall(bit32.extract,0x0,0x20)))
293+assert((not pcall(bit32.extract,0x0,0x0,0x21)))
294+assert((not pcall(bit32.extract,0x0,0x1f,0x2)))
295+assert((bit32.replace(0x12345678,0x5,0x1c,0x4) == 0x52345678))
296+assert((bit32.replace(0x12345678,0x87654321,0x0,0x20) == 0x87654321))
297+assert((bit32.replace(0x0,0x1,0x2) == (0x2 ^ 0x2)))
298+assert((bit32.replace(0x0,(- 0x1),0x4) == (0x2 ^ 0x4)))
299+assert((bit32.replace((- 0x1),0x0,0x1f) == ((0x1 << 0x1f) - 0x1)))
300+assert((bit32.replace((- 0x1),0x0,0x1,0x2) == ((0x1 << 0x20) - 0x7)))
301+assert((bit32.bor(3.0) == 0x3))
302+assert((bit32.bor((- 4.0)) == 0xfffffffc))
303+if (((2.0 ^ 0x32) < ((2.0 ^ 0x32) + 1.0)) and ((2.0 ^ 0x32) < (- (0x1 >> 0x1)))) then
304+assert((bit32.bor(((2.0 ^ 0x20) - 5.0)) == 0xfffffffb))
305+assert((bit32.bor((- ((2.0 ^ 0x20) - 6.0))) == 0xfffffffa))
306+assert((bit32.bor(((2.0 ^ 0x30) - 5.0)) == 0xfffffffb))
307+assert((bit32.bor((- ((2.0 ^ 0x30) - 6.0))) == 0xfffffffa))
308+end
309+print("\u{4f}\u{4b}")
desk/res/lua/cycled/bwcoercion.luanew file+59
@@ -0,0 +1,59 @@
1+local tonumber,tointeger = tonumber,math.tointeger
2+local type,getmetatable,rawget,error = type,getmetatable,rawget,error
3+local strsub = string.sub
4+local print = print
5+_ENV=nil
6+local function toint
7+(x)
8+x=tonumber(x)
9+if (not x) then
10+return false
11+end
12+return tointeger(x)
13+end
14+local function trymt
15+(x,y,mtname)
16+if (type(y) ~= "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") then
17+local mt = getmetatable(y)
18+local mm = (mt and rawget(mt,mtname))
19+if mm then
20+return mm(x,y)
21+end
22+end
23+error(("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{27}" .. (strsub(mtname,0x3) .. ("\u{27}\u{20}\u{61}\u{20}" .. (type(x) .. ("\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{61}\u{20}" .. type(y)))))),0x4)
24+end
25+local function checkargs
26+(x,y,mtname)
27+local xi = toint(x)
28+local yi = toint(y)
29+if (xi and yi) then
30+return xi,yi
31+else
32+return trymt(x,y,mtname),nil
33+end
34+end
35+local smt = getmetatable("")
36+smt.__band=function (x,y)
37+local x,y = checkargs(x,y,"\u{5f}\u{5f}\u{62}\u{61}\u{6e}\u{64}")
38+return ((y and (x & y)) or x)
39+end
40+smt.__bor=function (x,y)
41+local x,y = checkargs(x,y,"\u{5f}\u{5f}\u{62}\u{6f}\u{72}")
42+return ((y and (x | y)) or x)
43+end
44+smt.__bxor=function (x,y)
45+local x,y = checkargs(x,y,"\u{5f}\u{5f}\u{62}\u{78}\u{6f}\u{72}")
46+return ((y and (x ~ y)) or x)
47+end
48+smt.__shl=function (x,y)
49+local x,y = checkargs(x,y,"\u{5f}\u{5f}\u{73}\u{68}\u{6c}")
50+return ((y and (x << y)) or x)
51+end
52+smt.__shr=function (x,y)
53+local x,y = checkargs(x,y,"\u{5f}\u{5f}\u{73}\u{68}\u{72}")
54+return ((y and (x >> y)) or x)
55+end
56+smt.__bnot=function (x)
57+local x,y = checkargs(x,x,"\u{5f}\u{5f}\u{62}\u{6e}\u{6f}\u{74}")
58+return (y and (~ (x or x)))
59+end
desk/res/lua/cycled/calls.luanew file+492
@@ -0,0 +1,492 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+assert((type((0x1 < 0x2)) == "\u{62}\u{6f}\u{6f}\u{6c}\u{65}\u{61}\u{6e}"))
4+assert(((type(true) == "\u{62}\u{6f}\u{6f}\u{6c}\u{65}\u{61}\u{6e}") and (type(false) == "\u{62}\u{6f}\u{6f}\u{6c}\u{65}\u{61}\u{6e}")))
5+assert((((((type(nil) == "\u{6e}\u{69}\u{6c}") and (type((- 0x3)) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")) and (type("\u{78}") == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type({}) == "\u{74}\u{61}\u{62}\u{6c}\u{65}")) and (type(type) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")))
6+assert((type(assert) == type(print)))
7+local function f
8+(x)
9+return a:x(x)
10+end
11+assert((type(f) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}"))
12+assert((not pcall(type)))
13+fact=false
14+do
15+local res = 0x1
16+local function fact
17+(n)
18+if (n == 0x0) then
19+return res
20+else
21+return (n * fact((n - 0x1)))
22+end
23+end
24+assert((fact(0x5) == 0x78))
25+end
26+assert((fact == false))
27+fact=nil
28+local a = {["\u{69}"] = 0xa}
29+local self = 0x14
30+function a:x(x)
31+return (x + self.i)
32+end
33+function a.y(x)
34+return (x + self)
35+end
36+assert(((a:x(0x1) + 0xa) == a.y(0x1)))
37+a.t={["\u{69}"] = (- 0x64)}
38+a["\u{74}"].x=function (self,a,b)
39+return ((self.i + a) + b)
40+end
41+assert((a.t:x(0x2,0x3) == (- 0x5f)))
42+do
43+local a = {["\u{78}"] = 0x0}
44+function a:add(x)
45+self.x,a.y=(self.x + x),0x14
46+;
47+return self
48+end
49+assert(((a:add(0xa):add(0x14):add(0x1e).x == 0x3c) and (a.y == 0x14)))
50+end
51+local a = {["\u{62}"] = {["\u{63}"] = {}}}
52+function a.b.c.f1(x)
53+return (x + 0x1)
54+end
55+function a.b.c:f2(x,y)
56+self[x]=y
57+end
58+assert((a.b.c.f1(0x4) == 0x5))
59+a.b.c:f2("\u{6b}",0xc)
60+;
61+assert((a.b.c.k == 0xc))
62+print("\u{2b}")
63+t=nil
64+function f(a,b,c)
65+local d = "\u{61}"
66+;
67+t={a,b,c,d}
68+end
69+f(0x1,0x2)
70+assert(((((t[0x1] == 0x1) and (t[0x2] == 0x2)) and (t[0x3] == nil)) and (t[0x4] == "\u{61}")))
71+f(0x1,0x2,0x3,0x4)
72+assert(((((t[0x1] == 0x1) and (t[0x2] == 0x2)) and (t[0x3] == 0x3)) and (t[0x4] == "\u{61}")))
73+t=nil
74+function fat(x)
75+if (x <= 0x1) then
76+return 0x1
77+else
78+return (x * load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{61}\u{74}\u{28}" .. ((x - 0x1) .. "\u{29}")),"")())
79+end
80+end
81+assert(load("\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{27}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{66}\u{61}\u{74}\u{28}\u{36}\u{29}\u{3d}\u{3d}\u{37}\u{32}\u{30}\u{29}\u{27}\u{20}\u{28}\u{29}\u{20}"))()
82+a=load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{61}\u{74}\u{28}\u{35}\u{29}\u{2c}\u{20}\u{33}")
83+local a,b = a()
84+assert(((a == 0x78) and (b == 0x3)))
85+fat=nil
86+print("\u{2b}")
87+local function err_on_n
88+(n)
89+if (n == 0x0) then
90+error()
91+;
92+exit(0x1)
93+;
94+else
95+err_on_n((n - 0x1))
96+;
97+exit(0x1)
98+;
99+end
100+end
101+do
102+local function dummy
103+(n)
104+if (n > 0x0) then
105+assert((not pcall(err_on_n,n)))
106+dummy((n - 0x1))
107+end
108+end
109+dummy(0xa)
110+end
111+_G.deep=nil
112+function deep(n)
113+if (n > 0x0) then
114+deep((n - 0x1))
115+end
116+end
117+deep(0xa)
118+deep(0xb4)
119+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}")
120+function deep(n)
121+if (n > 0x0) then
122+return deep((n - 0x1))
123+else
124+return 0x65
125+end
126+end
127+assert((deep(0x7530) == 0x65))
128+a={}
129+function a:deep(n)
130+if (n > 0x0) then
131+return self:deep((n - 0x1))
132+else
133+return 0x65
134+end
135+end
136+assert((a:deep(0x7530) == 0x65))
137+do
138+local function foo
139+(x, ...)
140+local a = {...}
141+;
142+return x,a[0x1],a[0x2]
143+end
144+local function foo1
145+(x)
146+return foo(0xa,x,(x + 0x1))
147+end
148+local a,b,c = foo1((- 0x2))
149+assert(((a == 0xa) and (b == (- (0x2 and (c == (- 0x1)))))))
150+local t = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{61}\u{6c}\u{6c}"] = foo})
151+local function foo2
152+(x)
153+return t(0xa,x)
154+end
155+a,b,c=foo2(0x64)
156+assert((((a == t) and (b == 0xa)) and (c == 0x64)))
157+a,b=(function ()
158+return foo()
159+end)()
160+assert(((a == nil) and (b == nil)))
161+local X,Y,A
162+local function foo
163+(x,y, ...)
164+X=x
165+;
166+Y=y
167+;
168+A={...}
169+end
170+local function foo1
171+(...)
172+return foo(...)
173+end
174+local a,b,c = foo1()
175+assert((((X == nil) and (Y == nil)) and (# (A == 0x0))))
176+a,b,c=foo1(0xa)
177+assert((((X == 0xa) and (Y == nil)) and (# (A == 0x0))))
178+a,b,c=foo1(0xa,0x14)
179+assert((((X == 0xa) and (Y == 0x14)) and (# (A == 0x0))))
180+a,b,c=foo1(0xa,0x14,0x1e)
181+assert((((X == 0xa) and (Y == 0x14)) and (# ((A == 0x1) and (A[0x1] == 0x1e)))))
182+end
183+do
184+local function loop
185+()
186+assert(pcall(loop))
187+end
188+local err,msg = xpcall(loop,loop)
189+assert((not (err and string.find(msg,"\u{65}\u{72}\u{72}\u{6f}\u{72}"))))
190+end
191+do
192+local n = 0x2710
193+local function foo
194+()
195+if (n == 0x0) then
196+return 0x3ff
197+else
198+n=(n - 0x1)
199+;
200+return foo()
201+end
202+end
203+for i = 0x1, 0x64
204+do
205+foo=setmetatable({},{["\u{5f}\u{5f}\u{63}\u{61}\u{6c}\u{6c}"] = foo})
206+end
207+assert((coroutine.wrap(function ()
208+return foo()
209+end)() == 0x3ff))
210+end
211+print("\u{2b}")
212+do
213+local N = 0x14
214+local u = table.pack
215+for i = 0x1, N
216+do
217+u=setmetatable({i},{["\u{5f}\u{5f}\u{63}\u{61}\u{6c}\u{6c}"] = u})
218+end
219+local Res = u("\u{61}","\u{62}","\u{63}")
220+assert((Res.n == (N + 0x3)))
221+for i = 0x1, N
222+do
223+assert((Res[i][0x1] == i))
224+end
225+assert((((Res[(N + 0x1)] == "\u{61}") and (Res[(N + 0x2)] == "\u{62}")) and (Res[(N + 0x3)] == "\u{63}")))
226+end
227+a=nil
228+(function (x)
229+a=x
230+end)(0x17)
231+assert(((a == 0x17) and ((function (x)
232+return (x * 0x2)
233+end)(0x14) == 0x28)))
234+local Z = function (le)
235+local function a
236+(f)
237+return le(function (x)
238+return f(f)(x)
239+end)
240+end
241+return a(a)
242+end
243+local F = function (f)
244+return function (n)
245+if (n == 0x0) then
246+return 0x1
247+else
248+return (n * f((n - 0x1)))
249+end
250+end
251+end
252+local fat = Z(F)
253+assert((((fat(0x0) == 0x1) and (fat(0x4) == 0x18)) and (Z(F)(0x5) == (0x5 * Z(F)(0x4)))))
254+local function g
255+(z)
256+local function f
257+(a,b,c,d)
258+return function (x,y)
259+return (((((((a + b) + c) + d) + a) + x) + y) + z)
260+end
261+end
262+return f(z,(z + 0x1),(z + 0x2),(z + 0x3))
263+end
264+local f = g(0xa)
265+assert((f(0x9,0x10) == (((((((0xa + 0xb) + 0xc) + 0xd) + 0xa) + 0x9) + 0x10) + 0xa)))
266+print("\u{2b}")
267+local function unlpack
268+(t,i)
269+i=(i or 0x1)
270+if (i <= (# t)) then
271+return t[i],unlpack(t,(i + 0x1))
272+end
273+end
274+local function equaltab
275+(t1,t2)
276+assert((# (t1 == (# t2))))
277+for i = 0x1, (# t1)
278+do
279+assert((t1[i] == t2[i]))
280+end
281+end
282+local pack = function (...)
283+return table.pack(...)
284+end
285+local function f
286+()
287+return 0x1,0x2,0x1e,0x4
288+end
289+local function ret2
290+(a,b)
291+return a,b
292+end
293+local a,b,c,d = unlpack({0x1,0x2,0x3})
294+assert(((((a == 0x1) and (b == 0x2)) and (c == 0x3)) and (d == nil)))
295+a={0x1,0x2,0x3,0x4,false,0xa,"\u{61}\u{6c}\u{6f}",false,assert}
296+equaltab(pack(unlpack(a)),a)
297+equaltab(pack(unlpack(a),(- 0x1)),{0x1,(- 0x1)})
298+a,b,c,d=ret2(f()),ret2(f())
299+assert(((((a == 0x1) and (b == 0x1)) and (c == 0x2)) and (d == nil)))
300+a,b,c,d=unlpack(pack(ret2(f()),ret2(f())))
301+assert(((((a == 0x1) and (b == 0x1)) and (c == 0x2)) and (d == nil)))
302+a,b,c,d=unlpack(pack(ret2(f()),ret2(f())))
303+assert(((((a == 0x1) and (b == 0x1)) and (c == nil)) and (d == nil)))
304+a=ret2({unlpack({0x1,0x2,0x3}),unlpack({0x3,0x2,0x1}),unlpack({"\u{61}","\u{62}"})})
305+assert(((((a[0x1] == 0x1) and (a[0x2] == 0x3)) and (a[0x3] == "\u{61}")) and (a[0x4] == "\u{62}")))
306+rawget({},"\u{78}",0x1)
307+rawset({},"\u{78}",0x1,0x2)
308+assert((math.sin(0x1,0x2) == math.sin(0x1)))
309+table.sort({0xa,0x9,0x8,0x4,0x13,0x17,0x0,0x0},function (a,b)
310+return (a < b)
311+end,"\u{65}\u{78}\u{74}\u{72}\u{61}\u{20}\u{61}\u{72}\u{67}")
312+local x = "\u{2d}\u{2d}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{0}\u{0}\u{0}\u{a}\u{20}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{20}\u{2b}\u{20}\u{a}\u{32}\u{33}\u{3b}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{27}\u{68}\u{69}\u{27}\u{20}\u{65}\u{6e}\u{64}\u{3b}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{0}\u{27}"
313+local function read1
314+(x)
315+local i = 0x0
316+return function ()
317+collectgarbage()
318+i=(i + 0x1)
319+return string.sub(x,i,i)
320+end
321+end
322+local function cannotload
323+(msg,a,b)
324+assert((not (a and string.find(b,msg))))
325+end
326+a=assert(load(read1(x),"\u{6d}\u{6f}\u{64}\u{6e}\u{61}\u{6d}\u{65}","\u{74}",_G))
327+assert(((a() == "\u{0}") and (_G.x == 0x21)))
328+assert((debug.getinfo(a).source == "\u{6d}\u{6f}\u{64}\u{6e}\u{61}\u{6d}\u{65}"))
329+cannotload("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{61}\u{20}\u{74}\u{65}\u{78}\u{74}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}",load(read1(x),"\u{6d}\u{6f}\u{64}\u{6e}\u{61}\u{6d}\u{65}","\u{62}",{}))
330+cannotload("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{61}\u{20}\u{74}\u{65}\u{78}\u{74}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}",load(x,"\u{6d}\u{6f}\u{64}\u{6e}\u{61}\u{6d}\u{65}","\u{62}"))
331+a=assert(load(function ()
332+return nil
333+end))
334+a()
335+assert((not load(function ()
336+return true
337+end)))
338+local t = {nil,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}","\u{33}"}
339+f,msg=load(function ()
340+return table.remove(t,0x1)
341+end)
342+assert((f() == nil))
343+f=load(string.dump(function ()
344+return 0x1
345+end),nil,"\u{62}",{})
346+assert(((type(f) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and (f() == 0x1)))
347+do
348+local f = string.dump(function ()
349+return "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
350+end)
351+f=load(read1(f))
352+assert((f() == "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"))
353+end
354+x=string.dump(load("\u{78}\u{20}\u{3d}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}"))
355+a=assert(load(read1(x),nil,"\u{62}"))
356+assert(((a() == 0x1) and (_G.x == 0x1)))
357+cannotload("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{61}\u{20}\u{62}\u{69}\u{6e}\u{61}\u{72}\u{79}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}",load(read1(x),nil,"\u{74}"))
358+cannotload("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{61}\u{20}\u{62}\u{69}\u{6e}\u{61}\u{72}\u{79}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}",load(x,nil,"\u{74}"))
359+_G.x=nil
360+assert((not pcall(string.dump,print)))
361+cannotload("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}",load(read1("\u{2a}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{32}\u{33}")))
362+cannotload("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}",load("\u{2a}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{32}\u{33}"))
363+cannotload("\u{68}\u{68}\u{69}",load(function ()
364+error("\u{68}\u{68}\u{69}")
365+end))
366+assert((load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{5f}\u{45}\u{4e}\u{56}",nil,nil,0x7b)() == 0x7b))
367+local x
368+;
369+XX=0x7b
370+local function h
371+()
372+local y = x
373+return XX
374+end
375+local d = string.dump(h)
376+x=load(d,"","\u{62}")
377+assert((debug.getupvalue(x,0x2) == "\u{5f}\u{45}\u{4e}\u{56}"))
378+debug.setupvalue(x,0x2,_G)
379+assert((x() == 0x7b))
380+assert((assert(load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{58}\u{58}\u{20}\u{2b}\u{20}\u{2e}\u{2e}\u{2e}",nil,nil,{["\u{58}\u{58}"] = 0xd}))(0x4) == 0x11))
381+XX=nil
382+x="\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{78}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{79}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{7a}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{2b}\u{79}\u{2b}\u{7a}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}"
383+a=assert(load(read1(x),"\u{72}\u{65}\u{61}\u{64}","\u{74}"))
384+assert((a()(0x2)(0x3)(0xa) == 0xf))
385+x=string.dump(a)
386+a=assert(load(read1(x),"\u{72}\u{65}\u{61}\u{64}","\u{62}"))
387+assert((a()(0x2)(0x3)(0xa) == 0xf))
388+local a,b = 0x14,0x1e
389+x=load(string.dump(function (x)
390+if (x == "\u{73}\u{65}\u{74}") then
391+a=(0xa + b)
392+;
393+b=(b + 0x1)
394+else
395+return a
396+end
397+end),"","\u{62}",nil)
398+assert((x() == nil))
399+assert((debug.setupvalue(x,0x1,"\u{68}\u{69}") == "\u{61}"))
400+assert((x() == "\u{68}\u{69}"))
401+assert((debug.setupvalue(x,0x2,0xd) == "\u{62}"))
402+assert((not debug.setupvalue(x,0x3,0xa)))
403+x("\u{73}\u{65}\u{74}")
404+assert((x() == 0x17))
405+x("\u{73}\u{65}\u{74}")
406+assert((x() == 0x18))
407+do
408+local nup = 0xc8
409+local prog = {"\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{31}"}
410+for i = 0x2, nup
411+do
412+prog[(# (prog + 0x1))]=("\u{2c}\u{20}\u{61}" .. i)
413+end
414+prog[(# (prog + 0x1))]="\u{20}\u{3d}\u{20}\u{31}"
415+for i = 0x2, nup
416+do
417+prog[(# (prog + 0x1))]=("\u{2c}\u{20}" .. i)
418+end
419+local sum = 0x1
420+prog[(# (prog + 0x1))]="\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{31}"
421+for i = 0x2, nup
422+do
423+prog[(# (prog + 0x1))]=("\u{20}\u{2b}\u{20}\u{61}" .. i)
424+;
425+sum=(sum + i)
426+end
427+prog[(# (prog + 0x1))]="\u{20}\u{65}\u{6e}\u{64}"
428+prog=table.concat(prog)
429+local f = assert(load(prog))()
430+assert((f() == sum))
431+f=load(string.dump(f))
432+local a = 0xa
433+local h = function ()
434+return a
435+end
436+for i = 0x1, nup
437+do
438+debug.upvaluejoin(f,i,h,0x1)
439+end
440+assert((f() == (0xa * nup)))
441+end
442+do
443+local t = {["\u{78}"] = 0x1}
444+function t:_012345678901234567890123456789012345678901234567890123456789()
445+return self.x
446+end
447+assert((t:_012345678901234567890123456789012345678901234567890123456789() == 0x1))
448+end
449+assert(((function ()
450+return nil
451+end)(0x4) == nil))
452+assert(((function ()
453+local a
454+;
455+return a
456+end)(0x4) == nil))
457+assert(((function (a)
458+return a
459+end)() == nil))
460+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{62}\u{69}\u{6e}\u{61}\u{72}\u{79}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}\u{73}")
461+do
462+local header = string.pack("\u{63}\u{34}\u{42}\u{42}\u{63}\u{36}\u{42}\u{42}\u{42}","\u{1b}\u{4c}\u{75}\u{61}",0x54,0x0,"\u{19}\u{93}\u{d}\u{a}\u{1a}\u{a}",0x4,string.packsize("\u{6a}"),string.packsize("\u{6e}"))
463+local c = string.dump(function ()
464+local a = 0x1
465+;
466+local b = 0x3
467+;
468+local f = function ()
469+return ((a + b) + _ENV.c)
470+end
471+local s1 = "\u{61}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{61}\u{6e}\u{74}"
472+local s2 = "\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{61}\u{6e}\u{74}"
473+return (a + (b * 0x3))
474+end)
475+assert((assert(load(c))() == 0xa))
476+assert((string.sub(c,0x1,(# header)) == header))
477+local ci,cn = string.unpack("\u{6a}\u{6e}",c,(# (header + 0x1)))
478+assert(((ci == 0x5678) and (cn == 370.5)))
479+for i = 0x1, (# header)
480+do
481+local s = (string.sub(c,0x1,(i - 0x1)) .. (string.char((string.byte(string.sub(c,i,i)) + 0x1)) .. string.sub(c,(i + 0x1),(- 0x1))))
482+assert((# (s == (# c))))
483+assert((not load(s)))
484+end
485+for i = 0x1, (# (c - 0x1))
486+do
487+local st,msg = load(string.sub(c,0x1,i))
488+assert((not (st and string.find(msg,"\u{74}\u{72}\u{75}\u{6e}\u{63}\u{61}\u{74}\u{65}\u{64}"))))
489+end
490+end
491+print("\u{4f}\u{4b}")
492+return deep
desk/res/lua/cycled/closure.luanew file+327
@@ -0,0 +1,327 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{75}\u{72}\u{65}\u{73}")
2+local A,B = 0x0,{["\u{67}"] = 0xa}
3+local function f
4+(x)
5+local a = {}
6+for i = 0x1, 0x3e8
7+do
8+local y = 0x0
9+do
10+a[i]=function ()
11+B.g=(B.g + 0x1)
12+;
13+y=(y + x)
14+;
15+return (y + A)
16+end
17+end
18+end
19+local dummy = function ()
20+return a[A]
21+end
22+collectgarbage()
23+A=0x1
24+;
25+assert((dummy() == a[0x1]))
26+;
27+A=0x0
28+;
29+assert((a[0x1]() == x))
30+assert((a[0x3]() == x))
31+collectgarbage()
32+assert((B.g == 0xc))
33+return a
34+end
35+local a = f(0xa)
36+local x = {[0x1] = {}}
37+setmetatable(x,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
38+while x[0x1] do
39+local a = (A .. (A .. (A .. A)))
40+A=(A + 0x1)
41+end
42+assert((a[0x1]() == (0x14 + A)))
43+assert((a[0x1]() == (0x1e + A)))
44+assert((a[0x2]() == (0xa + A)))
45+collectgarbage()
46+assert((a[0x2]() == (0x14 + A)))
47+assert((a[0x2]() == (0x1e + A)))
48+assert((a[0x3]() == (0x14 + A)))
49+assert((a[0x8]() == (0xa + A)))
50+assert((getmetatable(x).__mode == "\u{6b}\u{76}"))
51+assert((B.g == 0x13))
52+a={}
53+for i = 0x1, 0x5
54+do
55+a[i]=function (x)
56+return ((i + a) + _ENV)
57+end
58+end
59+assert(((a[0x3] ~= a[0x4]) and (a[0x4] ~= a[0x5])))
60+do
61+local a = function (x)
62+return math.sin(_ENV[x])
63+end
64+local function f
65+()
66+return a
67+end
68+assert((f() == f()))
69+end
70+a={}
71+for i = 0x1, 0xa
72+do
73+a[i]={["\u{73}\u{65}\u{74}"] = function (x)
74+i=x
75+end,["\u{67}\u{65}\u{74}"] = function ()
76+return i
77+end}
78+if (i == 0x3) then
79+break
80+end
81+end
82+assert((a[0x4] == undef))
83+a[0x1].set(0xa)
84+assert((a[0x2].get() == 0x2))
85+a[0x2].set("\u{61}")
86+assert((a[0x3].get() == 0x3))
87+assert((a[0x2].get() == "\u{61}"))
88+a={}
89+local t = {"\u{61}","\u{62}"}
90+for i = 0x1, (# t)
91+do
92+local k = t[i]
93+a[i]={["\u{73}\u{65}\u{74}"] = function (x,y)
94+i=x
95+;
96+k=y
97+end,["\u{67}\u{65}\u{74}"] = function ()
98+return i,k
99+end}
100+if (i == 0x2) then
101+break
102+end
103+end
104+a[0x1].set(0xa,0x14)
105+local r,s = a[0x2].get()
106+assert(((r == 0x2) and (s == "\u{62}")))
107+r,s=a[0x1].get()
108+assert(((r == 0xa) and (s == 0x14)))
109+a[0x2].set("\u{61}","\u{62}")
110+r,s=a[0x2].get()
111+assert(((r == "\u{61}") and (s == "\u{62}")))
112+local f
113+for i = 0x1, 0x3
114+do
115+f=function ()
116+return i
117+end
118+break
119+end
120+assert((f() == 0x1))
121+for k = 0x1, (# t)
122+do
123+local v = t[k]
124+f=function ()
125+return k,v
126+end
127+break
128+end
129+assert((({f()})[0x1] == 0x1))
130+assert((({f()})[0x2] == "\u{61}"))
131+local b
132+function f(x)
133+local first = 0x1
134+while 0x1 do
135+if ((x == 0x3) and (not first)) then
136+return
137+end
138+local a = "\u{78}\u{75}\u{78}\u{75}"
139+b=function (op,y)
140+if (op == "\u{73}\u{65}\u{74}") then
141+a=(x + y)
142+else
143+return a
144+end
145+end
146+if (x == 0x1) then
147+do
148+break
149+end
150+elseif (x == 0x2) then
151+return
152+else
153+if (x ~= 0x3) then
154+error()
155+end
156+end
157+first=nil
158+end
159+end
160+for i = 0x1, 0x3
161+do
162+f(i)
163+assert((b("\u{67}\u{65}\u{74}") == "\u{78}\u{75}\u{78}\u{75}"))
164+b("\u{73}\u{65}\u{74}",0xa)
165+;
166+assert((b("\u{67}\u{65}\u{74}") == (0xa + i)))
167+b=nil
168+end
169+pcall(f,0x4)
170+;
171+assert((b("\u{67}\u{65}\u{74}") == "\u{78}\u{75}\u{78}\u{75}"))
172+b("\u{73}\u{65}\u{74}",0xa)
173+;
174+assert((b("\u{67}\u{65}\u{74}") == 0xe))
175+local y,w
176+function f(x)
177+return function (y)
178+return function (z)
179+return (((w + x) + y) + z)
180+end
181+end
182+end
183+y=f(0xa)
184+w=1.345
185+assert((y(0x14)(0x1e) == (0x3c + w)))
186+do
187+local X,Y
188+local a = math.sin(0x0)
189+while a do
190+local b = 0xa
191+X=function ()
192+return b
193+end
194+if a then
195+break
196+end
197+end
198+do
199+local b = 0x14
200+Y=function ()
201+return b
202+end
203+end
204+assert(((X() == 0xa) and (Y() == 0x14)))
205+end
206+local a = {}
207+local i = 0x1
208+repeat
209+local x = i
210+a[i]=function ()
211+i=(x + 0x1)
212+;
213+return x
214+end
215+until ((i > 0xa) or (a[i]() ~= x))
216+assert(((((i == 0xb) and (a[0x1]() == 0x1)) and (a[0x3]() == 0x3)) and (i == 0x4)))
217+a={}
218+for i = 0x1, 0xa
219+do
220+if ((i % 0x3) == 0x0) then
221+local y = 0x0
222+a[i]=function (x)
223+local t = y
224+;
225+y=x
226+;
227+return t
228+end
229+elseif ((i % 0x3) == 0x1) then
230+goto L1
231+error("\u{6e}\u{6f}\u{74}\u{20}\u{68}\u{65}\u{72}\u{65}")
232+::L1::
233+local y = 0x1
234+a[i]=function (x)
235+local t = y
236+;
237+y=x
238+;
239+return t
240+end
241+elseif ((i % 0x3) == 0x2) then
242+local t
243+goto l4
244+::l4a::
245+a[i]=t
246+;
247+goto l4b
248+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
249+::l4::
250+local y = 0x2
251+t=function (x)
252+local t = y
253+;
254+y=x
255+;
256+return t
257+end
258+goto l4a
259+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
260+::l4b::
261+end
262+end
263+for i = 0x1, 0xa
264+do
265+assert(((a[i]((i * 0xa)) == (i % 0x3)) and (a[i]() == (i * 0xa))))
266+end
267+print("\u{2b}")
268+local function t
269+()
270+local function c
271+(a,b)
272+assert(((a == "\u{74}\u{65}\u{73}\u{74}") and (b == "\u{4f}\u{4b}")))
273+end
274+local function v
275+(f, ...)
276+c("\u{74}\u{65}\u{73}\u{74}",(((f() ~= 0x1) and "\u{46}\u{41}\u{49}\u{4c}\u{45}\u{44}") or "\u{4f}\u{4b}"))
277+end
278+local x = 0x1
279+return v(function ()
280+return x
281+end)
282+end
283+t()
284+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
285+local foo1,foo2,foo3
286+do
287+local a,b,c = 0x3,0x5,0x7
288+foo1=function ()
289+return (a + b)
290+end
291+;
292+foo2=function ()
293+return (b + a)
294+end
295+;
296+do
297+local a = 0xa
298+foo3=function ()
299+return (a + b)
300+end
301+;
302+end
303+end
304+assert(debug.upvalueid(foo1,0x1))
305+assert(debug.upvalueid(foo1,0x2))
306+assert((not debug.upvalueid(foo1,0x3)))
307+assert((debug.upvalueid(foo1,0x1) == debug.upvalueid(foo2,0x2)))
308+assert((debug.upvalueid(foo1,0x2) == debug.upvalueid(foo2,0x1)))
309+assert(debug.upvalueid(foo3,0x1))
310+assert((debug.upvalueid(foo1,0x1) ~= debug.upvalueid(foo3,0x1)))
311+assert((debug.upvalueid(foo1,0x2) == debug.upvalueid(foo3,0x2)))
312+assert((debug.upvalueid(string.gmatch("\u{78}","\u{78}"),0x1) ~= nil))
313+assert(((foo1() == (0x3 + 0x5)) and (foo2() == (0x5 + 0x3))))
314+debug.upvaluejoin(foo1,0x2,foo2,0x2)
315+assert(((foo1() == (0x3 + 0x3)) and (foo2() == (0x5 + 0x3))))
316+assert((foo3() == (0xa + 0x5)))
317+debug.upvaluejoin(foo3,0x2,foo2,0x1)
318+assert((foo3() == (0xa + 0x5)))
319+debug.upvaluejoin(foo3,0x2,foo2,0x2)
320+assert((foo3() == (0xa + 0x3)))
321+assert((not pcall(debug.upvaluejoin,foo1,0x3,foo2,0x1)))
322+assert((not pcall(debug.upvaluejoin,foo1,0x1,foo2,0x3)))
323+assert((not pcall(debug.upvaluejoin,foo1,0x0,foo2,0x1)))
324+assert((not pcall(debug.upvaluejoin,print,0x1,foo2,0x1)))
325+assert((not pcall(debug.upvaluejoin,{},0x1,foo2,0x1)))
326+assert((not pcall(debug.upvaluejoin,foo1,0x1,print,0x1)))
327+print("\u{4f}\u{4b}")
desk/res/lua/cycled/code.luanew file+586
@@ -0,0 +1,586 @@
1+if (T == nil) then
2+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{70}\u{63}\u{6f}\u{64}\u{65}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
3+return
4+end
5+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{64}\u{65}\u{20}\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6d}\u{69}\u{7a}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{73}")
6+local k0aux <const> = 0x0
7+local k0 <const> = k0aux
8+local k1 <const> = 0x1
9+local k3 <const> = 0x3
10+local k6 <const> = (k3 + (k3 << k0))
11+local kFF0 <const> = 0xff0
12+local k3_78 <const> = 3.78
13+local x,k3_78_4 <const> = 0xa,(k3_78 / 0x4)
14+assert((x == 0xa))
15+local kx <const> = "\u{78}"
16+local kTrue <const> = true
17+local kFalse <const> = false
18+local kNil <const> = nil
19+do
20+local function f
21+(a)
22+for k,v,w in a
23+do
24+
25+end
26+end
27+end
28+local function checkKlist
29+(func,list)
30+local k = T.listk(func)
31+assert((# (k == (# list))))
32+for i = 0x1, (# k)
33+do
34+assert(((k[i] == list[i]) and (math.type(k[i]) == math.type(list[i]))))
35+end
36+end
37+local function foo
38+()
39+local a
40+a=k3
41+;
42+a=0x0
43+;
44+a=0.0
45+;
46+a=(- (0x7 + 0x7))
47+a=(k3_78 / 0x4)
48+;
49+a=k3_78_4
50+a=(- (k3_78 / 0x4))
51+;
52+a=(k3_78 / 0x4)
53+;
54+a=(- (3.78 / 0x4))
55+a=(- (3.79 / 0x4))
56+;
57+a=0.0
58+;
59+a=(- 0x0)
60+;
61+a=k3
62+;
63+a=3.0
64+;
65+a=0x3
66+;
67+a=3.0
68+end
69+checkKlist(foo,{(3.78 / 0x4),(- (3.78 / 0x4)),(- (3.79 / 0x4))})
70+foo=function (f,a)
71+f((0x64 * 0x3e8))
72+f((100.0 * 0x3e8))
73+f((- (0x64 * 0x3e8)))
74+f((- (0x64 * 1e3)))
75+f(0x186a0)
76+f(1e5)
77+f((- 0x186a0))
78+f((- 1e5))
79+end
80+checkKlist(foo,{0x186a0,1e5,(- 0x186a0),(- 1e5)})
81+foo=function (t,a)
82+t[a]=0x1
83+;
84+t[a]=1.0
85+t[a]=0x1
86+;
87+t[a]=1.0
88+t[a]=0x2
89+;
90+t[a]=2.0
91+t[a]=0x0
92+;
93+t[a]=0.0
94+t[a]=0x1
95+;
96+t[a]=1.0
97+t[a]=0x2
98+;
99+t[a]=2.0
100+t[a]=0x0
101+;
102+t[a]=0.0
103+end
104+checkKlist(foo,{0x1,1.0,0x2,2.0,0x0,0.0})
105+local function check
106+(f, ...)
107+local arg = {...}
108+local c = T.listcode(f)
109+for i = 0x1, (# arg)
110+do
111+local opcode = string.match(c[i],"\u{25}\u{75}\u{25}\u{77}\u{2b}")
112+assert((arg[i] == opcode))
113+end
114+assert((c[(# (arg + 0x2))] == undef))
115+end
116+local function checkR
117+(f,p,r, ...)
118+local r1 = f(p)
119+assert(((r == r1) and (math.type(r) == math.type(r1))))
120+check(f,...)
121+end
122+local function checkequal
123+(a,b)
124+a=T.listcode(a)
125+b=T.listcode(b)
126+assert((# (a == (# b))))
127+for i = 0x1, (# a)
128+do
129+a[i]=string.gsub(a[i],"\u{25}\u{62}\u{28}\u{29}","")
130+b[i]=string.gsub(b[i],"\u{25}\u{62}\u{28}\u{29}","")
131+assert((a[i] == b[i]))
132+end
133+end
134+check(function ()
135+(function ()
136+
137+end)({f()})
138+end,"\u{43}\u{4c}\u{4f}\u{53}\u{55}\u{52}\u{45}","\u{4e}\u{45}\u{57}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{45}\u{58}\u{54}\u{52}\u{41}\u{41}\u{52}\u{47}","\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{55}\u{50}","\u{43}\u{41}\u{4c}\u{4c}","\u{53}\u{45}\u{54}\u{4c}\u{49}\u{53}\u{54}","\u{43}\u{41}\u{4c}\u{4c}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
139+check(function (x)
140+(function ()
141+return x
142+end)({f()})
143+end,"\u{43}\u{4c}\u{4f}\u{53}\u{55}\u{52}\u{45}","\u{4e}\u{45}\u{57}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{45}\u{58}\u{54}\u{52}\u{41}\u{41}\u{52}\u{47}","\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{55}\u{50}","\u{43}\u{41}\u{4c}\u{4c}","\u{53}\u{45}\u{54}\u{4c}\u{49}\u{53}\u{54}","\u{43}\u{41}\u{4c}\u{4c}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}")
144+check(function ()
145+local kNil <const> = nil
146+local a,b,c
147+local d
148+;
149+local e
150+;
151+local f,g,h
152+;
153+d=nil
154+;
155+d=nil
156+;
157+b=nil
158+;
159+a=kNil
160+;
161+c=nil
162+;
163+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
164+check(function ()
165+local a,b,c,d = 0x1,0x1,0x1,0x1
166+d=nil
167+;
168+c=nil
169+;
170+b=nil
171+;
172+a=nil
173+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
174+do
175+local a,b,c,d = 0x1,0x1,0x1,0x1
176+d=nil
177+;
178+c=nil
179+;
180+b=nil
181+;
182+a=nil
183+assert(((((a == nil) and (b == nil)) and (c == nil)) and (d == nil)))
184+end
185+check(function (a,b,c)
186+return a
187+end,"\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
188+check(function ()
189+while kTrue do
190+local a = (- 0x1)
191+end
192+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4a}\u{4d}\u{50}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
193+check(function ()
194+while 0x1 do
195+local a = (- 0x1)
196+end
197+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4a}\u{4d}\u{50}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
198+check(function ()
199+repeat
200+local x = 0x1
201+until true
202+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
203+check(function (a,b,c,d)
204+return (a .. (b .. (c .. d)))
205+end,"\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{43}\u{4f}\u{4e}\u{43}\u{41}\u{54}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
206+check(function ()
207+return (not (not nil))
208+end,"\u{4c}\u{4f}\u{41}\u{44}\u{46}\u{41}\u{4c}\u{53}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
209+check(function ()
210+return (not (not kFalse))
211+end,"\u{4c}\u{4f}\u{41}\u{44}\u{46}\u{41}\u{4c}\u{53}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
212+check(function ()
213+return (not (not true))
214+end,"\u{4c}\u{4f}\u{41}\u{44}\u{54}\u{52}\u{55}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
215+check(function ()
216+return (not (not k3))
217+end,"\u{4c}\u{4f}\u{41}\u{44}\u{54}\u{52}\u{55}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
218+check(function ()
219+local a,b,c,d
220+a=(b * a)
221+c.x,a[b]=(- (((a + (d / b)) - a[b]) ^ a.x)),b
222+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{4d}\u{55}\u{4c}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{44}\u{49}\u{56}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{41}\u{44}\u{44}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{53}\u{55}\u{42}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{47}\u{45}\u{54}\u{46}\u{49}\u{45}\u{4c}\u{44}","\u{50}\u{4f}\u{57}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{55}\u{4e}\u{4d}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{53}\u{45}\u{54}\u{46}\u{49}\u{45}\u{4c}\u{44}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
223+check(function ()
224+local a,b
225+local c = kNil
226+a[kx]=3.2
227+a.x=b
228+a[b]="\u{78}"
229+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{53}\u{45}\u{54}\u{46}\u{49}\u{45}\u{4c}\u{44}","\u{53}\u{45}\u{54}\u{46}\u{49}\u{45}\u{4c}\u{44}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
230+check(function (a)
231+local k255 <const> = 0xff
232+a[0x1]=a[0x64]
233+a[k255]=a[0x100]
234+a[0x100]=0x5
235+end,"\u{47}\u{45}\u{54}\u{49}","\u{53}\u{45}\u{54}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{53}\u{45}\u{54}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
236+check(function ()
237+local a,b
238+a=(a - a)
239+b=(a / a)
240+b=(0x5 - 0x4)
241+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{53}\u{55}\u{42}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{44}\u{49}\u{56}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
242+check(function ()
243+local a,b
244+a[kTrue]=false
245+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{4c}\u{4f}\u{41}\u{44}\u{54}\u{52}\u{55}\u{45}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
246+checkR(function (a)
247+if (a == 0x1) then
248+return 0x2
249+end
250+end,0x1,0x2,"\u{45}\u{51}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
251+checkR(function (a)
252+if (- (4.0 == a)) then
253+return 0x2
254+end
255+end,(- 0x4),0x2,"\u{45}\u{51}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
256+checkR(function (a)
257+if (a == "\u{68}\u{69}") then
258+return 0x2
259+end
260+end,0xa,nil,"\u{45}\u{51}\u{4b}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
261+checkR(function (a)
262+if (a == 0x2710) then
263+return 0x2
264+end
265+end,0x1,nil,"\u{45}\u{51}\u{4b}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
266+checkR(function (a)
267+if (- (0x2710 == a)) then
268+return 0x2
269+end
270+end,(- 0x2710),0x2,"\u{45}\u{51}\u{4b}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
271+checkR(function (a)
272+if (- (0xa <= a)) then
273+return 0x2
274+end
275+end,(- 0xa),0x2,"\u{47}\u{45}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
276+checkR(function (a)
277+if (128.0 > a) then
278+return 0x2
279+end
280+end,0x81,nil,"\u{4c}\u{54}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
281+checkR(function (a)
282+if (- (127.0 < a)) then
283+return 0x2
284+end
285+end,(- 0x7f),nil,"\u{47}\u{54}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
286+checkR(function (a)
287+if (0xa < a) then
288+return 0x2
289+end
290+end,0xb,0x2,"\u{47}\u{54}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
291+checkR(function (a)
292+if (0x81 < a) then
293+return 0x2
294+end
295+end,0x82,0x2,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{54}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
296+checkR(function (a)
297+if (a >= 23.0) then
298+return 0x2
299+end
300+end,0x19,0x2,"\u{47}\u{45}\u{49}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
301+checkR(function (a)
302+if (a >= 23.1) then
303+return 0x2
304+end
305+end,0x0,nil,"\u{4c}\u{4f}\u{41}\u{44}\u{4b}","\u{4c}\u{45}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
306+checkR(function (a)
307+if (a > 2300.0) then
308+return 0x2
309+end
310+end,0x0,nil,"\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{4c}\u{54}","\u{4a}\u{4d}\u{50}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
311+local function checkK
312+(func,val)
313+check(func,"\u{4c}\u{4f}\u{41}\u{44}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
314+checkKlist(func,{val})
315+assert((func() == val))
316+end
317+local function checkI
318+(func,val)
319+check(func,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
320+checkKlist(func,{})
321+assert((func() == val))
322+end
323+local function checkF
324+(func,val)
325+check(func,"\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
326+checkKlist(func,{})
327+assert((func() == val))
328+end
329+checkF(function ()
330+return 0.0
331+end,0.0)
332+checkI(function ()
333+return k0
334+end,0x0)
335+checkI(function ()
336+return (- (k0 // 0x1))
337+end,0x0)
338+checkK(function ()
339+return (0x3 ^ (- 0x1))
340+end,(0x1 / 0x3))
341+checkK(function ()
342+return ((0x1 + 0x1) ^ (0x32 + 0x32))
343+end,(0x2 ^ 0x64))
344+checkK(function ()
345+return ((- 0x2) ^ (0x1f - 0x2))
346+end,(- (0x20000000 + 0.0)))
347+checkF(function ()
348+return ((- ((k3 ^ 0x0) + 0x5)) // 3.0)
349+end,1.0)
350+checkI(function ()
351+return (- (k3 % 0x5))
352+end,0x2)
353+checkF(function ()
354+return (- ((((((2.0 ^ 0x8) + (- (- 0x1))) % 0x8) / 0x2) * 0x4) - 0x3))
355+end,(- 5.0))
356+checkF(function ()
357+return (- ((((((0x2 ^ 0x8) + (- (- 0x1))) % 0x8) // 0x2) * 0x4) - 0x3))
358+end,(- 7.0))
359+checkI(function ()
360+return (240.0 | (204.0 ~ (0xaa & 0xfd)))
361+end,0xf4)
362+checkI(function ()
363+return (~ (~ (kFF0 | kFF0)))
364+end,0x0)
365+checkI(function ()
366+return (~ (~ (- 1024.0)))
367+end,(- 0x400))
368+checkI(function ()
369+return (((0x64 << k6) << (- 0x4)) >> 0x2)
370+end,0x64)
371+local a = 0x11
372+;
373+local sbx = (((0x1 << a) - 0x1) >> 0x1)
374+local border <const> = 0xffff
375+checkI(function ()
376+return border
377+end,sbx)
378+checkI(function ()
379+return (- border)
380+end,(- sbx))
381+checkI(function ()
382+return (border + 0x1)
383+end,(sbx + 0x1))
384+checkK(function ()
385+return (border + 0x2)
386+end,(sbx + 0x2))
387+checkK(function ()
388+return (- (border + 0x1))
389+end,(- (sbx + 0x1)))
390+local border <const> = 65535.0
391+checkF(function ()
392+return border
393+end,(sbx + 0.0))
394+checkF(function ()
395+return (- border)
396+end,(- (sbx + 0.0)))
397+checkF(function ()
398+return (border + 0x1)
399+end,(sbx + 1.0))
400+checkK(function ()
401+return (border + 0x2)
402+end,(sbx + 2.0))
403+checkK(function ()
404+return (- (border + 0x1))
405+end,(- (sbx + 1.0)))
406+checkR(function (x)
407+return (x + k1)
408+end,0xa,0xb,"\u{41}\u{44}\u{44}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
409+checkR(function (x)
410+return (x - 0x7f)
411+end,0xa,(- 0x75),"\u{41}\u{44}\u{44}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
412+checkR(function (x)
413+return (0x80 + x)
414+end,0.0,128.0,"\u{41}\u{44}\u{44}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
415+checkR(function (x)
416+return (x * (- 0x7f))
417+end,(- 1.0),127.0,"\u{4d}\u{55}\u{4c}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
418+checkR(function (x)
419+return (0x14 * x)
420+end,0x2,0x28,"\u{4d}\u{55}\u{4c}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
421+checkR(function (x)
422+return (x ^ (- 0x2))
423+end,0x2,0.25,"\u{50}\u{4f}\u{57}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
424+checkR(function (x)
425+return (x / 0x28)
426+end,0x28,1.0,"\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
427+checkR(function (x)
428+return (x // 0x1)
429+end,10.0,10.0,"\u{49}\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
430+checkR(function (x)
431+return (x % (0x64 - 0xa))
432+end,0x5b,0x1,"\u{4d}\u{4f}\u{44}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
433+checkR(function (x)
434+return (k1 << x)
435+end,0x3,0x8,"\u{53}\u{48}\u{4c}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
436+checkR(function (x)
437+return (x << 0x7f)
438+end,0xa,0x0,"\u{53}\u{48}\u{52}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
439+checkR(function (x)
440+return (x << (- 0x7f))
441+end,0xa,0x0,"\u{53}\u{48}\u{52}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
442+checkR(function (x)
443+return (x >> 0x80)
444+end,0x8,0x0,"\u{53}\u{48}\u{52}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
445+checkR(function (x)
446+return (x >> (- 0x7f))
447+end,0x8,0x0,"\u{53}\u{48}\u{52}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
448+checkR(function (x)
449+return (x & 0x1)
450+end,0x9,0x1,"\u{42}\u{41}\u{4e}\u{44}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
451+checkR(function (x)
452+return (0xa | x)
453+end,0x1,0xb,"\u{42}\u{4f}\u{52}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
454+checkR(function (x)
455+return (- (0xa ~ x))
456+end,(- 0x1),0x9,"\u{42}\u{58}\u{4f}\u{52}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
457+checkR(function (x)
458+return (x + 0.0)
459+end,0x1,1.0,"\u{41}\u{44}\u{44}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
460+checkR(function (x)
461+return (x * (- 0x2710))
462+end,0x2,(- 0x4e20),"\u{4d}\u{55}\u{4c}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
463+checkR(function (x)
464+return (x ^ 0.5)
465+end,0x4,2.0,"\u{50}\u{4f}\u{57}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
466+checkR(function (x)
467+return (x / 2.0)
468+end,0x4,2.0,"\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
469+checkR(function (x)
470+return (x // 0x2710)
471+end,0x2710,0x1,"\u{49}\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
472+checkR(function (x)
473+return (x % (100.0 - 0xa))
474+end,0x5b,1.0,"\u{4d}\u{4f}\u{44}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
475+check(function ()
476+return (- 0.0)
477+end,"\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{55}\u{4e}\u{4d}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
478+check(function ()
479+return (k3 / 0x0)
480+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
481+check(function ()
482+return (0x0 % 0x0)
483+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4d}\u{4f}\u{44}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
484+check(function ()
485+return (- (0x4 // 0x0))
486+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{49}\u{44}\u{49}\u{56}\u{4b}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{4b}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
487+check(function (x)
488+return (x >> 2.0)
489+end,"\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{53}\u{48}\u{52}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
490+check(function (x)
491+return (x << 0x80)
492+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{53}\u{48}\u{4c}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
493+check(function (x)
494+return (x & 2.0)
495+end,"\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{42}\u{41}\u{4e}\u{44}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
496+check(function ()
497+for i = (- 0xa), 10.5
498+do
499+
500+end
501+end,"\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{4c}\u{4f}\u{41}\u{44}\u{4b}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{46}\u{4f}\u{52}\u{50}\u{52}\u{45}\u{50}","\u{46}\u{4f}\u{52}\u{4c}\u{4f}\u{4f}\u{50}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
502+check(function ()
503+for i = 0xfffffff, 10.0, 0x1
504+do
505+
506+end
507+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4b}","\u{4c}\u{4f}\u{41}\u{44}\u{46}","\u{4c}\u{4f}\u{41}\u{44}\u{49}","\u{46}\u{4f}\u{52}\u{50}\u{52}\u{45}\u{50}","\u{46}\u{4f}\u{52}\u{4c}\u{4f}\u{4f}\u{50}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
508+check(function ()
509+return (- nil)
510+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{55}\u{4e}\u{4d}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{31}")
511+check(function ()
512+local a,b,c
513+b[c],a=c,b
514+b[a],a=c,b
515+a,b=c,a
516+a=a
517+end,"\u{4c}\u{4f}\u{41}\u{44}\u{4e}\u{49}\u{4c}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{4d}\u{4f}\u{56}\u{45}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
518+do
519+local t
520+check(function ()
521+t[kx]=t.y
522+end,"\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{55}\u{50}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{55}\u{50}")
523+check(function (a)
524+t[a()]=t[a()]
525+end,"\u{4d}\u{4f}\u{56}\u{45}","\u{43}\u{41}\u{4c}\u{4c}","\u{47}\u{45}\u{54}\u{55}\u{50}\u{56}\u{41}\u{4c}","\u{4d}\u{4f}\u{56}\u{45}","\u{43}\u{41}\u{4c}\u{4c}","\u{47}\u{45}\u{54}\u{55}\u{50}\u{56}\u{41}\u{4c}","\u{47}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}","\u{53}\u{45}\u{54}\u{54}\u{41}\u{42}\u{4c}\u{45}")
526+end
527+checkequal(function ()
528+local a
529+;
530+if (not (a or b)) then
531+b=a
532+end
533+end,function ()
534+local a
535+;
536+if (not (a and (not b))) then
537+b=a
538+end
539+end)
540+checkequal(function (l)
541+local a
542+;
543+return ((0x0 <= a) and (a <= l))
544+end,function (l)
545+local a
546+;
547+return (not (not ((a >= 0x0) or (not (a <= l)))))
548+end)
549+check(function (a,b)
550+while a do
551+if b then
552+break
553+else
554+a=(a + 0x1)
555+end
556+end
557+end,"\u{54}\u{45}\u{53}\u{54}","\u{4a}\u{4d}\u{50}","\u{54}\u{45}\u{53}\u{54}","\u{4a}\u{4d}\u{50}","\u{41}\u{44}\u{44}\u{49}","\u{4d}\u{4d}\u{42}\u{49}\u{4e}\u{49}","\u{4a}\u{4d}\u{50}","\u{52}\u{45}\u{54}\u{55}\u{52}\u{4e}\u{30}")
558+checkequal(function ()
559+return ((0x6 or true) or nil)
560+end,function ()
561+return ((k6 or kTrue) or kNil)
562+end)
563+checkequal(function ()
564+return ((0x6 and true) or nil)
565+end,function ()
566+return ((k6 and kTrue) or kNil)
567+end)
568+do
569+local k0 <const> = "\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}"
570+local function f1
571+()
572+local k <const> = k0
573+return function ()
574+return function ()
575+return k
576+end
577+end
578+end
579+local f2 = f1()
580+local f3 = f2()
581+assert((f3() == k0))
582+checkK(f3,k0)
583+assert((T.listk(f1)[0x1] == nil))
584+assert((T.listk(f2)[0x1] == nil))
585+end
586+print("\u{4f}\u{4b}")
desk/res/lua/cycled/constructs.luanew file+469
@@ -0,0 +1,469 @@
1+;
2+;
3+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{79}\u{6e}\u{74}\u{61}\u{78}")
4+;
5+;
6+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
7+local function checkload
8+(s,msg)
9+assert(string.find(select(0x2,load(s)),msg))
10+end
11+local a
12+do
13+;
14+;
15+;
16+end
17+;
18+do
19+;
20+a=0x3
21+;
22+assert((a == 0x3))
23+end
24+;
25+;
26+if false then
27+a=(0x3 // 0x0)
28+;
29+a=(0x0 % 0x0)
30+end
31+assert(((0x2 ^ (0x3 ^ 0x2)) == (0x2 ^ (0x3 ^ 0x2))))
32+;
33+assert((((0x2 ^ 0x3) * 0x4) == ((0x2 ^ 0x3) * 0x4)))
34+;
35+assert((2.0 ^ (- ((0x2 == (0x1 / 0x4)) and (- (0x2 ^ (- (- (0x2 == (- (- (- 0x4))))))))))))
36+;
37+assert((not ((nil and 0x2) and (not ((0x2 > 0x3) or (0x3 < 0x2))))))
38+;
39+assert((- (((0x3 - 0x1) - 0x5) == ((0x0 + 0x0) - 0x9))))
40+;
41+assert((- ((0x2 ^ 0x2) == (- ((0x4 and (((- 0x2) ^ 0x2) == 0x4)) and ((((0x2 * 0x2) - 0x3) - 0x1) == 0x0))))))
42+;
43+assert((- (((0x3 % 0x5) == 0x2) and (- ((0x3 + 0x5) == 0x2)))))
44+assert(((((0x2 * 0x1) + (0x3 / 0x3)) == 0x3) and (((0x1 + 0x2) .. (0x3 * 0x1)) == "\u{33}\u{33}")))
45+;
46+assert((not (((0x2 + 0x1) > (0x3 * 0x1)) and (("\u{61}" .. "\u{62}") > "\u{61}"))))
47+;
48+assert(((0xf0 | (0xcc ~ (0xaa & 0xfd))) == 0xf4))
49+assert(((((0xfd & 0xaa) ~ 0xcc) | 0xf0) == 0xf4))
50+assert(((0xf0 & (0xf + 0x1)) == 0x10))
51+assert(((((0x3 ^ 0x4) // (0x2 ^ 0x3)) // 0x5) == 0x2))
52+assert((- (((0x3 + (((0x4 * 0x5) // (0x2 ^ (0x3 ^ 0x2))) // 0x9)) + ((0x4 % 0xa) / 0x3)) == (((- 0x3) + (((0x4 * 0x5) // (0x2 ^ (0x3 ^ 0x2))) // 0x9)) + ((0x4 % 0xa) / 0x3)))))
53+assert((not ((true or false) and nil)))
54+assert((true or (false and nil)))
55+assert(((((0x1 or false) and true) or false) == true))
56+assert(((((nil and true) or false) and true) == false))
57+local a,b = 0x1,nil
58+;
59+assert((- ((0x1 or 0x2) == (- (0x1 and (((0x1 and 0x2) + (- (1.25 or (- 0x4)))) == 0.75))))))
60+;
61+local x = ((((b or a) + 0x1) == 0x2) and (((0xa or a) + 0x1) == 0xb))
62+;
63+assert(x)
64+;
65+x=((((0x2 < 0x3) or 0x1) == true) and (((0x2 < 0x3) and 0x4) == 0x4))
66+;
67+assert(x)
68+;
69+local x,y = 0x1,0x2
70+;
71+assert((((x > y) and x) or (y == 0x2)))
72+;
73+x,y=0x2,0x1
74+;
75+assert((((x > y) and x) or (y == 0x2)))
76+;
77+assert(((0x499602d2 == tonumber("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}")) and ((0x499602d2 + 0x1) == 0x499602d3)))
78+do
79+local operand = {0x3,0x64,5.0,(- 0xa),(- 5.0),0x2710,(- 0x2710)}
80+local operator = {"\u{2b}","\u{2d}","\u{2a}","\u{2f}","\u{2f}\u{2f}","\u{25}","\u{5e}","\u{26}","\u{7c}","\u{5e}","\u{3c}\u{3c}","\u{3e}\u{3e}","\u{3d}\u{3d}","\u{7e}\u{3d}","\u{3c}","\u{3e}","\u{3c}\u{3d}","\u{3e}\u{3d}"}
81+for _,op in ipairs(operator)
82+do
83+local f = assert(load(string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{78}\u{2c}\u{79}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{20}\u{25}\u{73}\u{20}\u{79}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}",op)))()
84+;
85+for _,o1 in ipairs(operand)
86+do
87+for _,o2 in ipairs(operand)
88+do
89+local gab = f(o1,o2)
90+_ENV.XX=o1
91+local code = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{58}\u{58}\u{20}\u{25}\u{73}\u{20}\u{25}\u{73}",op,o2)
92+local res = assert(load(code))()
93+assert((res == gab))
94+_ENV.XX=o2
95+code=string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{25}\u{73}\u{29}\u{20}\u{25}\u{73}\u{20}\u{58}\u{58}",o1,op)
96+res=assert(load(code))()
97+assert((res == gab))
98+code=string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{25}\u{73}\u{29}\u{20}\u{25}\u{73}\u{20}\u{25}\u{73}",o1,op,o2)
99+res=assert(load(code))()
100+assert((res == gab))
101+end
102+end
103+end
104+_ENV.XX=nil
105+end
106+repeat
107+
108+until 0x1
109+;
110+repeat
111+
112+until true
113+;
114+while false do
115+
116+end
117+;
118+while nil do
119+
120+end
121+;
122+do
123+local a
124+;
125+local function f
126+(x)
127+x={["\u{61}"] = 0x1}
128+;
129+x={["\u{78}"] = 0x1}
130+;
131+x={["\u{47}"] = 0x1}
132+end
133+end
134+do
135+local code = {"\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{7b}"}
136+for i = 0x1, 0x101
137+do
138+code[(# (code + 0x1))]=(i .. "\u{2e}\u{31}\u{2c}")
139+end
140+code[(# (code + 0x1))]="\u{7d}\u{3b}"
141+code=table.concat(code)
142+local function check
143+(ret,val)
144+local code = (code .. ret)
145+code=load(code)
146+assert((code() == val))
147+end
148+check("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{31}\u{20}\u{7e}\u{20}\u{28}\u{32}\u{20}\u{6f}\u{72}\u{20}\u{33}\u{29}\u{29}",(0x1 ~ 0x2))
149+check("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{31}\u{20}\u{7c}\u{20}\u{28}\u{32}\u{20}\u{6f}\u{72}\u{20}\u{33}\u{29}\u{29}",(0x1 | 0x2))
150+check("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{31}\u{20}\u{2b}\u{20}\u{28}\u{32}\u{20}\u{6f}\u{72}\u{20}\u{33}\u{29}\u{29}",(0x1 + 0x2))
151+check("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{28}\u{31}\u{20}\u{3c}\u{3c}\u{20}\u{28}\u{32}\u{20}\u{6f}\u{72}\u{20}\u{33}\u{29}\u{29}",(0x1 << 0x2))
152+end
153+local function f
154+(i)
155+if (type(i) ~= "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}") then
156+return i,"\u{6a}\u{6f}\u{6a}\u{6f}"
157+end
158+;
159+if (i > 0x0) then
160+return i,f((i - 0x1))
161+end
162+;
163+end
164+x={f(0x3),f(0x5),f(0xa)}
165+;
166+assert((((((x[0x1] == 0x3) and (x[0x2] == 0x5)) and (x[0x3] == 0xa)) and (x[0x4] == 0x9)) and (x[0xc] == 0x1)))
167+;
168+assert((x[nil] == nil))
169+x={f("\u{61}\u{6c}\u{6f}"),f("\u{78}\u{69}\u{78}\u{69}"),nil}
170+;
171+assert((((x[0x1] == "\u{61}\u{6c}\u{6f}") and (x[0x2] == "\u{78}\u{69}\u{78}\u{69}")) and (x[0x3] == nil)))
172+;
173+x={(f("\u{61}\u{6c}\u{6f}") .. "\u{78}\u{69}\u{78}\u{69}")}
174+;
175+assert((x[0x1] == "\u{61}\u{6c}\u{6f}\u{78}\u{69}\u{78}\u{69}"))
176+x={f({})}
177+assert(((x[0x2] == "\u{6a}\u{6f}\u{6a}\u{6f}") and (type(x[0x1]) == "\u{74}\u{61}\u{62}\u{6c}\u{65}")))
178+local f = function (i)
179+if (i < 0xa) then
180+return "\u{61}"
181+elseif (i < 0x14) then
182+return "\u{62}"
183+elseif (i < 0x1e) then
184+return "\u{63}"
185+end
186+;
187+end
188+assert(((((f(0x3) == "\u{61}") and (f(0xc) == "\u{62}")) and (f(0x1a) == "\u{63}")) and (f(0x64) == nil)))
189+for i = 0x1, 0x3e8
190+do
191+break
192+;
193+end
194+;
195+local n = 0x64
196+;
197+local i = 0x3
198+;
199+local t = {}
200+;
201+local a = nil
202+while (not a) do
203+a=0x0
204+;
205+for i = 0x1, n
206+do
207+for i = i, 0x1, (- 0x1)
208+do
209+a=(a + 0x1)
210+;
211+t[i]=0x1
212+;
213+end
214+;
215+end
216+;
217+end
218+assert(((a == ((n * (n + 0x1)) / 0x2)) and (i == 0x3)))
219+;
220+assert(((t[0x1] and t[n]) and (not (t[0x0] and (not t[(n + 0x1)])))))
221+function f(b)
222+local x = 0x1
223+;
224+repeat
225+local a
226+;
227+if (b == 0x1) then
228+local b = 0x1
229+;
230+x=0xa
231+;
232+break
233+elseif (b == 0x2) then
234+x=0x14
235+;
236+break
237+;
238+elseif (b == 0x3) then
239+x=0x1e
240+;
241+else
242+local a,b,c,d = math.sin(0x1)
243+;
244+x=(x + 0x1)
245+;
246+end
247+until (x >= 0xc)
248+;
249+return x
250+end
251+;
252+assert(((((f(0x1) == 0xa) and (f(0x2) == 0x14)) and (f(0x3) == 0x1e)) and (f(0x4) == 0xc)))
253+local f = function (i)
254+if (i < 0xa) then
255+return "\u{61}"
256+elseif (i < 0x14) then
257+return "\u{62}"
258+elseif (i < 0x1e) then
259+return "\u{63}"
260+else
261+return 0x8
262+end
263+end
264+assert(((((f(0x3) == "\u{61}") and (f(0xc) == "\u{62}")) and (f(0x1a) == "\u{63}")) and (f(0x64) == 0x8)))
265+local a,b = nil,0x17
266+x={(((f(0x64) * 0x2) + 0x3) or a),(a or (b + 0x2))}
267+assert(((x[0x1] == 0x13) and (x[0x2] == 0x19)))
268+x={["\u{66}"] = ((0x2 + 0x3) or a),["\u{61}"] = (b + 0x2)}
269+assert(((x.f == 0x5) and (x.a == 0x19)))
270+a={["\u{79}"] = 0x1}
271+x={a.y}
272+assert((x[0x1] == 0x1))
273+local function f
274+(i)
275+while 0x1 do
276+if (i > 0x0) then
277+i=(i - 0x1)
278+;
279+else
280+return
281+end
282+;
283+end
284+;
285+end
286+;
287+local function g
288+(i)
289+while 0x1 do
290+if (i > 0x0) then
291+i=(i - 0x1)
292+else
293+return
294+end
295+end
296+end
297+f(0xa)
298+;
299+g(0xa)
300+;
301+do
302+function f()
303+return 0x1,0x2,0x3
304+end
305+local a,b,c = f()
306+;
307+assert((((a == 0x1) and (b == 0x2)) and (c == 0x3)))
308+a,b,c=f()
309+;
310+assert((((a == 0x1) and (b == nil)) and (c == nil)))
311+end
312+local a,b = (0x3 and f())
313+;
314+assert(((a == 0x1) and (b == nil)))
315+function g()
316+f()
317+;
318+return
319+end
320+;
321+assert((g() == nil))
322+function g()
323+return (nil or f())
324+end
325+a,b=g()
326+assert(((a == 0x1) and (b == nil)))
327+print("\u{2b}")
328+;
329+do
330+local prog <const> = "\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3c}\u{58}\u{58}\u{58}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}"
331+checkload(prog,"\u{75}\u{6e}\u{6b}\u{6e}\u{6f}\u{77}\u{6e}\u{20}\u{61}\u{74}\u{74}\u{72}\u{69}\u{62}\u{75}\u{74}\u{65}\u{20}\u{27}\u{58}\u{58}\u{58}\u{27}")
332+checkload("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{78}\u{78}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{78}\u{78}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{30}","\u{3a}\u{31}\u{3a}\u{20}\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{61}\u{73}\u{73}\u{69}\u{67}\u{6e}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{27}\u{78}\u{78}\u{78}\u{27}")
333+checkload("\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{78}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{78}\u{78}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{32}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{79}\u{79}\u{79}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{62}\u{63}\u{20}\u{3d}\u{20}\u{78}\u{78}\u{20}\u{2b}\u{20}\u{79}\u{79}\u{79}\u{20}\u{2b}\u{20}\u{78}\u{78}\u{78}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{78}\u{78}\u{78}\u{20}\u{3d}\u{20}\u{79}\u{79}\u{79}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}","\u{3a}\u{36}\u{3a}\u{20}\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{61}\u{73}\u{73}\u{69}\u{67}\u{6e}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{27}\u{78}\u{78}\u{78}\u{27}")
334+checkload("\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3c}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{3e}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{20}\u{20}\u{20}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{69}\u{6f}\u{2e}\u{6f}\u{70}\u{65}\u{6e}\u{28}\u{29}\u{a}\u{20}\u{20}","\u{3a}\u{32}\u{3a}\u{20}\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{61}\u{73}\u{73}\u{69}\u{67}\u{6e}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{27}\u{78}\u{27}")
335+end
336+f="\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{20}\u{61}\u{20}\u{2c}\u{20}\u{62}\u{20}\u{2c}\u{20}\u{63}\u{20}\u{2c}\u{20}\u{64}\u{20}\u{2c}\u{20}\u{65}\u{20}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{3e}\u{3d}\u{20}\u{62}\u{20}\u{6f}\u{72}\u{20}\u{63}\u{20}\u{6f}\u{72}\u{20}\u{28}\u{20}\u{64}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{65}\u{20}\u{29}\u{20}\u{6f}\u{72}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{a}\u{65}\u{6e}\u{64}\u{20}\u{2c}\u{20}\u{7b}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{20}\u{2c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{32}\u{20}\u{3e}\u{3d}\u{20}\u{31}\u{20}\u{2c}\u{20}\u{7d}\u{20}\u{6f}\u{72}\u{20}\u{7b}\u{20}\u{31}\u{20}\u{7d}\u{3b}\u{a}"
337+f=string.gsub(f,"\u{25}\u{73}\u{2b}","\u{a}")
338+;
339+f,a=load(f)()
340+;
341+assert(((a.a == 0x1) and a.b))
342+function g(a,b,c,d,e)
343+if (not ((((a >= b) or c) or (d and e)) or nil)) then
344+return 0x0
345+else
346+return 0x1
347+end
348+;
349+end
350+local function h
351+(a,b,c,d,e)
352+while ((((a >= b) or c) or (d and e)) or nil) do
353+return 0x1
354+end
355+;
356+return 0x0
357+end
358+;
359+assert((((f(0x2,0x1) == true) and (g(0x2,0x1) == 0x1)) and (h(0x2,0x1) == 0x1)))
360+assert((((f(0x1,0x2,"\u{61}") == "\u{61}") and (g(0x1,0x2,"\u{61}") == 0x1)) and (h(0x1,0x2,"\u{61}") == 0x1)))
361+assert((f(0x1,0x2,"\u{61}") ~= nil),"")
362+assert((((f(0x1,0x2,"\u{61}") == "\u{61}") and (g(0x1,0x2,"\u{61}") == 0x1)) and (h(0x1,0x2,"\u{61}") == 0x1)))
363+assert((((f(0x1,0x2,nil,0x1,"\u{78}") == "\u{78}") and (g(0x1,0x2,nil,0x1,"\u{78}") == 0x1)) and (h(0x1,0x2,nil,0x1,"\u{78}") == 0x1)))
364+assert((((f(0x1,0x2,nil,nil,"\u{78}") == nil) and (g(0x1,0x2,nil,nil,"\u{78}") == 0x0)) and (h(0x1,0x2,nil,nil,"\u{78}") == 0x0)))
365+assert((((f(0x1,0x2,nil,0x1,nil) == nil) and (g(0x1,0x2,nil,0x1,nil) == 0x0)) and (h(0x1,0x2,nil,0x1,nil) == 0x0)))
366+assert((((0x1 and ((0x2 < 0x3) == true)) and (0x2 < 0x3)) and (("\u{61}" < "\u{62}") == true)))
367+x=((0x2 < 0x3) and (not 0x3))
368+;
369+assert((x == false))
370+x=((0x2 < 0x1) or ((0x2 > 0x1) and "\u{61}"))
371+;
372+assert((x == "\u{61}"))
373+do
374+local a
375+;
376+if nil then
377+a=0x1
378+;
379+else
380+a=0x2
381+;
382+end
383+;
384+assert((a == 0x2))
385+end
386+local function F
387+(a)
388+assert((debug.getinfo(0x1,"\u{6e}").name == "\u{46}"))
389+return a,0x2,0x3
390+end
391+a,b=(F(0x1) ~= nil)
392+;
393+assert(((a == true) and (b == nil)))
394+;
395+a,b=(F(nil) == nil)
396+;
397+assert(((a == true) and (b == nil)))
398+_ENV.GLOB1=math.random(0x0,0x1)
399+local basiccases = {{"\u{6e}\u{69}\u{6c}",nil},{"\u{66}\u{61}\u{6c}\u{73}\u{65}",false},{"\u{74}\u{72}\u{75}\u{65}",true},{"\u{31}\u{30}",0xa},{"\u{28}\u{30}\u{3d}\u{3d}\u{5f}\u{45}\u{4e}\u{56}\u{2e}\u{47}\u{4c}\u{4f}\u{42}\u{31}\u{29}",(0x0 == _ENV.GLOB1)}}
400+local prog
401+if (_ENV.GLOB1 == 0x0) then
402+basiccases[0x2][0x1]="\u{46}"
403+prog="\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{46}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{66}\u{61}\u{6c}\u{73}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{25}\u{73}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{49}\u{58}\u{20}\u{3d}\u{20}\u{74}\u{72}\u{75}\u{65}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{73}\u{a}"
404+else
405+basiccases[0x4][0x1]="\u{6b}\u{31}\u{30}"
406+prog="\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{6b}\u{31}\u{30}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{25}\u{73}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{49}\u{58}\u{20}\u{3d}\u{20}\u{74}\u{72}\u{75}\u{65}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{73}\u{a}\u{20}\u{20}"
407+end
408+print(("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{68}\u{6f}\u{72}\u{74}\u{2d}\u{63}\u{69}\u{72}\u{63}\u{75}\u{69}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6d}\u{69}\u{7a}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{20}\u{28}" .. (_ENV.GLOB1 .. "\u{29}")))
409+local binops <const> = {{"\u{20}\u{61}\u{6e}\u{64}\u{20}",function (a,b)
410+if (not a) then
411+return a
412+else
413+return b
414+end
415+end},{"\u{20}\u{6f}\u{72}\u{20}",function (a,b)
416+if a then
417+return a
418+else
419+return b
420+end
421+end}}
422+local cases <const> = {}
423+local function createcases
424+(n)
425+local res = {}
426+for i = 0x1, (n - 0x1)
427+do
428+for _,v1 in ipairs(cases[i])
429+do
430+for _,v2 in ipairs(cases[(n - i)])
431+do
432+for _,op in ipairs(binops)
433+do
434+local t = {("\u{28}" .. (v1[0x1] .. (op[0x1] .. (v2[0x1] .. "\u{29}")))),op[0x2](v1[0x2],v2[0x2])}
435+res[(# (res + 0x1))]=t
436+res[(# (res + 0x1))]={("\u{6e}\u{6f}\u{74}" .. t[0x1]),(not t[0x2])}
437+end
438+end
439+end
440+end
441+return res
442+end
443+local level = ((_soft and 0x3) or 0x4)
444+cases[0x1]=basiccases
445+for i = 0x2, level
446+do
447+cases[i]=createcases(i)
448+end
449+print("\u{2b}")
450+local i = 0x0
451+for n = 0x1, level
452+do
453+for _,v in pairs(cases[n])
454+do
455+local s = v[0x1]
456+local p = load(string.format(prog,s,s),"")
457+IX=false
458+assert(((p() == v[0x2]) and (IX == (not (not v[0x2])))))
459+i=(i + 0x1)
460+if ((i % 0xea60) == 0x0) then
461+print("\u{2b}")
462+end
463+end
464+end
465+IX=nil
466+_G.GLOB1=nil
467+checkload("\u{66}\u{6f}\u{72}\u{20}\u{78}\u{20}\u{64}\u{6f}","\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}")
468+checkload("\u{78}\u{3a}\u{63}\u{61}\u{6c}\u{6c}","\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}")
469+print("\u{4f}\u{4b}")
desk/res/lua/cycled/coroutine.luanew file+1119
@@ -0,0 +1,1119 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+local f
4+local main,ismain = coroutine.running()
5+assert(((type(main) == "\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}") and ismain))
6+assert((not coroutine.resume(main)))
7+assert((not (coroutine.isyieldable(main) and (not coroutine.isyieldable()))))
8+assert((not pcall(coroutine.yield)))
9+assert((not pcall(coroutine.resume,0x0)))
10+assert((not pcall(coroutine.status,0x0)))
11+local function eqtab
12+(t1,t2)
13+assert((# (t1 == (# t2))))
14+for i = 0x1, (# t1)
15+do
16+local v = t1[i]
17+assert((t2[i] == v))
18+end
19+end
20+_G.x=nil
21+_G.f=nil
22+local function foo
23+(a, ...)
24+local x,y = coroutine.running()
25+assert(((x == f) and (y == false)))
26+assert((coroutine.resume(f) == false))
27+assert((coroutine.status(f) == "\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
28+local arg = {...}
29+assert(coroutine.isyieldable(x))
30+for i = 0x1, (# arg)
31+do
32+_G.x={coroutine.yield(table.unpack(arg[i]))}
33+end
34+return table.unpack(a)
35+end
36+f=coroutine.create(foo)
37+assert(coroutine.isyieldable(f))
38+assert(((type(f) == "\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}") and (coroutine.status(f) == "\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}")))
39+assert(string.find(tostring(f),"\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}"))
40+local s,a,b,c,d
41+s,a,b,c,d=coroutine.resume(f,{0x1,0x2,0x3},{},{0x1},{"\u{61}","\u{62}","\u{63}"})
42+assert(coroutine.isyieldable(f))
43+assert(((s and (a == nil)) and (coroutine.status(f) == "\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}")))
44+s,a,b,c,d=coroutine.resume(f)
45+eqtab(_G.x,{})
46+assert(((s and (a == 0x1)) and (b == nil)))
47+assert(coroutine.isyieldable(f))
48+s,a,b,c,d=coroutine.resume(f,0x1,0x2,0x3)
49+eqtab(_G.x,{0x1,0x2,0x3})
50+assert(((((s and (a == "\u{61}")) and (b == "\u{62}")) and (c == "\u{63}")) and (d == nil)))
51+s,a,b,c,d=coroutine.resume(f,"\u{78}\u{75}\u{78}\u{75}")
52+eqtab(_G.x,{"\u{78}\u{75}\u{78}\u{75}"})
53+assert(((((s and (a == 0x1)) and (b == 0x2)) and (c == 0x3)) and (d == nil)))
54+assert((coroutine.status(f) == "\u{64}\u{65}\u{61}\u{64}"))
55+s,a=coroutine.resume(f,"\u{78}\u{75}\u{78}\u{75}")
56+assert((not ((s and string.find(a,"\u{64}\u{65}\u{61}\u{64}")) and (coroutine.status(f) == "\u{64}\u{65}\u{61}\u{64}"))))
57+_G.f=nil
58+local function foo
59+(i)
60+return coroutine.yield(i)
61+end
62+local f = coroutine.wrap(function ()
63+for i = 0x1, 0xa
64+do
65+assert((foo(i) == _G.x))
66+end
67+return "\u{61}"
68+end)
69+for i = 0x1, 0xa
70+do
71+_G.x=i
72+;
73+assert((f(i) == i))
74+end
75+_G.x="\u{78}\u{75}\u{78}\u{75}"
76+;
77+assert((f("\u{78}\u{75}\u{78}\u{75}") == "\u{61}"))
78+_G.x=nil
79+local function pf
80+(n,i)
81+coroutine.yield(n)
82+pf((n * i),(i + 0x1))
83+end
84+f=coroutine.wrap(pf)
85+local s = 0x1
86+for i = 0x1, 0xa
87+do
88+assert((f(0x1,0x1) == s))
89+s=(s * i)
90+end
91+local function gen
92+(n)
93+return coroutine.wrap(function ()
94+for i = 0x2, n
95+do
96+coroutine.yield(i)
97+end
98+end)
99+end
100+local function filter
101+(p,g)
102+return coroutine.wrap(function ()
103+while 0x1 do
104+local n = g()
105+if (n == nil) then
106+return
107+end
108+if (math.fmod(n,p) ~= 0x0) then
109+coroutine.yield(n)
110+end
111+end
112+end)
113+end
114+local x = gen(0x50)
115+local a = {}
116+while 0x1 do
117+local n = x()
118+if (n == nil) then
119+break
120+end
121+table.insert(a,n)
122+x=filter(n,x)
123+end
124+assert((# ((a == 0x16) and (a[(# a)] == 0x4f))))
125+x,a=nil
126+print("\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}")
127+local function func2close
128+(f)
129+return setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = f})
130+end
131+do
132+local co = coroutine.create(print)
133+assert(coroutine.resume(co,"\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{27}"))
134+assert((coroutine.status(co) == "\u{64}\u{65}\u{61}\u{64}"))
135+local st,msg = coroutine.close(co)
136+assert((st and (msg == nil)))
137+st,msg=coroutine.close(co)
138+assert((st and (msg == nil)))
139+local st,msg = pcall(coroutine.close,coroutine.running())
140+assert((not (st and string.find(msg,"\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))))
141+local main = coroutine.running()
142+;
143+(coroutine.wrap(function ()
144+local st,msg = pcall(coroutine.close,main)
145+assert((not (st and string.find(msg,"\u{6e}\u{6f}\u{72}\u{6d}\u{61}\u{6c}"))))
146+end))()
147+do
148+local co
149+co=coroutine.create(function ()
150+local x <close> = func2close(function ()
151+coroutine.close(co)
152+end)
153+coroutine.yield(0x14)
154+end)
155+local st,msg = coroutine.resume(co)
156+assert((st and (msg == 0x14)))
157+st,msg=coroutine.close(co)
158+assert((not (st and string.find(msg,"\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}"))))
159+end
160+local X
161+local co = coroutine.create(error)
162+local st,msg = coroutine.resume(co,0x64)
163+assert((not (st and (msg == 0x64))))
164+st,msg=coroutine.close(co)
165+assert((not (st and (msg == 0x64))))
166+st,msg=coroutine.close(co)
167+assert((st and (msg == nil)))
168+co=coroutine.create(function ()
169+local x <close> = func2close(function (self,err)
170+assert((err == nil))
171+;
172+X=false
173+end)
174+X=true
175+coroutine.yield()
176+end)
177+coroutine.resume(co)
178+assert(X)
179+assert(coroutine.close(co))
180+assert((not (X and (coroutine.status(co) == "\u{64}\u{65}\u{61}\u{64}"))))
181+local x = 0x0
182+co=coroutine.create(function ()
183+local y <close> = func2close(function (self,err)
184+assert((err == 0x6f))
185+x=0xc8
186+error(0xc8)
187+end)
188+local x <close> = func2close(function (self,err)
189+assert((err == nil))
190+;
191+error(0x6f)
192+end)
193+coroutine.yield()
194+end)
195+coroutine.resume(co)
196+assert((x == 0x0))
197+local st,msg = coroutine.close(co)
198+assert((((st == false) and (coroutine.status(co) == "\u{64}\u{65}\u{61}\u{64}")) and (msg == 0xc8)))
199+assert((x == 0xc8))
200+st,msg=coroutine.close(co)
201+assert((st and (msg == nil)))
202+end
203+do
204+local X = false
205+local Y = false
206+local function foo
207+()
208+local x <close> = func2close(function (self,err)
209+Y=debug.getinfo(0x2)
210+X=err
211+end)
212+error(0x2b)
213+end
214+local co = coroutine.create(function ()
215+return pcall(foo)
216+end)
217+local st1,st2,err = coroutine.resume(co)
218+assert((st1 and (not (st2 and (err == 0x2b)))))
219+assert(((X == 0x2b) and (Y.what == "\u{43}")))
220+local track = {}
221+local function h
222+(o)
223+local hv <close> = o
224+return 0x1
225+end
226+local function foo
227+()
228+local x <close> = func2close(function (_,msg)
229+track[(# (track + 0x1))]=(msg or false)
230+error(0x14)
231+end)
232+local y <close> = func2close(function (_,msg)
233+track[(# (track + 0x1))]=(msg or false)
234+return 0x3e8
235+end)
236+local z <close> = func2close(function (_,msg)
237+track[(# (track + 0x1))]=(msg or false)
238+error(0xa)
239+end)
240+coroutine.yield(0x1)
241+h(func2close(function (_,msg)
242+track[(# (track + 0x1))]=(msg or false)
243+error(0x2)
244+end))
245+end
246+local co = coroutine.create(pcall)
247+local st,res = coroutine.resume(co,foo)
248+assert((st and (res == 0x1)))
249+local st,res1,res2 = coroutine.resume(co)
250+assert((coroutine.status(co) == "\u{64}\u{65}\u{61}\u{64}"))
251+assert((st and (not (res1 and (res2 == 0x14)))))
252+assert(((((track[0x1] == false) and (track[0x2] == 0x2)) and (track[0x3] == 0xa)) and (track[0x4] == 0xa)))
253+end
254+local co = coroutine.wrap(function ()
255+assert((not pcall(table.sort,{0x1,0x2,0x3},coroutine.yield)))
256+assert(coroutine.isyieldable())
257+coroutine.yield(0x14)
258+return 0x1e
259+end)
260+assert((co() == 0x14))
261+assert((co() == 0x1e))
262+local f = function (s,i)
263+return coroutine.yield(i)
264+end
265+local f1 = coroutine.wrap(function ()
266+return xpcall(pcall,function (...)
267+return ...
268+end,function ()
269+local s = 0x0
270+for i in f,nil,0x1
271+do
272+pcall(function ()
273+s=(s + i)
274+end)
275+end
276+error({s})
277+end)
278+end)
279+f1()
280+for i = 0x1, 0xa
281+do
282+assert((f1(i) == i))
283+end
284+local r1,r2,v = f1(nil)
285+assert((r1 and (not (r2 and (v[0x1] == (((0xa + 0x1) * 0xa) / 0x2))))))
286+local function f
287+(a,b)
288+a=coroutine.yield(a)
289+;
290+error({(a + b)})
291+end
292+local function g
293+(x)
294+return (x[0x1] * 0x2)
295+end
296+co=coroutine.wrap(function ()
297+coroutine.yield(xpcall(f,g,0xa,0x14))
298+end)
299+assert((co() == 0xa))
300+local r,msg = co(0x64)
301+assert((not (r and (msg == 0xf0))))
302+do
303+local function f
304+(c)
305+assert((not coroutine.isyieldable()))
306+return (c .. c)
307+end
308+local co = coroutine.wrap(function (c)
309+assert(coroutine.isyieldable())
310+local s = string.gsub("\u{61}","\u{2e}",f)
311+return s
312+end)
313+assert((co() == "\u{61}\u{61}"))
314+end
315+do
316+local X
317+local co = coroutine.create(function ()
318+coroutine.yield(0xa)
319+return 0x14
320+end)
321+local trace = {}
322+local function dotrace
323+(event)
324+trace[(# (trace + 0x1))]=event
325+end
326+debug.sethook(co,dotrace,"\u{63}\u{6c}\u{72}")
327+repeat
328+
329+until (not coroutine.resume(co))
330+local correcttrace = {"\u{63}\u{61}\u{6c}\u{6c}","\u{6c}\u{69}\u{6e}\u{65}","\u{63}\u{61}\u{6c}\u{6c}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}","\u{6c}\u{69}\u{6e}\u{65}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}"}
331+assert((# (trace == (# correcttrace))))
332+for k,v in pairs(trace)
333+do
334+assert((v == correcttrace[k]))
335+end
336+end
337+function foo()
338+assert((debug.getinfo(0x1).currentline == (debug.getinfo(foo).linedefined + 0x1)))
339+assert((debug.getinfo(0x2).currentline == debug.getinfo(goo).linedefined))
340+coroutine.yield(0x3)
341+error(foo)
342+end
343+function goo()
344+foo()
345+end
346+x=coroutine.wrap(goo)
347+assert((x() == 0x3))
348+local a,b = pcall(x)
349+assert((not (a and (b == foo))))
350+x=coroutine.create(goo)
351+a,b=coroutine.resume(x)
352+assert((a and (b == 0x3)))
353+a,b=coroutine.resume(x)
354+assert((not ((a and (b == foo)) and (coroutine.status(x) == "\u{64}\u{65}\u{61}\u{64}"))))
355+a,b=coroutine.resume(x)
356+assert((not ((a and string.find(b,"\u{64}\u{65}\u{61}\u{64}")) and (coroutine.status(x) == "\u{64}\u{65}\u{61}\u{64}"))))
357+goo=nil
358+local function all
359+(a,n,k)
360+if (k == 0x0) then
361+coroutine.yield(a)
362+else
363+for i = 0x1, n
364+do
365+a[k]=i
366+all(a,n,(k - 0x1))
367+end
368+end
369+end
370+local a = 0x0
371+for t in coroutine.wrap(function ()
372+all({},0x5,0x4)
373+end)
374+do
375+a=(a + 0x1)
376+end
377+assert((a == (0x5 ^ 0x4)))
378+local C = {}
379+;
380+setmetatable(C,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
381+local x = coroutine.wrap(function ()
382+local a = 0xa
383+local function f
384+()
385+a=(a + 0xa)
386+;
387+return a
388+end
389+while true do
390+a=(a + 0x1)
391+coroutine.yield(f)
392+end
393+end)
394+C[0x1]=x
395+;
396+local f = x()
397+assert((((f() == 0x15) and (x()() == 0x20)) and (x() == f)))
398+x=nil
399+collectgarbage()
400+assert((C[0x1] == undef))
401+assert(((f() == 0x2b) and (f() == 0x35)))
402+local function co_func
403+(current_co)
404+assert((coroutine.running() == current_co))
405+assert((coroutine.resume(current_co) == false))
406+coroutine.yield(0xa,0x14)
407+assert((coroutine.resume(current_co) == false))
408+coroutine.yield(0x17)
409+return 0xa
410+end
411+local co = coroutine.create(co_func)
412+local a,b,c = coroutine.resume(co,co)
413+assert((((a == true) and (b == 0xa)) and (c == 0x14)))
414+a,b=coroutine.resume(co,co)
415+assert(((a == true) and (b == 0x17)))
416+a,b=coroutine.resume(co,co)
417+assert(((a == true) and (b == 0xa)))
418+assert((coroutine.resume(co,co) == false))
419+assert((coroutine.resume(co,co) == false))
420+do
421+local A = coroutine.running()
422+local B = coroutine.create(function ()
423+return coroutine.resume(A)
424+end)
425+local st,res = coroutine.resume(B)
426+assert(((st == true) and (res == false)))
427+local X = false
428+A=coroutine.wrap(function ()
429+local _ <close> = func2close(function ()
430+X=true
431+end)
432+return pcall(A,0x1)
433+end)
434+st,res=A()
435+assert((not ((st and string.find(res,"\u{6e}\u{6f}\u{6e}\u{25}\u{2d}\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}")) and (X == true))))
436+end
437+do
438+local co
439+co=coroutine.wrap(function ()
440+local x <close> = func2close(function ()
441+return pcall(co)
442+end)
443+error(0x6f)
444+end)
445+local st,errobj = pcall(co)
446+assert((not (st and (errobj == 0x6f))))
447+st,errobj=pcall(co)
448+assert((not (st and string.find(errobj,"\u{64}\u{65}\u{61}\u{64}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}"))))
449+end
450+local co1,co2
451+co1=coroutine.create(function ()
452+return co2()
453+end)
454+co2=coroutine.wrap(function ()
455+assert((coroutine.status(co1) == "\u{6e}\u{6f}\u{72}\u{6d}\u{61}\u{6c}"))
456+assert((not coroutine.resume(co1)))
457+coroutine.yield(0x3)
458+end)
459+a,b=coroutine.resume(co1)
460+assert((a and (b == 0x3)))
461+assert((coroutine.status(co1) == "\u{64}\u{65}\u{61}\u{64}"))
462+a=function (a)
463+coroutine.wrap(a)(a)
464+end
465+assert((not pcall(a,a)))
466+a=nil
467+local x = coroutine.create(function ()
468+local a = 0xa
469+_G.F=function ()
470+a=(a + 0x1)
471+;
472+return a
473+end
474+error("\u{78}")
475+end)
476+assert((not coroutine.resume(x)))
477+assert((not coroutine.resume(x,0x1,0x1,0x1,0x1,0x1,0x1,0x1)))
478+assert((_G.F() == 0xb))
479+assert((_G.F() == 0xc))
480+_G.F=nil
481+if (not T) then
482+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{41}\u{50}\u{49}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
483+else
484+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{73}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{68}\u{6f}\u{6f}\u{6b}\u{73}")
485+local turn
486+local function fact
487+(t,x)
488+assert((turn == t))
489+if (x == 0x0) then
490+return 0x1
491+else
492+return (x * fact(t,(x - 0x1)))
493+end
494+end
495+local A,B = 0x0,0x0
496+local x = coroutine.create(function ()
497+T.sethook("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","",0x2)
498+A=fact("\u{41}",0x6)
499+end)
500+local y = coroutine.create(function ()
501+T.sethook("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","",0x3)
502+B=fact("\u{42}",0x7)
503+end)
504+while ((A == 0x0) or (B == 0x0)) do
505+if (A == 0x0) then
506+turn="\u{41}"
507+;
508+assert(T.resume(x))
509+end
510+if (B == 0x0) then
511+turn="\u{42}"
512+;
513+assert(T.resume(y))
514+end
515+debug.traceback(x)
516+debug.traceback(y)
517+end
518+assert(((B // A) == 0x7))
519+do
520+local done
521+local function test
522+(n)
523+done=false
524+return coroutine.wrap(function ()
525+local a = {}
526+for i = 0x1, n
527+do
528+a[i]=i
529+end
530+T.sethook("\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","",0x1)
531+local a1 = {table.unpack(a)}
532+assert((# (a1 == n)))
533+for i = 0x1, n
534+do
535+assert((a[i] == i))
536+end
537+done=true
538+end)
539+end
540+local co = test(0x0)
541+;
542+while (not done) do
543+co(0x1e)
544+end
545+co=test(0x1)
546+;
547+while (not done) do
548+co(0x14,0xa)
549+end
550+co=test(0x3)
551+;
552+while (not done) do
553+co()
554+end
555+co=test(0x64)
556+;
557+while (not done) do
558+co()
559+end
560+end
561+local line = (debug.getinfo(0x1,"\u{6c}").currentline + 0x2)
562+local function foo
563+()
564+local x = 0xa
565+x=(x + 0xa)
566+_G.XX=x
567+end
568+local co = coroutine.wrap(function ()
569+T.sethook("\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{58}\u{3b}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","\u{6c}",0x0)
570+;
571+foo()
572+;
573+return 0xa
574+end)
575+_G.XX=nil
576+;
577+_G.X=nil
578+;
579+co()
580+;
581+assert((_G.X == line))
582+_G.X=nil
583+;
584+co()
585+;
586+assert((_G.X == (line + 0x1)))
587+_G.X=nil
588+;
589+co()
590+;
591+assert(((_G.X == (line + 0x2)) and (_G.XX == nil)))
592+_G.X=nil
593+;
594+co()
595+;
596+assert(((_G.X == (line + 0x3)) and (_G.XX == 0x14)))
597+assert((co() == 0xa))
598+_G.X=nil
599+co=coroutine.wrap(function ()
600+T.sethook("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","",0x1)
601+;
602+foo()
603+;
604+return 0xa
605+end)
606+_G.XX=nil
607+;
608+local c = 0x0
609+repeat
610+c=(c + 0x1)
611+;
612+local a = co()
613+until (a == 0xa)
614+assert(((_G.XX == 0x14) and (c >= 0x5)))
615+co=coroutine.wrap(function ()
616+T.sethook("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","",0x2)
617+;
618+foo()
619+;
620+return 0xa
621+end)
622+_G.XX=nil
623+;
624+local c = 0x0
625+repeat
626+c=(c + 0x1)
627+;
628+local a = co()
629+until (a == 0xa)
630+assert(((_G.XX == 0x14) and (c >= 0x5)))
631+_G.X=nil
632+;
633+_G.XX=nil
634+do
635+c=coroutine.create(function (a, ...)
636+T.sethook("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{30}","\u{6c}")
637+local b = a
638+return ...
639+end)
640+assert(coroutine.resume(c,0x1,0x2,0x3))
641+local n,v = debug.getlocal(c,0x0,0x1)
642+assert((((n == "\u{61}") and (v == 0x1)) and (debug.getlocal(c,0x0,0x2) ~= "\u{62}")))
643+assert(debug.setlocal(c,0x0,0x1,0xa))
644+local t = debug.getinfo(c,0x0)
645+assert((t.currentline == (t.linedefined + 0x2)))
646+assert((not debug.getinfo(c,0x1)))
647+assert(coroutine.resume(c))
648+local n,v = debug.getlocal(c,0x0,0x2)
649+assert(((n == "\u{62}") and (v == 0xa)))
650+v={coroutine.resume(c)}
651+assert(((((v[0x1] == true) and (v[0x2] == 0x2)) and (v[0x3] == 0x3)) and (v[0x4] == undef)))
652+assert((not coroutine.resume(c)))
653+end
654+do
655+local c = coroutine.create(function ()
656+T.testC("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{31}",0xa,0x14)
657+end)
658+local a,b = coroutine.resume(c)
659+assert((a and (b == 0x14)))
660+assert((debug.getinfo(c,0x0).linedefined == (- 0x1)))
661+a,b=debug.getlocal(c,0x0,0x2)
662+assert((b == 0xa))
663+end
664+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{41}\u{50}\u{49}")
665+assert((T.testC("\u{20}\u{20}\u{20}\u{20}\u{6e}\u{65}\u{77}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{75}\u{73}\u{68}\u{20}\u{62}\u{6f}\u{64}\u{79}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{61}\u{20}\u{61}\u{20}\u{61}\u{27}\u{20}\u{20}\u{23}\u{20}\u{70}\u{75}\u{73}\u{68}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{a}\u{20}\u{20}\u{20}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{30}\u{20}\u{33}\u{20}\u{32}\u{20}\u{20}\u{20}\u{23}\u{20}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}\u{20}\u{74}\u{6f}\u{20}\u{6e}\u{65}\u{77}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{2d}\u{31}\u{2c}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{74}\u{20}\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{33}\u{20}\u{30}\u{20}\u{30}\u{20}\u{20}\u{20}\u{23}\u{20}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}\u{20}\u{62}\u{61}\u{63}\u{6b}\u{20}\u{74}\u{6f}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{58}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{59}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{75}\u{73}\u{68}\u{20}\u{62}\u{6f}\u{64}\u{79}\u{20}\u{28}\u{74}\u{6f}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{74}\u{20}\u{61}\u{67}\u{61}\u{69}\u{6e}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{62}\u{20}\u{62}\u{20}\u{62}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{30}\u{20}\u{33}\u{20}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{2d}\u{31}\u{2c}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{74}\u{20}\u{61}\u{67}\u{61}\u{69}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{33}\u{20}\u{30}\u{20}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{a}\u{20}\u{20}",function (...)
666+return ...
667+end) == "\u{62}\u{20}\u{62}\u{20}\u{62}"))
668+assert(((X == "\u{61}\u{20}\u{61}\u{20}\u{61}") and (Y == "\u{4f}\u{4b}")))
669+X,Y=nil
670+C=coroutine.create(function ()
671+return T.testC("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{2d}\u{33}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",C)
672+end)
673+local a,b,c,d = coroutine.resume(C)
674+assert(((((a == true) and string.find(b,"\u{6e}\u{6f}\u{6e}\u{25}\u{2d}\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}")) and (c == "\u{45}\u{52}\u{52}\u{52}\u{55}\u{4e}")) and (d == 0x4)))
675+a,b,c,d=T.testC("\u{20}\u{20}\u{20}\u{20}\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{67}\u{65}\u{74}\u{20}\u{6d}\u{61}\u{69}\u{6e}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{2d}\u{33}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{34}")
676+assert(((((a == coroutine.running()) and string.find(b,"\u{6e}\u{6f}\u{6e}\u{25}\u{2d}\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}")) and (c == "\u{45}\u{52}\u{52}\u{52}\u{55}\u{4e}")) and (d == 0x4)))
677+local state = T.newstate()
678+assert(T.testC(state,"\u{6e}\u{65}\u{77}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{3b}\u{20}\u{69}\u{73}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"))
679+assert((not T.testC(state,"\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{31}\u{3b}\u{20}\u{69}\u{73}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}")))
680+T.testC(state,"\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{30}")
681+T.loadlib(state)
682+assert(T.doremote(state,"\u{20}\u{20}\u{20}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{27}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{58}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{78}\u{29}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{28}\u{78}\u{2c}\u{20}\u{27}\u{42}\u{42}\u{27}\u{29}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{43}\u{43}\u{27}\u{20}\u{65}\u{6e}\u{64}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{6f}\u{6b}\u{27}"))
683+local t = table.pack(T.testC(state,"\u{20}\u{20}\u{20}\u{20}\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{67}\u{65}\u{74}\u{20}\u{6d}\u{61}\u{69}\u{6e}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{58}\u{58}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{58}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{67}\u{65}\u{74}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{62}\u{6f}\u{64}\u{79}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{41}\u{41}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{61}\u{72}\u{67}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{31}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{27}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{27}\u{20}\u{73}\u{68}\u{61}\u{64}\u{6f}\u{77}\u{73}\u{20}\u{70}\u{72}\u{65}\u{76}\u{69}\u{6f}\u{75}\u{73}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{21}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{54}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{6f}\u{70}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{42}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{65}\u{64}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{73}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{41}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{66}\u{69}\u{73}\u{74}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{65}\u{64}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{61}\u{77}\u{67}\u{65}\u{74}\u{69}\u{20}\u{52}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{67}\u{65}\u{74}\u{20}\u{6d}\u{61}\u{69}\u{6e}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{35}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{61}\u{72}\u{67}\u{20}\u{28}\u{6e}\u{6f}\u{69}\u{73}\u{65}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{31}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{61}\u{66}\u{74}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{65}\u{6e}\u{64}\u{73}\u{2c}\u{20}\u{70}\u{72}\u{65}\u{76}\u{69}\u{6f}\u{75}\u{73}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{69}\u{73}\u{20}\u{62}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}\u{a}\u{20}\u{20}"))
684+assert(((((t.n == 0x4) and (t[0x2] == "\u{58}\u{58}")) and (t[0x3] == "\u{43}\u{43}")) and (t[0x4] == "\u{4f}\u{4b}")))
685+assert((T.doremote(state,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{54}") == "\u{32}"))
686+assert((T.doremote(state,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{41}") == "\u{41}\u{41}"))
687+assert((T.doremote(state,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{42}") == "\u{42}\u{42}"))
688+T.closestate(state)
689+print("\u{2b}")
690+end
691+_G.TO_SURVIVE=coroutine.wrap(function ()
692+local a = 0xa
693+local x = function ()
694+a=(a + 0x1)
695+end
696+coroutine.yield()
697+end)
698+_G.TO_SURVIVE()
699+if (not _soft) then
700+local lim = 0xf4240
701+local t = {(lim - 0xa),(lim - 0x5),(lim - 0x1),lim,(lim + 0x1),(lim + 0x5)}
702+for i = 0x1, (# t)
703+do
704+local j = t[i]
705+local co = coroutine.create(function ()
706+return table.unpack({},0x1,j)
707+end)
708+local r,msg = coroutine.resume(co)
709+assert(((j < lim) or (not r)))
710+end
711+end
712+assert((coroutine.running() == main))
713+print("\u{2b}")
714+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{73}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{73}")
715+local function val
716+(x)
717+if (type(x) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
718+return x.x
719+else
720+return x
721+end
722+end
723+local mt = {["\u{5f}\u{5f}\u{65}\u{71}"] = function (a,b)
724+coroutine.yield(nil,"\u{65}\u{71}")
725+;
726+return (val(a) == val(b))
727+end,["\u{5f}\u{5f}\u{6c}\u{74}"] = function (a,b)
728+coroutine.yield(nil,"\u{6c}\u{74}")
729+;
730+return (val(a) < val(b))
731+end,["\u{5f}\u{5f}\u{6c}\u{65}"] = function (a,b)
732+coroutine.yield(nil,"\u{6c}\u{65}")
733+;
734+return ((a - b) <= 0x0)
735+end,["\u{5f}\u{5f}\u{61}\u{64}\u{64}"] = function (a,b)
736+coroutine.yield(nil,"\u{61}\u{64}\u{64}")
737+;
738+return (val(a) + val(b))
739+end,["\u{5f}\u{5f}\u{73}\u{75}\u{62}"] = function (a,b)
740+coroutine.yield(nil,"\u{73}\u{75}\u{62}")
741+;
742+return (val(a) - val(b))
743+end,["\u{5f}\u{5f}\u{6d}\u{75}\u{6c}"] = function (a,b)
744+coroutine.yield(nil,"\u{6d}\u{75}\u{6c}")
745+;
746+return (val(a) * val(b))
747+end,["\u{5f}\u{5f}\u{64}\u{69}\u{76}"] = function (a,b)
748+coroutine.yield(nil,"\u{64}\u{69}\u{76}")
749+;
750+return (val(a) / val(b))
751+end,["\u{5f}\u{5f}\u{69}\u{64}\u{69}\u{76}"] = function (a,b)
752+coroutine.yield(nil,"\u{69}\u{64}\u{69}\u{76}")
753+;
754+return (val(a) // val(b))
755+end,["\u{5f}\u{5f}\u{70}\u{6f}\u{77}"] = function (a,b)
756+coroutine.yield(nil,"\u{70}\u{6f}\u{77}")
757+;
758+return (val(a) ^ val(b))
759+end,["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}"] = function (a,b)
760+coroutine.yield(nil,"\u{6d}\u{6f}\u{64}")
761+;
762+return (val(a) % val(b))
763+end,["\u{5f}\u{5f}\u{75}\u{6e}\u{6d}"] = function (a,b)
764+coroutine.yield(nil,"\u{75}\u{6e}\u{6d}")
765+;
766+return (- val(a))
767+end,["\u{5f}\u{5f}\u{62}\u{6e}\u{6f}\u{74}"] = function (a,b)
768+coroutine.yield(nil,"\u{62}\u{6e}\u{6f}\u{74}")
769+;
770+return (~ val(a))
771+end,["\u{5f}\u{5f}\u{73}\u{68}\u{6c}"] = function (a,b)
772+coroutine.yield(nil,"\u{73}\u{68}\u{6c}")
773+;
774+return (val(a) << val(b))
775+end,["\u{5f}\u{5f}\u{73}\u{68}\u{72}"] = function (a,b)
776+coroutine.yield(nil,"\u{73}\u{68}\u{72}")
777+;
778+return (val(a) >> val(b))
779+end,["\u{5f}\u{5f}\u{62}\u{61}\u{6e}\u{64}"] = function (a,b)
780+coroutine.yield(nil,"\u{62}\u{61}\u{6e}\u{64}")
781+return (val(a) & val(b))
782+end,["\u{5f}\u{5f}\u{62}\u{6f}\u{72}"] = function (a,b)
783+coroutine.yield(nil,"\u{62}\u{6f}\u{72}")
784+;
785+return (val(a) | val(b))
786+end,["\u{5f}\u{5f}\u{62}\u{78}\u{6f}\u{72}"] = function (a,b)
787+coroutine.yield(nil,"\u{62}\u{78}\u{6f}\u{72}")
788+;
789+return (val(a) ~ val(b))
790+end,["\u{5f}\u{5f}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"] = function (a,b)
791+coroutine.yield(nil,"\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}")
792+;
793+return (val(a) .. val(b))
794+end,["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k)
795+coroutine.yield(nil,"\u{69}\u{64}\u{78}")
796+;
797+return t.k[k]
798+end,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k,v)
799+coroutine.yield(nil,"\u{6e}\u{69}\u{64}\u{78}")
800+;
801+t.k[k]=v
802+end}
803+local function new
804+(x)
805+return setmetatable({["\u{78}"] = x,["\u{6b}"] = {}},mt)
806+end
807+local a = new(0xa)
808+local b = new(0xc)
809+local c = new("\u{68}\u{65}\u{6c}\u{6c}\u{6f}")
810+local function run
811+(f,t)
812+local i = 0x1
813+local c = coroutine.wrap(f)
814+while true do
815+local res,stat = c()
816+if res then
817+assert((t[i] == undef))
818+;
819+return res,t
820+end
821+assert((stat == t[i]))
822+i=(i + 0x1)
823+end
824+end
825+assert((run(function ()
826+if (a >= b) then
827+return "\u{3e}\u{3d}"
828+else
829+return "\u{3c}"
830+end
831+end,{"\u{6c}\u{65}","\u{73}\u{75}\u{62}"}) == "\u{3c}"))
832+assert((run(function ()
833+if (a <= b) then
834+return "\u{3c}\u{3d}"
835+else
836+return "\u{3e}"
837+end
838+end,{"\u{6c}\u{65}","\u{73}\u{75}\u{62}"}) == "\u{3c}\u{3d}"))
839+assert((run(function ()
840+if (a == b) then
841+return "\u{3d}\u{3d}"
842+else
843+return "\u{7e}\u{3d}"
844+end
845+end,{"\u{65}\u{71}"}) == "\u{7e}\u{3d}"))
846+assert((run(function ()
847+return (a & (b + a))
848+end,{"\u{61}\u{64}\u{64}","\u{62}\u{61}\u{6e}\u{64}"}) == 0x2))
849+assert((run(function ()
850+return (0x1 + a)
851+end,{"\u{61}\u{64}\u{64}"}) == 0xb))
852+assert((run(function ()
853+return (a - 0x19)
854+end,{"\u{73}\u{75}\u{62}"}) == (- 0xf)))
855+assert((run(function ()
856+return (0x2 * a)
857+end,{"\u{6d}\u{75}\u{6c}"}) == 0x14))
858+assert((run(function ()
859+return (a ^ 0x2)
860+end,{"\u{70}\u{6f}\u{77}"}) == 0x64))
861+assert((run(function ()
862+return (a / 0x2)
863+end,{"\u{64}\u{69}\u{76}"}) == 0x5))
864+assert((run(function ()
865+return (a % 0x6)
866+end,{"\u{6d}\u{6f}\u{64}"}) == 0x4))
867+assert((run(function ()
868+return (a // 0x3)
869+end,{"\u{69}\u{64}\u{69}\u{76}"}) == 0x3))
870+assert((run(function ()
871+return (a + b)
872+end,{"\u{61}\u{64}\u{64}"}) == 0x16))
873+assert((run(function ()
874+return (a - b)
875+end,{"\u{73}\u{75}\u{62}"}) == (- 0x2)))
876+assert((run(function ()
877+return (a * b)
878+end,{"\u{6d}\u{75}\u{6c}"}) == 0x78))
879+assert((run(function ()
880+return (a ^ b)
881+end,{"\u{70}\u{6f}\u{77}"}) == (0xa ^ 0xc)))
882+assert((run(function ()
883+return (a / b)
884+end,{"\u{64}\u{69}\u{76}"}) == (0xa / 0xc)))
885+assert((run(function ()
886+return (a % b)
887+end,{"\u{6d}\u{6f}\u{64}"}) == 0xa))
888+assert((run(function ()
889+return (a // b)
890+end,{"\u{69}\u{64}\u{69}\u{76}"}) == 0x0))
891+local a1000 = new(0x3e8)
892+assert((run(function ()
893+return (a1000 + 0x3e8)
894+end,{"\u{61}\u{64}\u{64}"}) == 0x7d0))
895+assert((run(function ()
896+return (a1000 - 0x61a8)
897+end,{"\u{73}\u{75}\u{62}"}) == (- 0x5dc0)))
898+assert((run(function ()
899+return (0x7d0 * a)
900+end,{"\u{6d}\u{75}\u{6c}"}) == 0x4e20))
901+assert((run(function ()
902+return (a1000 / 0x3e8)
903+end,{"\u{64}\u{69}\u{76}"}) == 0x1))
904+assert((run(function ()
905+return (a1000 % 0x258)
906+end,{"\u{6d}\u{6f}\u{64}"}) == 0x190))
907+assert((run(function ()
908+return (a1000 // 0x1f4)
909+end,{"\u{69}\u{64}\u{69}\u{76}"}) == 0x2))
910+assert((run(function ()
911+return (a % b)
912+end,{"\u{6d}\u{6f}\u{64}"}) == 0xa))
913+assert((run(function ()
914+return (~ (a & b))
915+end,{"\u{62}\u{6e}\u{6f}\u{74}","\u{62}\u{61}\u{6e}\u{64}"}) == (~ (0xa & 0xc))))
916+assert((run(function ()
917+return (a | b)
918+end,{"\u{62}\u{6f}\u{72}"}) == (0xa | 0xc)))
919+assert((run(function ()
920+return (a ~ b)
921+end,{"\u{62}\u{78}\u{6f}\u{72}"}) == (0xa ~ 0xc)))
922+assert((run(function ()
923+return (a << b)
924+end,{"\u{73}\u{68}\u{6c}"}) == (0xa << 0xc)))
925+assert((run(function ()
926+return (a >> b)
927+end,{"\u{73}\u{68}\u{72}"}) == (0xa >> 0xc)))
928+assert((run(function ()
929+return (0xa & b)
930+end,{"\u{62}\u{61}\u{6e}\u{64}"}) == (0xa & 0xc)))
931+assert((run(function ()
932+return (a | 0x2)
933+end,{"\u{62}\u{6f}\u{72}"}) == (0xa | 0x2)))
934+assert((run(function ()
935+return (a ~ 0x2)
936+end,{"\u{62}\u{78}\u{6f}\u{72}"}) == (0xa ~ 0x2)))
937+assert((run(function ()
938+return (a >> 0x2)
939+end,{"\u{73}\u{68}\u{72}"}) == (0xa >> 0x2)))
940+assert((run(function ()
941+return (0x1 >> a)
942+end,{"\u{73}\u{68}\u{72}"}) == (0x1 >> 0xa)))
943+assert((run(function ()
944+return (a << 0x2)
945+end,{"\u{73}\u{68}\u{6c}"}) == (0xa << 0x2)))
946+assert((run(function ()
947+return (0x1 << a)
948+end,{"\u{73}\u{68}\u{6c}"}) == (0x1 << 0xa)))
949+assert((run(function ()
950+return (0x2 ~ a)
951+end,{"\u{62}\u{78}\u{6f}\u{72}"}) == (0x2 ~ 0xa)))
952+assert((run(function ()
953+return (a .. b)
954+end,{"\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"}) == "\u{31}\u{30}\u{31}\u{32}"))
955+assert((run(function ()
956+return (a .. (b .. (c .. a)))
957+end,{"\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"}) == "\u{31}\u{30}\u{31}\u{32}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{31}\u{30}"))
958+assert((run(function ()
959+return ("\u{61}" .. ("\u{62}" .. (a .. ("\u{63}" .. (c .. (b .. "\u{78}"))))))
960+end,{"\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"}) == "\u{61}\u{62}\u{31}\u{30}\u{63}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{31}\u{32}\u{78}"))
961+do
962+local mt1 = {["\u{5f}\u{5f}\u{6c}\u{65}"] = function (a,b)
963+coroutine.yield(0xa)
964+return (val(a) <= val(b))
965+end,["\u{5f}\u{5f}\u{6c}\u{74}"] = function (a,b)
966+coroutine.yield(0xa)
967+return (val(a) < val(b))
968+end}
969+local mt2 = {["\u{5f}\u{5f}\u{6c}\u{74}"] = mt1.__lt,["\u{5f}\u{5f}\u{6c}\u{65}"] = mt1.__le}
970+local function run
971+(f)
972+local co = coroutine.wrap(f)
973+local res
974+repeat
975+res=co()
976+until (res ~= 0xa)
977+return res
978+end
979+local function test
980+()
981+local a1 = setmetatable({["\u{78}"] = 0x1},mt1)
982+local a2 = setmetatable({["\u{78}"] = 0x2},mt2)
983+assert((a1 < a2))
984+assert((a1 <= a2))
985+assert((0x1 < a2))
986+assert((0x1 <= a2))
987+assert((0x2 > a1))
988+assert((0x2 >= a2))
989+return true
990+end
991+run(test)
992+end
993+assert((run(function ()
994+a.BB=print
995+return a.BB
996+end,{"\u{6e}\u{69}\u{64}\u{78}","\u{69}\u{64}\u{78}"}) == print))
997+do
998+local _ENV = _ENV
999+f=function ()
1000+AAA=(BBB + 0x1)
1001+;
1002+return AAA
1003+end
1004+end
1005+local g = new(0xa)
1006+;
1007+g.k.BBB=0xa
1008+;
1009+debug.setupvalue(f,0x1,g)
1010+assert((run(f,{"\u{69}\u{64}\u{78}","\u{6e}\u{69}\u{64}\u{78}","\u{69}\u{64}\u{78}"}) == 0xb))
1011+assert((g.k.AAA == 0xb))
1012+print("\u{2b}")
1013+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{73}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{27}\u{66}\u{6f}\u{72}\u{27}\u{20}\u{69}\u{74}\u{65}\u{72}\u{61}\u{74}\u{6f}\u{72}\u{73}")
1014+local f = function (s,i)
1015+if ((i % 0x2) == 0x0) then
1016+coroutine.yield(nil,"\u{66}\u{6f}\u{72}")
1017+end
1018+if (i < s) then
1019+return (i + 0x1)
1020+end
1021+end
1022+assert((run(function ()
1023+local s = 0x0
1024+for i in f,0x4,0x0
1025+do
1026+s=(s + i)
1027+end
1028+return s
1029+end,{"\u{66}\u{6f}\u{72}","\u{66}\u{6f}\u{72}","\u{66}\u{6f}\u{72}"}) == 0xa))
1030+if (T == nil) then
1031+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{41}\u{50}\u{49}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
1032+print("\u{4f}\u{4b}")
1033+;
1034+return
1035+end
1036+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{20}\u{41}\u{50}\u{49}")
1037+local function apico
1038+(...)
1039+local x = {...}
1040+return coroutine.wrap(function ()
1041+return T.testC(table.unpack(x))
1042+end)
1043+end
1044+local a = {apico("\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{63}\u{6f}\u{64}\u{65}\u{a}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{6b}\u{20}\u{31}\u{20}\u{30}\u{20}\u{32}\u{3b}\u{a}\u{20}\u{20}\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{61}\u{6e}\u{64}\u{20}\u{28}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{72}\u{72}\u{69}\u{76}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{29}\u{a}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}","\u{73}\u{74}\u{61}\u{63}\u{6b}\u{6d}\u{61}\u{72}\u{6b}",error)()}
1045+assert((# (((((a == 0x4) and (a[0x3] == "\u{73}\u{74}\u{61}\u{63}\u{6b}\u{6d}\u{61}\u{72}\u{6b}")) and (a[0x4] == "\u{65}\u{72}\u{72}\u{6f}\u{72}\u{63}\u{6f}\u{64}\u{65}")) and (_G.status == "\u{45}\u{52}\u{52}\u{52}\u{55}\u{4e}")) and (_G.ctx == 0x2))))
1046+local co = apico("\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{6b}\u{20}\u{31}\u{20}\u{32}\u{20}\u{33}\u{3b}\u{20}\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{61}\u{6e}\u{64}\u{3b}",coroutine.yield,"\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{63}\u{74}\u{78}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{3b}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{6b}\u{20}\u{31}\u{20}\u{30}\u{20}\u{34}\u{3b}\u{20}\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{61}\u{6e}\u{64}","\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{63}\u{74}\u{78}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}")
1047+assert((co() == 0xa))
1048+assert((co(0x14,0x1e) == "\u{61}"))
1049+a={co()}
1050+assert((# ((((((((a == 0xa) and (a[0x2] == coroutine.yield)) and (a[0x5] == 0x14)) and (a[0x6] == 0x1e)) and (a[0x7] == "\u{59}\u{49}\u{45}\u{4c}\u{44}")) and (a[0x8] == 0x3)) and (a[0x9] == "\u{59}\u{49}\u{45}\u{4c}\u{44}")) and (a[0xa] == 0x4))))
1051+assert((not pcall(co)))
1052+f=T.makeCfunc("\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{35}\u{3b}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{31}\u{3b}")
1053+co=coroutine.wrap(function ()
1054+assert((f() == 0x17))
1055+;
1056+assert((f() == 0x17))
1057+;
1058+return 0xa
1059+end)
1060+assert((co(0x17,0x10) == 0x5))
1061+assert((co(0x17,0x10) == 0x5))
1062+assert((co(0x17,0x10) == 0xa))
1063+f=T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{32}\u{a}\u{9}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{6b}\u{9}\u{31}\u{20}\u{55}\u{32}\u{a}\u{9}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}\u{a}","\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{9}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{33}\u{20}\u{20}\u{20}\u{23}\u{20}\u{61}\u{63}\u{63}\u{65}\u{73}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{34}\u{a}\u{9}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}\u{a}",0x17,"\u{68}\u{75}\u{75}")
1064+x=coroutine.wrap(f)
1065+assert((x() == 0x66))
1066+eqtab({x()},{0x17,"\u{68}\u{75}\u{75}"})
1067+f=T.makeCfunc("\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{61}\u{27}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{32}\u{3b}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{32}\u{3b}\u{20}")
1068+a,b,c,d=T.testC("\u{6e}\u{65}\u{77}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{30}\u{20}\u{33}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{33}\u{20}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{78}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{33}\u{20}\u{30}\u{20}\u{30}\u{3b}\u{20}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{65}\u{20}\u{33}\u{20}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{34}\u{3b}\u{20}",f)
1069+assert(((((a == "\u{59}\u{49}\u{45}\u{4c}\u{44}") and (b == "\u{61}")) and (c == 0x66)) and (d == "\u{4f}\u{4b}")))
1070+local count = 0x3
1071+f=T.makeCfunc("\u{20}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{31}\u{3b}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{55}\u{33}\u{3b}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{67}\u{65}\u{74}\u{20}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{30}\u{20}\u{31}\u{3b}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{74}\u{20}\u{20}\u{28}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{20}\u{69}\u{73}\u{20}\u{27}\u{66}\u{27}\u{20}\u{6f}\u{72}\u{20}\u{27}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{27}\u{29}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{73}\u{69}\u{6e}\u{67}\u{6c}\u{65}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{32}\u{3b}\u{20}\u{20}\u{20}\u{23}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{6f}\u{66}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{70}\u{72}\u{6f}\u{67}\u{72}\u{61}\u{6d}\u{a}\u{20}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{6b}\u{20}\u{31}\u{20}\u{2d}\u{31}\u{20}\u{2e}\u{3b}\u{9}\u{9}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{9}\u{9}\u{23}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{61}\u{72}\u{72}\u{69}\u{76}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{a}","\u{20}\u{20}\u{23}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{70}\u{72}\u{6f}\u{67}\u{72}\u{61}\u{6d}\u{a}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{33}\u{34}\u{9}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}\u{a}",function ()
1072+count=(count - 0x1)
1073+if (count == 0x0) then
1074+return coroutine.yield
1075+else
1076+return f
1077+end
1078+end)
1079+co=coroutine.wrap(function ()
1080+return f(nil)
1081+end)
1082+assert((co() == "\u{68}\u{65}\u{6c}\u{6c}\u{6f}"))
1083+a={co()}
1084+assert((# ((((a == 0x3) and (a[0x1] == a[0x2])) and (a[0x2] == a[0x3])) and (a[0x3] == 0x22))))
1085+local y
1086+co=coroutine.wrap(function (...)
1087+return T.testC("\u{20}\u{23}\u{20}\u{69}\u{6e}\u{69}\u{74}\u{69}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{6b}\u{20}\u{31}\u{20}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}","\u{20}\u{20}\u{23}\u{20}\u{31}\u{73}\u{74}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{6b}\u{20}\u{30}\u{20}\u{33}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}","\u{20}\u{20}\u{23}\u{20}\u{32}\u{6e}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{6b}\u{20}\u{30}\u{20}\u{34}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}","\u{20}\u{20}\u{23}\u{20}\u{33}\u{74}\u{68}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{36}\u{20}\u{20}\u{20}\u{23}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{77}\u{68}\u{69}\u{63}\u{68}\u{20}\u{69}\u{73}\u{20}\u{6c}\u{61}\u{73}\u{74}\u{20}\u{61}\u{72}\u{67}\u{2e}\u{20}\u{74}\u{6f}\u{20}\u{27}\u{74}\u{65}\u{73}\u{74}\u{43}\u{27}\u{20}\u{68}\u{65}\u{72}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{32}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{32}\u{20}\u{30}\u{20}\u{30}\u{20}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{74}\u{68}\u{72}\u{6f}\u{77}\u{20}\u{61}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{74}\u{6f}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{6f}\u{70}\u{20}\u{31}\u{9}\u{9}\u{23}\u{20}\u{72}\u{65}\u{6d}\u{6f}\u{76}\u{65}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{36}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{73}\u{74}\u{61}\u{74}\u{75}\u{73}\u{3b}\u{20}\u{67}\u{65}\u{74}\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{63}\u{74}\u{78}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{6b}\u{20}\u{32}\u{20}\u{32}\u{20}\u{35}\u{20}\u{20}\u{23}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{74}\u{68}\u{72}\u{6f}\u{77}\u{20}\u{61}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6a}\u{75}\u{6d}\u{70}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}","\u{20}\u{20}\u{23}\u{20}\u{34}\u{74}\u{68}\u{20}\u{28}\u{61}\u{6e}\u{64}\u{20}\u{6c}\u{61}\u{73}\u{74}\u{29}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}",function (a,b)
1088+x=a
1089+;
1090+y=b
1091+;
1092+error("\u{65}\u{72}\u{72}\u{6d}\u{73}\u{67}")
1093+end,...)
1094+end)
1095+local a = {co(0x3,0x4,0x6)}
1096+assert(((a[0x1] == 0x6) and (a[0x2] == undef)))
1097+a={co()}
1098+;
1099+assert((((a[0x1] == undef) and (_G.status == "\u{59}\u{49}\u{45}\u{4c}\u{44}")) and (_G.ctx == 0x2)))
1100+a={co()}
1101+;
1102+assert((((a[0x1] == undef) and (_G.status == "\u{59}\u{49}\u{45}\u{4c}\u{44}")) and (_G.ctx == 0x3)))
1103+a={co(0x7,0x8)}
1104+;
1105+assert(((((((type(a[0x1]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (type(a[0x2]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(a[0x3]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(a[0x4]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(a[0x5]) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(a[0x6]) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")))
1106+assert(((a[0x7] == 0x3) and (a[0x8] == 0x4)))
1107+assert(((a[0x9] == 0x7) and (a[0xa] == 0x8)))
1108+assert((a[0xb]:find("\u{65}\u{72}\u{72}\u{6d}\u{73}\u{67}") and (# (a == 0xb))))
1109+assert(((x == "\u{59}\u{49}\u{45}\u{4c}\u{44}") and (y == 0x4)))
1110+assert((not pcall(co)))
1111+_G.ctx=nil
1112+_G.status=nil
1113+local co = coroutine.wrap(function ()
1114+local a = {pcall(pcall,pcall,pcall,pcall,pcall,pcall,pcall,error,"\u{68}\u{69}")}
1115+return pcall(assert,table.unpack(a))
1116+end)
1117+local a = {co()}
1118+assert((a[0xa] == "\u{68}\u{69}"))
1119+print("\u{4f}\u{4b}")
desk/res/lua/cycled/cstack.luanew file+166
@@ -0,0 +1,166 @@
1+local tracegc = require("\u{74}\u{72}\u{61}\u{63}\u{65}\u{67}\u{63}")
2+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{64}\u{65}\u{74}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
3+local function checkerror
4+(msg,f, ...)
5+local s,err = pcall(f,...)
6+assert((not (s and string.find(err,msg))))
7+end
8+do
9+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{69}\u{6e}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{20}\u{68}\u{61}\u{6e}\u{64}\u{6c}\u{69}\u{6e}\u{67}")
10+local count = 0x0
11+local function loop
12+(x,y,z)
13+count=(count + 0x1)
14+return (0x1 + loop(x,y,z))
15+end
16+tracegc.stop()
17+local res,msg = xpcall(loop,loop)
18+tracegc.start()
19+assert((msg == "\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{69}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{68}\u{61}\u{6e}\u{64}\u{6c}\u{69}\u{6e}\u{67}"))
20+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
21+end
22+do
23+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{72}\u{65}\u{63}\u{75}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{70}\u{61}\u{74}\u{74}\u{65}\u{72}\u{6e}\u{20}\u{6d}\u{61}\u{74}\u{63}\u{68}\u{69}\u{6e}\u{67}")
24+local function f
25+(size)
26+local s = string.rep("\u{61}",size)
27+local p = string.rep("\u{2e}\u{3f}",size)
28+return string.match(s,p)
29+end
30+local m = f(0x50)
31+assert((# (m == 0x50)))
32+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{63}\u{6f}\u{6d}\u{70}\u{6c}\u{65}\u{78}",f,0x7d0)
33+end
34+do
35+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{2d}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{69}\u{6e}\u{20}\u{72}\u{65}\u{63}\u{75}\u{72}\u{73}\u{69}\u{76}\u{65}\u{20}\u{27}\u{67}\u{73}\u{75}\u{62}\u{27}")
36+local count = 0x0
37+local function foo
38+()
39+count=(count + 0x1)
40+string.gsub("\u{61}","\u{2e}",foo)
41+end
42+checkerror("\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",foo)
43+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
44+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{2d}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{69}\u{6e}\u{20}\u{72}\u{65}\u{63}\u{75}\u{72}\u{73}\u{69}\u{76}\u{65}\u{20}\u{27}\u{67}\u{73}\u{75}\u{62}\u{27}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}")
45+local count = 0x0
46+local t = setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = foo})
47+foo=function ()
48+count=(count + 0x1)
49+string.gsub("\u{61}","\u{2e}",t)
50+end
51+checkerror("\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",foo)
52+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
53+end
54+do
55+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{73}\u{69}\u{64}\u{65}\u{20}\u{64}\u{65}\u{65}\u{70}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}")
56+local count = 0x0
57+local lim = 0x3e8
58+local function stack
59+(n)
60+if (n > 0x0) then
61+return (stack((n - 0x1)) + 0x1)
62+else
63+coroutine.wrap(function ()
64+count=(count + 0x1)
65+stack(lim)
66+end)()
67+end
68+end
69+local st,msg = xpcall(stack,function ()
70+return "\u{6f}\u{6b}"
71+end,lim)
72+assert((not (st and (msg == "\u{6f}\u{6b}"))))
73+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
74+end
75+do
76+local count = 0x0
77+print("\u{63}\u{68}\u{61}\u{69}\u{6e}\u{20}\u{6f}\u{66}\u{20}\u{27}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{27}")
78+local coro = false
79+for i = 0x1, 0x3e8
80+do
81+local previous = coro
82+coro=coroutine.create(function ()
83+local cc <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
84+count=(count + 0x1)
85+if previous then
86+assert(coroutine.close(previous))
87+end
88+end})
89+coroutine.yield()
90+end)
91+assert(coroutine.resume(coro))
92+end
93+local st,msg = coroutine.close(coro)
94+assert((not (st and string.find(msg,"\u{43}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))))
95+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
96+end
97+do
98+print("\u{6e}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6d}\u{69}\u{6e}\u{67}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{65}\u{64}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}")
99+local count = 0x0
100+local function body
101+()
102+coroutine.yield()
103+local f = coroutine.wrap(body)
104+f()
105+;
106+count=(count + 0x1)
107+f()
108+end
109+local f = coroutine.wrap(body)
110+f()
111+assert((not pcall(f)))
112+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
113+end
114+do
115+print("\u{6e}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}\u{20}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{66}\u{74}\u{65}\u{72}\u{20}\u{72}\u{65}\u{63}\u{6f}\u{76}\u{65}\u{72}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}")
116+local count = 0x0
117+local function foo
118+()
119+count=(count + 0x1)
120+pcall(0x1)
121+coroutine.wrap(foo)()
122+end
123+checkerror("\u{43}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",foo)
124+print("\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{20}\u{63}\u{6f}\u{75}\u{6e}\u{74}\u{3a}\u{20}",count)
125+end
126+if T then
127+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{72}\u{65}\u{63}\u{6f}\u{76}\u{65}\u{72}\u{79}")
128+local N = 0x0
129+local LIM = (- 0x1)
130+local stack1
131+local dummy
132+local function err
133+(msg)
134+assert(string.find(msg,"\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))
135+local _,stacknow = T.stacklevel()
136+assert((stacknow == (stack1 + 0xc8)))
137+end
138+local function f
139+()
140+dummy,stack1=T.stacklevel()
141+if (N == LIM) then
142+xpcall(f,err)
143+local _,stacknow = T.stacklevel()
144+assert((stacknow == stack1))
145+return
146+end
147+N=(N + 0x1)
148+f()
149+end
150+local topB,sizeB
151+local topA,sizeA
152+topB,sizeB=T.stacklevel()
153+tracegc.stop()
154+xpcall(f,err)
155+tracegc.start()
156+topA,sizeA=T.stacklevel()
157+assert(((topA == topB) and (sizeA < (sizeB * 0x2))))
158+print(string.format("\u{6d}\u{61}\u{78}\u{69}\u{6d}\u{75}\u{6d}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{3a}\u{20}\u{25}\u{64}",stack1))
159+LIM=N
160+N=0x0
161+tracegc.stop()
162+f()
163+tracegc.start()
164+print("\u{2b}")
165+end
166+print("\u{4f}\u{4b}")
desk/res/lua/cycled/db.luanew file+947
@@ -0,0 +1,947 @@
1+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
2+local function dostring
3+(s)
4+return assert(load(s))()
5+end
6+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{69}\u{6e}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
7+do
8+local a = 0x1
9+end
10+assert((not debug.gethook()))
11+local testline = 0x13
12+local function test
13+(s,l,p)
14+collectgarbage()
15+local function f
16+(event,line)
17+assert((event == "\u{6c}\u{69}\u{6e}\u{65}"))
18+local l = table.remove(l,0x1)
19+if p then
20+print(l,line)
21+end
22+assert((l == line),"\u{77}\u{72}\u{6f}\u{6e}\u{67}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{21}\u{21}")
23+end
24+debug.sethook(f,"\u{6c}")
25+;
26+load(s)()
27+;
28+debug.sethook()
29+assert((# (l == 0x0)))
30+end
31+do
32+assert((not pcall(debug.getinfo,print,"\u{58}")))
33+assert((not pcall(debug.getinfo,0x0,"\u{3e}")))
34+assert((not debug.getinfo(0x3e8)))
35+assert((not debug.getinfo((- 0x1))))
36+local a = debug.getinfo(print)
37+assert(((a.what == "\u{43}") and (a.short_src == "\u{5b}\u{43}\u{5d}")))
38+a=debug.getinfo(print,"\u{4c}")
39+assert((a.activelines == nil))
40+local b = debug.getinfo(test,"\u{53}\u{66}\u{4c}")
41+assert(((((((b.name == nil) and (b.what == "\u{4c}\u{75}\u{61}")) and (b.linedefined == testline)) and (b.lastlinedefined == (b.linedefined + 0xa))) and (b.func == test)) and (not string.find(b.short_src,"\u{25}\u{5b}"))))
42+assert((b.activelines[(b.linedefined + 0x1)] and b.activelines[b.lastlinedefined]))
43+assert((not (b.activelines[b.linedefined] and (not b.activelines[(b.lastlinedefined + 0x1)]))))
44+end
45+do
46+local func = load(string.dump(load("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{30}\u{29}"),true))
47+local actl = debug.getinfo(func,"\u{4c}").activelines
48+assert((# (actl == 0x0)))
49+end
50+local a = "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{20}\u{28}\u{29}\u{20}\u{65}\u{6e}\u{64}"
51+local function dostring
52+(s,x)
53+return load(s,x)()
54+end
55+dostring(a)
56+assert((debug.getinfo(f).short_src == string.format("\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{25}\u{73}\u{22}\u{5d}",a)))
57+dostring((a .. string.format("\u{3b}\u{20}\u{25}\u{73}\u{a}\u{3d}\u{31}",string.rep("\u{70}",0x190))))
58+assert(string.find(debug.getinfo(f).short_src,"\u{5e}\u{25}\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{5b}\u{5e}\u{a}\u{5d}\u{2a}\u{25}\u{2e}\u{25}\u{2e}\u{25}\u{2e}\u{22}\u{25}\u{5d}\u{24}"))
59+dostring((a .. string.format("\u{3b}\u{20}\u{25}\u{73}\u{3d}\u{31}",string.rep("\u{70}",0x190))))
60+assert(string.find(debug.getinfo(f).short_src,"\u{5e}\u{25}\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{5b}\u{5e}\u{a}\u{5d}\u{2a}\u{25}\u{2e}\u{25}\u{2e}\u{25}\u{2e}\u{22}\u{25}\u{5d}\u{24}"))
61+dostring(("\u{a}" .. a))
62+assert((debug.getinfo(f).short_src == "\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{2e}\u{2e}\u{2e}\u{22}\u{5d}"))
63+dostring(a,"")
64+assert((debug.getinfo(f).short_src == "\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{22}\u{5d}"))
65+dostring(a,"\u{40}\u{78}\u{75}\u{78}\u{75}")
66+assert((debug.getinfo(f).short_src == "\u{78}\u{75}\u{78}\u{75}"))
67+dostring(a,("\u{40}" .. (string.rep("\u{70}",0x3e8) .. "\u{74}")))
68+assert(string.find(debug.getinfo(f).short_src,"\u{5e}\u{25}\u{2e}\u{25}\u{2e}\u{25}\u{2e}\u{70}\u{2a}\u{74}\u{24}"))
69+dostring(a,"\u{3d}\u{78}\u{75}\u{78}\u{75}")
70+assert((debug.getinfo(f).short_src == "\u{78}\u{75}\u{78}\u{75}"))
71+dostring(a,string.format("\u{3d}\u{25}\u{73}",string.rep("\u{78}",0x1f4)))
72+assert(string.find(debug.getinfo(f).short_src,"\u{5e}\u{78}\u{2a}\u{24}"))
73+dostring(a,"\u{3d}")
74+assert((debug.getinfo(f).short_src == ""))
75+_G.a=nil
76+;
77+_G.f=nil
78+;
79+_G[string.rep("\u{70}",0x190)]=nil
80+repeat
81+local g = {["\u{78}"] = function ()
82+local a = debug.getinfo(0x2)
83+assert(((a.name == "\u{66}") and (a.namewhat == "\u{6c}\u{6f}\u{63}\u{61}\u{6c}")))
84+a=debug.getinfo(0x1)
85+assert(((a.name == "\u{78}") and (a.namewhat == "\u{66}\u{69}\u{65}\u{6c}\u{64}")))
86+return "\u{78}\u{69}\u{78}\u{69}"
87+end}
88+local f = function ()
89+return ((0x1 + 0x1) and (not (0x1 or g.x())))
90+end
91+assert((f() == "\u{78}\u{69}\u{78}\u{69}"))
92+g=debug.getinfo(f)
93+assert(((((g.what == "\u{4c}\u{75}\u{61}") and (g.func == f)) and (g.namewhat == "")) and (not g.name)))
94+function f(x,name)
95+name=(name or "\u{66}")
96+local a = debug.getinfo(0x1)
97+assert(((a.name == name) and (a.namewhat == "\u{6c}\u{6f}\u{63}\u{61}\u{6c}")))
98+return x
99+end
100+if (0x3 > 0x4) then
101+break
102+end
103+;
104+f()
105+if (0x3 < 0x4) then
106+a=0x1
107+else
108+break
109+end
110+;
111+f()
112+while 0x1 do
113+local x = 0xa
114+;
115+break
116+end
117+;
118+f()
119+local b = 0x1
120+if (0x3 > 0x4) then
121+return math.sin(0x1)
122+end
123+;
124+f()
125+a=(0x3 < 0x4)
126+;
127+f()
128+a=((0x3 < 0x4) or 0x1)
129+;
130+f()
131+repeat
132+local x = 0x14
133+;
134+if (0x4 > 0x3) then
135+f()
136+else
137+break
138+end
139+;
140+f()
141+until 0x1
142+g={}
143+f(g).x=(f(0x2) and (f(0xa) + f(0x9)))
144+assert((g.x == f(0x13)))
145+function g(x)
146+if (not x) then
147+return 0x3
148+end
149+return x("\u{61}","\u{78}")
150+end
151+assert((g(f) == "\u{61}"))
152+until 0x1
153+test("\u{69}\u{66}\u{a}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{a}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{31}\u{a}\u{65}\u{6c}\u{73}\u{65}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{32}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x2,0x3,0x4,0x7})
154+test("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{a}\u{65}\u{6e}\u{64}\u{a}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{a}\u{41}\u{20}\u{3d}\u{20}\u{31}\u{a}\u{41}\u{20}\u{3d}\u{20}\u{32}\u{a}\u{41}\u{20}\u{3d}\u{20}\u{33}\u{a}",{0x2,0x3,0x2,0x4,0x5,0x6})
155+_G.A=nil
156+test("\u{2d}\u{2d}\u{a}\u{69}\u{66}\u{20}\u{6e}\u{69}\u{6c}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{31}\u{a}\u{65}\u{6c}\u{73}\u{65}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{32}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x2,0x5,0x6})
157+test("\u{61}\u{3d}\u{31}\u{a}\u{72}\u{65}\u{70}\u{65}\u{61}\u{74}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{61}\u{2b}\u{31}\u{a}\u{75}\u{6e}\u{74}\u{69}\u{6c}\u{20}\u{61}\u{3d}\u{3d}\u{33}\u{a}",{0x1,0x3,0x4,0x3,0x4})
158+test("\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x2})
159+test("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{a}\u{61}\u{3d}\u{31}\u{a}\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{61}\u{3c}\u{3d}\u{33}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{61}\u{2b}\u{31}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x1,0x2,0x3,0x4,0x3,0x4,0x3,0x4,0x3,0x5})
160+test("\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{69}\u{66}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{a}\u{20}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{62}\u{72}\u{65}\u{61}\u{6b}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{65}\u{6e}\u{64}\u{a}\u{61}\u{3d}\u{31}",{0x1,0x2,0x3,0x6})
161+test("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{3d}\u{31}\u{2c}\u{33}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{69}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x1,0x2,0x1,0x2,0x1,0x2,0x1,0x3})
162+test("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{2c}\u{76}\u{20}\u{69}\u{6e}\u{20}\u{70}\u{61}\u{69}\u{72}\u{73}\u{7b}\u{27}\u{61}\u{27}\u{2c}\u{27}\u{62}\u{27}\u{7d}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{61}\u{3d}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{28}\u{69}\u{29}\u{20}\u{2e}\u{2e}\u{20}\u{76}\u{a}\u{65}\u{6e}\u{64}\u{a}",{0x1,0x2,0x1,0x2,0x1,0x3})
163+test("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{3d}\u{31}\u{2c}\u{34}\u{20}\u{64}\u{6f}\u{20}\u{61}\u{3d}\u{31}\u{20}\u{65}\u{6e}\u{64}",{0x1,0x1,0x1,0x1})
164+_G.a=nil
165+do
166+local a = {0x1,0x2,0x3,0xa,0x7c,0x7d,0x7e,0x7f,0x80,0x81,0x82,0xff,0x100,0x101,0x1f4,0x3e8}
167+local s = "\u{20}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{7b}\u{31}\u{30}\u{7d}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{62}\u{5b}\u{31}\u{5d}\u{20}\u{58}\u{20}\u{2b}\u{20}\u{59}\u{20}\u{62}\u{5b}\u{31}\u{5d}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{34}\u{a}\u{20}\u{20}"
168+for _,i in ipairs(a)
169+do
170+local subs = {["\u{58}"] = string.rep("\u{a}",i)}
171+for _,j in ipairs(a)
172+do
173+subs.Y=string.rep("\u{a}",j)
174+local s = string.gsub(s,"\u{5b}\u{58}\u{59}\u{5d}",subs)
175+test(s,{0x1,(0x2 + i),((0x2 + i) + j),(0x2 + i),((0x2 + i) + j),((0x3 + i) + j)})
176+end
177+end
178+end
179+_G.a=nil
180+do
181+local function checkactivelines
182+(f,lines)
183+local t = debug.getinfo(f,"\u{53}\u{4c}")
184+for _,l in pairs(lines)
185+do
186+l=(l + t.linedefined)
187+assert(t.activelines[l])
188+t.activelines[l]=undef
189+end
190+assert((next(t.activelines) == nil))
191+end
192+checkactivelines(function (...)
193+local a = 0x14
194+local b = 0x1e
195+end,{0x4,0x6,0x8})
196+checkactivelines(function (a)
197+local a = 0x14
198+local b = 0x1e
199+end,{0x3,0x4,0x6})
200+checkactivelines(function (a,b, ...)
201+
202+end,{0x0})
203+checkactivelines(function (a,b)
204+
205+end,{0x1})
206+for _,n in pairs({0x0,0x1,0x2,0xa,0x32,0x64,0x3e8,0x2710})
207+do
208+checkactivelines(load(string.format("\u{25}\u{73}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",string.rep("\u{a}",n))),{(n + 0x1)})
209+end
210+end
211+print("\u{2b}")
212+assert((not pcall(debug.getlocal,0x14,0x1)))
213+assert((not pcall(debug.setlocal,(- 0x1),0x1,0xa)))
214+local function foo
215+(a,b, ...)
216+local d,e
217+end
218+local co = coroutine.create(foo)
219+assert((debug.getlocal(foo,0x1) == "\u{61}"))
220+assert((debug.getlocal(foo,0x2) == "\u{62}"))
221+assert((not debug.getlocal(foo,0x3)))
222+assert((debug.getlocal(co,foo,0x1) == "\u{61}"))
223+assert((debug.getlocal(co,foo,0x2) == "\u{62}"))
224+assert((not debug.getlocal(co,foo,0x3)))
225+assert((not debug.getlocal(print,0x1)))
226+local function foo
227+()
228+return debug.getlocal(0x1,(- 0x1))
229+end
230+assert((not foo(0xa)))
231+local function foo
232+(a, ...)
233+local t = table.pack(...)
234+for i = 0x1, t.n
235+do
236+local n,v = debug.getlocal(0x1,(- i))
237+assert(((n == "\u{28}\u{76}\u{61}\u{72}\u{61}\u{72}\u{67}\u{29}") and (v == t[i])))
238+end
239+assert((not debug.getlocal(0x1,(- (t.n + 0x1)))))
240+assert((not debug.setlocal(0x1,(- (t.n + 0x1)),0x1e)))
241+if (t.n > 0x0) then
242+(function (x)
243+assert((debug.setlocal(0x2,(- 0x1),x) == "\u{28}\u{76}\u{61}\u{72}\u{61}\u{72}\u{67}\u{29}"))
244+assert((debug.setlocal(0x2,(- t.n),x) == "\u{28}\u{76}\u{61}\u{72}\u{61}\u{72}\u{67}\u{29}"))
245+end)(0x1ae)
246+assert((... == 0x1ae))
247+end
248+end
249+foo()
250+foo(print)
251+foo(0xc8,0x3,0x4)
252+local a = {}
253+for i = 0x1, ((_soft and 0x64) or 0x3e8)
254+do
255+a[i]=i
256+end
257+foo(table.unpack(a))
258+do
259+assert((not debug.gethook()))
260+local count = 0x0
261+local function f
262+()
263+assert((debug.getinfo(0x1).namewhat == "\u{68}\u{6f}\u{6f}\u{6b}"))
264+local sndline = string.match(debug.traceback(),"\u{a}\u{28}\u{2e}\u{2d}\u{29}\u{a}")
265+assert(string.find(sndline,"\u{68}\u{6f}\u{6f}\u{6b}"))
266+count=(count + 0x1)
267+end
268+debug.sethook(f,"\u{6c}")
269+local a = 0x0
270+_ENV.a=a
271+a=0x1
272+debug.sethook()
273+assert((count == 0x4))
274+end
275+_ENV.a=nil
276+assert((getmetatable(debug.getregistry()._HOOKKEY).__mode == "\u{6b}"))
277+a={}
278+;
279+local L = nil
280+local glob = 0x1
281+local oldglob = glob
282+debug.sethook(function (e,l)
283+collectgarbage()
284+local f,m,c = debug.gethook()
285+assert(((m == "\u{63}\u{72}\u{6c}") and (c == 0x0)))
286+if (e == "\u{6c}\u{69}\u{6e}\u{65}") then
287+if (glob ~= oldglob) then
288+L=(l - 0x1)
289+oldglob=glob
290+end
291+elseif (e == "\u{63}\u{61}\u{6c}\u{6c}") then
292+local f = debug.getinfo(0x2,"\u{66}").func
293+a[f]=0x1
294+else
295+assert((e == "\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}"))
296+end
297+end,"\u{63}\u{72}\u{6c}")
298+function f(a,b)
299+collectgarbage()
300+local _,x = debug.getlocal(0x1,0x1)
301+local _,y = debug.getlocal(0x1,0x2)
302+assert(((x == a) and (y == b)))
303+assert((debug.setlocal(0x2,0x3,"\u{70}\u{65}\u{72}\u{61}") == ("\u{41}\u{41}" .. "\u{41}\u{41}")))
304+assert((debug.setlocal(0x2,0x4,"\u{6d}\u{61}\u{6e}\u{67}\u{61}") == "\u{42}"))
305+x=debug.getinfo(0x2)
306+assert((((((x.func == g) and (x.what == "\u{4c}\u{75}\u{61}")) and (x.name == "\u{67}")) and (x.nups == 0x2)) and string.find(x.source,"\u{5e}\u{40}\u{2e}\u{2a}\u{64}\u{62}\u{25}\u{2e}\u{6c}\u{75}\u{61}\u{24}")))
307+glob=(glob + 0x1)
308+assert((debug.getinfo(0x1,"\u{6c}").currentline == (L + 0x1)))
309+assert((debug.getinfo(0x1,"\u{6c}").currentline == (L + 0x2)))
310+end
311+function foo()
312+glob=(glob + 0x1)
313+assert((debug.getinfo(0x1,"\u{6c}").currentline == (L + 0x1)))
314+end
315+;
316+foo()
317+local _ = ("\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}" .. "\u{a}")
318+assert((debug.getinfo(0x1,"\u{6c}").currentline == (L + 0xb)))
319+function g(...)
320+local arg = {...}
321+do
322+local a,b,c
323+;
324+a=math.sin(0x28)
325+;
326+end
327+local feijao
328+local AAAA,B = "\u{78}\u{75}\u{78}\u{75}","\u{61}\u{62}\u{61}\u{63}\u{61}\u{74}\u{65}"
329+f(AAAA,B)
330+assert(((AAAA == "\u{70}\u{65}\u{72}\u{61}") and (B == "\u{6d}\u{61}\u{6e}\u{67}\u{61}")))
331+do
332+local B = 0xd
333+local x,y = debug.getlocal(0x1,0x5)
334+assert(((x == "\u{42}") and (y == 0xd)))
335+end
336+end
337+g()
338+assert(((((a[f] and a[g]) and a[assert]) and a[debug.getlocal]) and (not a[print])))
339+local n,v = debug.getlocal(0x0,0x1)
340+assert(((v == 0x0) and (n == "\u{28}\u{43}\u{20}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}")))
341+local n,v = debug.getlocal(0x0,0x2)
342+assert(((v == 0x2) and (n == "\u{28}\u{43}\u{20}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}")))
343+assert((not debug.getlocal(0x0,0x3)))
344+assert((not debug.getlocal(0x0,0x0)))
345+function f()
346+assert((select(0x2,debug.getlocal(0x2,0x3)) == 0x1))
347+assert((not debug.getlocal(0x2,0x4)))
348+debug.setlocal(0x2,0x3,0xa)
349+return 0x14
350+end
351+function g(a,b)
352+return ((a + 0x1) + f())
353+end
354+assert((g(0x0,0x0) == 0x1e))
355+_G.f,_G.g=nil
356+debug.sethook(nil)
357+;
358+assert((not debug.gethook()))
359+do
360+assert((not debug.setuservalue(io.stdin,0xa)))
361+local a,b = debug.getuservalue(io.stdin,0xa)
362+assert(((a == nil) and (not b)))
363+end
364+do
365+local function f
366+(...)
367+return 0x3,...
368+end
369+local count = 0x0
370+local a = {}
371+for i = 0x1, 0x64
372+do
373+a[i]=i
374+end
375+debug.sethook(function ()
376+count=(count + 0x1)
377+end,"",0x1)
378+local t = {table.unpack(a)}
379+assert((# (t == 0x64)))
380+t={table.unpack(a,0x1,0x3)}
381+assert((# (t == 0x3)))
382+t={f(table.unpack(a,0x1,0x1e))}
383+assert((# (t == 0x1f)))
384+end
385+local function collectlocals
386+(level)
387+local tab = {}
388+for i = 0x1, math.huge
389+do
390+local n,v = debug.getlocal((level + 0x1),i)
391+if (not (n and string.find(n,"\u{5e}\u{5b}\u{61}\u{2d}\u{7a}\u{41}\u{2d}\u{5a}\u{30}\u{2d}\u{39}\u{5f}\u{5d}\u{2b}\u{24}"))) then
392+break
393+end
394+tab[n]=v
395+end
396+return tab
397+end
398+local X = nil
399+a={}
400+function a:f(a,b, ...)
401+local arg = {...}
402+;
403+local c = 0xd
404+end
405+debug.sethook(function (e)
406+assert((e == "\u{63}\u{61}\u{6c}\u{6c}"))
407+dostring("\u{58}\u{58}\u{20}\u{3d}\u{20}\u{31}\u{32}")
408+assert((not pcall(load("\u{61}\u{3d}\u{27}\u{6a}\u{6f}\u{61}\u{6f}\u{27}\u{2b}\u{31}"))))
409+debug.sethook(function (e,l)
410+assert((debug.getinfo(0x2,"\u{6c}").currentline == l))
411+local f,m,c = debug.gethook()
412+assert((e == "\u{6c}\u{69}\u{6e}\u{65}"))
413+assert(((m == "\u{6c}") and (c == 0x0)))
414+debug.sethook(nil)
415+assert((not X))
416+X=collectlocals(0x2)
417+end,"\u{6c}")
418+end,"\u{63}")
419+a:f(0x1,0x2,0x3,0x4,0x5)
420+assert(((((X.self == a) and (X.a == 0x1)) and (X.b == 0x2)) and (X.c == nil)))
421+assert((XX == 0xc))
422+assert((not debug.gethook()))
423+_G.XX=nil
424+do
425+local X = false
426+local function foo
427+(a,b, ...)
428+do
429+local x,y,z
430+end
431+local c,d = 0xa,0x14
432+return
433+end
434+local function aux
435+()
436+if (debug.getinfo(0x2).name == "\u{66}\u{6f}\u{6f}") then
437+X=true
438+local tab = {["\u{61}"] = 0x64,["\u{62}"] = 0xc8,["\u{63}"] = 0xa,["\u{64}"] = 0x14}
439+for n,v in pairs(collectlocals(0x2))
440+do
441+assert((tab[n] == v))
442+tab[n]=undef
443+end
444+assert((next(tab) == nil))
445+end
446+end
447+debug.sethook(aux,"\u{72}")
448+;
449+foo(0x64,0xc8)
450+;
451+debug.sethook()
452+assert(X)
453+end
454+local function eqseq
455+(t1,t2)
456+assert((# (t1 == (# t2))))
457+for i = 0x1, (# t1)
458+do
459+assert((t1[i] == t2[i]))
460+end
461+end
462+do
463+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{6e}\u{73}\u{70}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{66}\u{20}\u{70}\u{61}\u{72}\u{61}\u{6d}\u{65}\u{74}\u{65}\u{72}\u{73}\u{2f}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{65}\u{64}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}")
464+local on = false
465+local inp,out
466+local function hook
467+(event)
468+if (not on) then
469+return
470+end
471+local ar = debug.getinfo(0x2,"\u{72}\u{75}\u{53}")
472+local t = {}
473+for i = ar.ftransfer, ((ar.ftransfer + ar.ntransfer) - 0x1)
474+do
475+local _,v = debug.getlocal(0x2,i)
476+t[(# (t + 0x1))]=v
477+end
478+if (event == "\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}") then
479+out=t
480+else
481+inp=t
482+end
483+end
484+debug.sethook(hook,"\u{63}\u{72}")
485+on=true
486+;
487+math.sin(0x3)
488+;
489+on=false
490+eqseq(inp,{0x3})
491+;
492+eqseq(out,{math.sin(0x3)})
493+on=true
494+;
495+select(0x2,0xa,0x14,0x1e,0x28)
496+;
497+on=false
498+eqseq(inp,{0x2,0xa,0x14,0x1e,0x28})
499+;
500+eqseq(out,{0x14,0x1e,0x28})
501+local function foo
502+(a, ...)
503+return ...
504+end
505+local function foo1
506+()
507+on=(not on)
508+;
509+return foo(0x14,0xa,0x0)
510+end
511+foo1()
512+;
513+on=false
514+eqseq(inp,{0x14})
515+;
516+eqseq(out,{0xa,0x0})
517+debug.sethook()
518+end
519+local function getupvalues
520+(f)
521+local t = {}
522+local i = 0x1
523+while true do
524+local name,value = debug.getupvalue(f,i)
525+if (not name) then
526+break
527+end
528+assert((not t[name]))
529+t[name]=value
530+i=(i + 0x1)
531+end
532+return t
533+end
534+local a,b,c = 0x1,0x2,0x3
535+local function foo1
536+(a)
537+b=a
538+;
539+return c
540+end
541+local function foo2
542+(x)
543+a=x
544+;
545+return (c + b)
546+end
547+assert((not debug.getupvalue(foo1,0x3)))
548+assert((not debug.getupvalue(foo1,0x0)))
549+assert((not debug.setupvalue(foo1,0x3,"\u{78}\u{75}\u{78}\u{75}")))
550+local t = getupvalues(foo1)
551+assert((((t.a == nil) and (t.b == 0x2)) and (t.c == 0x3)))
552+t=getupvalues(foo2)
553+assert((((t.a == 0x1) and (t.b == 0x2)) and (t.c == 0x3)))
554+assert((debug.setupvalue(foo1,0x1,"\u{78}\u{75}\u{78}\u{75}") == "\u{62}"))
555+assert((({debug.getupvalue(foo2,0x3)})[0x2] == "\u{78}\u{75}\u{78}\u{75}"))
556+assert((debug.getupvalue(string.gmatch("\u{78}","\u{78}"),0x1) == ""))
557+local a = 0x0
558+debug.sethook(function (e)
559+a=(a + 0x1)
560+end,"",0x1)
561+a=0x0
562+;
563+for i = 0x1, 0x3e8
564+do
565+
566+end
567+;
568+assert(((0x3e8 < a) and (a < 0x3f4)))
569+debug.sethook(function (e)
570+a=(a + 0x1)
571+end,"",0x4)
572+a=0x0
573+;
574+for i = 0x1, 0x3e8
575+do
576+
577+end
578+;
579+assert(((0xfa < a) and (a < 0xff)))
580+local f,m,c = debug.gethook()
581+assert(((m == "") and (c == 0x4)))
582+debug.sethook(function (e)
583+a=(a + 0x1)
584+end,"",0xfa0)
585+a=0x0
586+;
587+for i = 0x1, 0x3e8
588+do
589+
590+end
591+;
592+assert((a == 0x0))
593+do
594+debug.sethook(print,"",((0x2 ^ 0x18) - 0x1))
595+local f,m,c = debug.gethook()
596+assert((({debug.gethook()})[0x3] == ((0x2 ^ 0x18) - 0x1)))
597+end
598+debug.sethook()
599+local g,g1
600+local function f
601+(x)
602+if x then
603+assert((debug.getinfo(0x1,"\u{53}").what == "\u{4c}\u{75}\u{61}"))
604+assert((debug.getinfo(0x1,"\u{74}").istailcall == true))
605+local tail = debug.getinfo(0x2)
606+assert(((tail.func == g1) and (tail.istailcall == true)))
607+assert((debug.getinfo(0x3,"\u{53}").what == "\u{6d}\u{61}\u{69}\u{6e}"))
608+print("\u{2b}")
609+end
610+end
611+function g(x)
612+return f(x)
613+end
614+function g1(x)
615+g(x)
616+end
617+local function h
618+(x)
619+local f = g1
620+;
621+return f(x)
622+end
623+h(true)
624+local b = {}
625+debug.sethook(function (e)
626+table.insert(b,e)
627+end,"\u{63}\u{72}")
628+h(false)
629+debug.sethook()
630+local res = {"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}","\u{63}\u{61}\u{6c}\u{6c}","\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}","\u{63}\u{61}\u{6c}\u{6c}","\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}","\u{63}\u{61}\u{6c}\u{6c}"}
631+for i = 0x1, (# res)
632+do
633+assert((res[i] == table.remove(b,0x1)))
634+end
635+b=0x0
636+debug.sethook(function (e)
637+if (e == "\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}") then
638+b=(b + 0x1)
639+assert((debug.getinfo(0x2,"\u{74}").istailcall == true))
640+else
641+assert((debug.getinfo(0x2,"\u{74}").istailcall == false))
642+end
643+end,"\u{63}")
644+h(false)
645+debug.sethook()
646+assert((b == 0x2))
647+local lim = ((_soft and 0xbb8) or 0x7530)
648+local function foo
649+(x)
650+if (x == 0x0) then
651+assert((debug.getinfo(0x2).what == "\u{6d}\u{61}\u{69}\u{6e}"))
652+local info = debug.getinfo(0x1)
653+assert(((info.istailcall == true) and (info.func == foo)))
654+else
655+return foo((x - 0x1))
656+end
657+end
658+foo(lim)
659+print("\u{2b}")
660+co=load("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{41}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{a}")
661+local a = 0x0
662+debug.sethook(function (e,l)
663+if (l == 0x3) then
664+a=(a + 0x1)
665+;
666+assert((debug.getlocal(0x2,0x1) == "\u{28}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}"))
667+elseif (l == 0x4) then
668+a=(a + 0x1)
669+;
670+assert((debug.getlocal(0x2,0x1) == "\u{41}"))
671+end
672+end,"\u{6c}")
673+co()
674+debug.sethook()
675+assert((a == 0x2))
676+assert((debug.traceback(print) == print))
677+assert((debug.traceback(print,0x4) == print))
678+assert(string.find(debug.traceback("\u{68}\u{69}",0x4),"\u{5e}\u{68}\u{69}\u{a}"))
679+assert(string.find(debug.traceback("\u{68}\u{69}"),"\u{5e}\u{68}\u{69}\u{a}"))
680+assert((not string.find(debug.traceback("\u{68}\u{69}"),"\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{27}")))
681+assert(string.find(debug.traceback("\u{68}\u{69}",0x0),"\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{27}"))
682+assert(string.find(debug.traceback(),"\u{5e}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{3a}\u{a}"))
683+do
684+local st,msg = (function ()
685+return pcall
686+end)()(debug.traceback)
687+assert(((st == true) and string.find(msg,"\u{70}\u{63}\u{61}\u{6c}\u{6c}")))
688+end
689+local t = debug.getinfo(print,"\u{75}")
690+assert((((t.isvararg == true) and (t.nparams == 0x0)) and (t.nups == 0x0)))
691+t=debug.getinfo(function (a,b,c)
692+
693+end,"\u{75}")
694+assert((((t.isvararg == false) and (t.nparams == 0x3)) and (t.nups == 0x0)))
695+t=debug.getinfo(function (a,b, ...)
696+return t[a]
697+end,"\u{75}")
698+assert((((t.isvararg == true) and (t.nparams == 0x2)) and (t.nups == 0x1)))
699+t=debug.getinfo(0x1)
700+assert(((((t.isvararg == true) and (t.nparams == 0x0)) and (t.nups == 0x1)) and (debug.getupvalue(t.func,0x1) == "\u{5f}\u{45}\u{4e}\u{56}")))
701+t=debug.getinfo(math.sin)
702+assert((((t.isvararg == true) and (t.nparams == 0x0)) and (t.nups == 0x0)))
703+t=debug.getinfo(string.gmatch("\u{61}\u{62}\u{63}","\u{61}"))
704+assert((((t.isvararg == true) and (t.nparams == 0x0)) and (t.nups > 0x0)))
705+local function checktraceback
706+(co,p,level)
707+local tb = debug.traceback(co,nil,level)
708+local i = 0x0
709+for l in string.gmatch(tb,"\u{5b}\u{5e}\u{a}\u{5d}\u{2b}\u{a}\u{3f}")
710+do
711+assert(((i == 0x0) or string.find(l,p[i])))
712+i=(i + 0x1)
713+end
714+assert((p[i] == undef))
715+end
716+local function f
717+(n)
718+if (n > 0x0) then
719+f((n - 0x1))
720+else
721+coroutine.yield()
722+end
723+end
724+local co = coroutine.create(f)
725+coroutine.resume(co,0x3)
726+checktraceback(co,{"\u{79}\u{69}\u{65}\u{6c}\u{64}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}"})
727+checktraceback(co,{"\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}"},0x1)
728+checktraceback(co,{"\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}","\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}"},0x2)
729+checktraceback(co,{"\u{64}\u{62}\u{2e}\u{6c}\u{75}\u{61}"},0x4)
730+checktraceback(co,{},0x28)
731+co=coroutine.create(function (x)
732+local a = 0x1
733+coroutine.yield(debug.getinfo(0x1,"\u{6c}"))
734+coroutine.yield(debug.getinfo(0x1,"\u{6c}").currentline)
735+return a
736+end)
737+local tr = {}
738+local foo = function (e,l)
739+if l then
740+table.insert(tr,l)
741+end
742+end
743+debug.sethook(co,foo,"\u{6c}\u{63}\u{72}")
744+local _,l = coroutine.resume(co,0xa)
745+local x = debug.getinfo(co,0x1,"\u{6c}\u{66}\u{4c}\u{53}")
746+assert(((x.currentline == l.currentline) and x.activelines[x.currentline]))
747+assert((type(x.func) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}"))
748+for i = (x.linedefined + 0x1), x.lastlinedefined
749+do
750+assert(x.activelines[i])
751+x.activelines[i]=undef
752+end
753+assert((next(x.activelines) == nil))
754+assert((not debug.getinfo(co,0x2)))
755+local a,b = debug.getlocal(co,0x1,0x1)
756+assert(((a == "\u{78}") and (b == 0xa)))
757+a,b=debug.getlocal(co,0x1,0x2)
758+assert(((a == "\u{61}") and (b == 0x1)))
759+debug.setlocal(co,0x1,0x2,"\u{68}\u{69}")
760+assert((debug.gethook(co) == foo))
761+assert((# (((tr == 0x2) and (tr[0x1] == (l.currentline - 0x1))) and (tr[0x2] == l.currentline))))
762+a,b,c=pcall(coroutine.resume,co)
763+assert(((a and b) and (c == (l.currentline + 0x1))))
764+checktraceback(co,{"\u{79}\u{69}\u{65}\u{6c}\u{64}","\u{69}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{3c}"})
765+a,b=coroutine.resume(co)
766+assert((a and (b == "\u{68}\u{69}")))
767+assert((# ((tr == 0x4) and (tr[0x4] == (l.currentline + 0x2)))))
768+assert((debug.gethook(co) == foo))
769+assert((not debug.gethook()))
770+checktraceback(co,{})
771+co=coroutine.create(function (x)
772+local a,b = coroutine.yield(x)
773+assert(((a == 0x64) and (b == nil)))
774+return x
775+end)
776+a,b=coroutine.resume(co,0xa)
777+assert((a and (b == 0xa)))
778+a,b=debug.getlocal(co,0x1,0x1)
779+assert(((a == "\u{78}") and (b == 0xa)))
780+assert((not debug.getlocal(co,0x1,0x5)))
781+assert((debug.setlocal(co,0x1,0x1,0x1e) == "\u{78}"))
782+assert((not debug.setlocal(co,0x1,0x5,0x28)))
783+a,b=coroutine.resume(co,0x64)
784+assert((a and (b == 0x1e)))
785+function f(i)
786+if (i == 0x0) then
787+error(i)
788+else
789+coroutine.yield()
790+;
791+f((i - 0x1))
792+end
793+end
794+co=coroutine.create(function (x)
795+f(x)
796+end)
797+a,b=coroutine.resume(co,0x3)
798+t={"\u{27}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{27}","\u{27}\u{66}\u{27}","\u{69}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{3c}"}
799+while (coroutine.status(co) == "\u{73}\u{75}\u{73}\u{70}\u{65}\u{6e}\u{64}\u{65}\u{64}") do
800+checktraceback(co,t)
801+a,b=coroutine.resume(co)
802+table.insert(t,0x2,"\u{27}\u{66}\u{27}")
803+end
804+t[0x1]="\u{27}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{27}"
805+checktraceback(co,t)
806+local function g
807+(x)
808+coroutine.yield(x)
809+end
810+local function f
811+(i)
812+debug.sethook(function ()
813+
814+end,"\u{6c}")
815+for j = 0x1, 0x3e8
816+do
817+g((i + j))
818+end
819+end
820+local co = coroutine.wrap(f)
821+co(0xa)
822+pcall(co)
823+pcall(co)
824+assert((type(debug.getregistry()) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
825+local a = {}
826+local function f
827+(t)
828+local info = debug.getinfo(0x1)
829+;
830+assert((info.namewhat == "\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}"))
831+a.op=info.name
832+return info.name
833+end
834+setmetatable(a,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = f,["\u{5f}\u{5f}\u{61}\u{64}\u{64}"] = f,["\u{5f}\u{5f}\u{64}\u{69}\u{76}"] = f,["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}"] = f,["\u{5f}\u{5f}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"] = f,["\u{5f}\u{5f}\u{70}\u{6f}\u{77}"] = f,["\u{5f}\u{5f}\u{6d}\u{75}\u{6c}"] = f,["\u{5f}\u{5f}\u{69}\u{64}\u{69}\u{76}"] = f,["\u{5f}\u{5f}\u{75}\u{6e}\u{6d}"] = f,["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = f,["\u{5f}\u{5f}\u{73}\u{75}\u{62}"] = f,["\u{5f}\u{5f}\u{73}\u{68}\u{6c}"] = f,["\u{5f}\u{5f}\u{73}\u{68}\u{72}"] = f,["\u{5f}\u{5f}\u{62}\u{6f}\u{72}"] = f,["\u{5f}\u{5f}\u{62}\u{78}\u{6f}\u{72}"] = f,["\u{5f}\u{5f}\u{65}\u{71}"] = f,["\u{5f}\u{5f}\u{6c}\u{65}"] = f,["\u{5f}\u{5f}\u{6c}\u{74}"] = f,["\u{5f}\u{5f}\u{75}\u{6e}\u{6d}"] = f,["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = f,["\u{5f}\u{5f}\u{62}\u{61}\u{6e}\u{64}"] = f,["\u{5f}\u{5f}\u{62}\u{6e}\u{6f}\u{74}"] = f})
835+local b = setmetatable({},getmetatable(a))
836+assert((((a[0x3] == "\u{69}\u{6e}\u{64}\u{65}\u{78}") and ((a ^ 0x3) == "\u{70}\u{6f}\u{77}")) and ((a .. a) == "\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}")))
837+assert((((a / 0x3) == "\u{64}\u{69}\u{76}") and ((0x3 % a) == "\u{6d}\u{6f}\u{64}")))
838+assert((((((a + 0x3) == "\u{61}\u{64}\u{64}") and ((0x3 - a) == "\u{73}\u{75}\u{62}")) and ((a * 0x3) == "\u{6d}\u{75}\u{6c}")) and (- ((a == "\u{75}\u{6e}\u{6d}") and (# ((a == "\u{6c}\u{65}\u{6e}") and ((a & 0x3) == "\u{62}\u{61}\u{6e}\u{64}")))))))
839+assert((((((a + 0x7530) == "\u{61}\u{64}\u{64}") and ((a - 3.0) == "\u{73}\u{75}\u{62}")) and ((a * 3.0) == "\u{6d}\u{75}\u{6c}")) and (- ((a == "\u{75}\u{6e}\u{6d}") and (# ((a == "\u{6c}\u{65}\u{6e}") and ((a & 0x3) == "\u{62}\u{61}\u{6e}\u{64}")))))))
840+assert((((((a | 0x3) == "\u{62}\u{6f}\u{72}") and ((0x3 ~ a) == "\u{62}\u{78}\u{6f}\u{72}")) and ((a << 0x3) == "\u{73}\u{68}\u{6c}")) and ((a >> 0x1) == "\u{73}\u{68}\u{72}")))
841+assert(((a == b) and (a.op == "\u{65}\u{71}")))
842+assert(((a >= b) and (a.op == "\u{6c}\u{65}")))
843+assert((("\u{78}" >= a) and (a.op == "\u{6c}\u{65}")))
844+assert(((a > b) and (a.op == "\u{6c}\u{74}")))
845+assert(((a > 0xa) and (a.op == "\u{6c}\u{74}")))
846+assert((~ (a == "\u{62}\u{6e}\u{6f}\u{74}")))
847+do
848+local function f
849+()
850+assert((debug.getinfo(0x1).name == "\u{66}\u{6f}\u{72}\u{20}\u{69}\u{74}\u{65}\u{72}\u{61}\u{74}\u{6f}\u{72}"))
851+end
852+for i in f
853+do
854+
855+end
856+end
857+do
858+local name = nil
859+setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
860+local t = debug.getinfo(0x1)
861+assert((t.namewhat == "\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}"))
862+name=t.name
863+end})
864+repeat
865+local a = {}
866+until name
867+assert((name == "\u{5f}\u{5f}\u{67}\u{63}"))
868+end
869+do
870+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{73}")
871+local function countlines
872+(s)
873+return select(0x2,string.gsub(s,"\u{a}",""))
874+end
875+local function deep
876+(lvl,n)
877+if (lvl == 0x0) then
878+return debug.traceback("\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}",n)
879+else
880+return deep((lvl - 0x1),n)
881+end
882+end
883+local function checkdeep
884+(total,start)
885+local s = deep(total,start)
886+local rest = string.match(s,"\u{5e}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{a}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{3a}\u{a}\u{28}\u{2e}\u{2a}\u{29}\u{24}")
887+local cl = countlines(rest)
888+assert((cl <= ((0xa + 0xb) + 0x1)))
889+local brk = string.find(rest,"\u{25}\u{2e}\u{25}\u{2e}\u{25}\u{2e}\u{9}\u{25}\u{28}\u{73}\u{6b}\u{69}\u{70}")
890+if brk then
891+local rest1 = string.sub(rest,0x1,brk)
892+local rest2 = string.sub(rest,brk,(# rest))
893+assert(((countlines(rest1) == 0xa) and (countlines(rest2) == 0xb)))
894+else
895+assert((cl == ((total - start) + 0x2)))
896+end
897+end
898+for d = 0x1, 0x33, 0xa
899+do
900+for l = 0x1, d
901+do
902+coroutine.wrap(checkdeep)(d,l)
903+end
904+end
905+end
906+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{20}\u{6f}\u{6e}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{69}\u{6e}\u{66}\u{6f}")
907+local prog = "\u{2d}\u{2d}\u{20}\u{70}\u{72}\u{6f}\u{67}\u{72}\u{61}\u{6d}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{65}\u{64}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{69}\u{6e}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{73}\u{74}\u{72}\u{69}\u{70}\u{29}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{27}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{32}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{61}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{6e}\u{2c}\u{20}\u{76}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{28}\u{31}\u{2c}\u{20}\u{31}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6e}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{28}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}\u{22}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{76}\u{20}\u{3d}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{29}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{75}\u{6e}\u{6b}\u{6f}\u{77}\u{6e}\u{20}\u{6e}\u{61}\u{6d}\u{65}\u{20}\u{62}\u{75}\u{74}\u{20}\u{6b}\u{6e}\u{6f}\u{77}\u{6e}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{6e}\u{2c}\u{20}\u{76}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{28}\u{31}\u{2c}\u{20}\u{32}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6e}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{28}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}\u{22}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{76}\u{20}\u{3d}\u{3d}\u{20}\u{31}\u{32}\u{29}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{75}\u{6e}\u{6b}\u{6f}\u{77}\u{6e}\u{20}\u{6e}\u{61}\u{6d}\u{65}\u{20}\u{62}\u{75}\u{74}\u{20}\u{6b}\u{6e}\u{6f}\u{77}\u{6e}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{a}\u{2d}\u{2d}\u{20}\u{61}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{61}\u{6e}\u{20}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{6e}\u{2c}\u{20}\u{76}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{28}\u{66}\u{2c}\u{20}\u{31}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6e}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{28}\u{6e}\u{6f}\u{20}\u{6e}\u{61}\u{6d}\u{65}\u{29}\u{22}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{76}\u{20}\u{3d}\u{3d}\u{20}\u{31}\u{32}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{73}\u{65}\u{74}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{28}\u{66}\u{2c}\u{20}\u{31}\u{2c}\u{20}\u{31}\u{33}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{28}\u{6e}\u{6f}\u{20}\u{6e}\u{61}\u{6d}\u{65}\u{29}\u{22}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{20}\u{3d}\u{3d}\u{20}\u{31}\u{33}\u{29}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{74}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{66}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{2e}\u{6e}\u{61}\u{6d}\u{65}\u{20}\u{3d}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{74}\u{2e}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{3e}\u{20}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{2e}\u{6c}\u{61}\u{73}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{3d}\u{3d}\u{20}\u{74}\u{2e}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{2e}\u{73}\u{68}\u{6f}\u{72}\u{74}\u{5f}\u{73}\u{72}\u{63}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{3f}\u{22}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{31}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{31}\u{29}\u{a}\u{a}\u{74}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{66}\u{2c}\u{20}\u{22}\u{4c}\u{22}\u{29}\u{2e}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{6c}\u{69}\u{6e}\u{65}\u{73}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6e}\u{65}\u{78}\u{74}\u{28}\u{74}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{29}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{73}\u{20}\u{61}\u{72}\u{65}\u{20}\u{65}\u{6d}\u{70}\u{74}\u{79}\u{a}\u{a}\u{2d}\u{2d}\u{20}\u{64}\u{75}\u{6d}\u{70}\u{2f}\u{6c}\u{6f}\u{61}\u{64}\u{20}\u{61}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{69}\u{6e}\u{66}\u{6f}\u{a}\u{66}\u{20}\u{3d}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{64}\u{75}\u{6d}\u{70}\u{28}\u{66}\u{29}\u{29}\u{a}\u{a}\u{74}\u{20}\u{3d}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{66}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{2e}\u{6e}\u{61}\u{6d}\u{65}\u{20}\u{3d}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{74}\u{2e}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{3e}\u{20}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{2e}\u{6c}\u{61}\u{73}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{3d}\u{3d}\u{20}\u{74}\u{2e}\u{6c}\u{69}\u{6e}\u{65}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{2e}\u{73}\u{68}\u{6f}\u{72}\u{74}\u{5f}\u{73}\u{72}\u{63}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{3f}\u{22}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{31}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{31}\u{29}\u{a}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{a}"
908+local f = assert(load(string.dump(load(prog),true)))
909+assert((f() == 0xd))
910+do
911+local function foo
912+()
913+local a = 0x1
914+local b = 0x2
915+return b
916+end
917+local s = load(string.dump(foo,true))
918+local line = true
919+debug.sethook(function (e,l)
920+assert((e == "\u{6c}\u{69}\u{6e}\u{65}"))
921+line=l
922+end,"\u{6c}")
923+assert((s() == 0x2))
924+;
925+debug.sethook(nil)
926+assert((line == nil))
927+end
928+do
929+local prog = "\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{78}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{79}\u{29}\u{20}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{20}\u{2b}\u{20}\u{79}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}"
930+local name = string.rep("\u{78}",0x3e8)
931+local p = assert(load(prog,name))
932+local c = string.dump(p)
933+assert((# ((c > 0x3e8) and (# (c < 0x7d0)))))
934+local f = assert(load(c))
935+local g = f()
936+local h = g(0x3)
937+assert((h(0x5) == 0x8))
938+assert((((debug.getinfo(f).source == name) and (debug.getinfo(g).source == name)) and (debug.getinfo(h).source == name)))
939+local c = string.dump(p,true)
940+assert((# (c < 0x1f4)))
941+local f = assert(load(c))
942+local g = f()
943+local h = g(0x1e)
944+assert((h(0x32) == 0x50))
945+assert((((debug.getinfo(f).source == "\u{3d}\u{3f}") and (debug.getinfo(g).source == "\u{3d}\u{3f}")) and (debug.getinfo(h).source == "\u{3d}\u{3f}")))
946+end
947+print("\u{4f}\u{4b}")
desk/res/lua/cycled/errors.luanew file+493
@@ -0,0 +1,493 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+local mt = (getmetatable(_G) or {})
4+local oldmm = mt.__index
5+mt.__index=nil
6+local function checkerr
7+(msg,f, ...)
8+local st,err = pcall(f,...)
9+assert((not (st and string.find(err,msg))))
10+end
11+local function doit
12+(s)
13+local f,msg = load(s)
14+if (not f) then
15+return msg
16+end
17+local cond,msg = pcall(f)
18+return ((not cond) and msg)
19+end
20+local function checkmessage
21+(prog,msg,debug)
22+local m = doit(prog)
23+if debug then
24+print(m,msg)
25+end
26+assert(string.find(m,msg,0x1,true))
27+end
28+local function checksyntax
29+(prog,extra,token,line)
30+local msg = doit(prog)
31+if (not (string.find(token,"\u{5e}\u{3c}\u{25}\u{61}") and (not string.find(token,"\u{5e}\u{63}\u{68}\u{61}\u{72}\u{25}\u{28}")))) then
32+token=("\u{27}" .. (token .. "\u{27}"))
33+end
34+token=string.gsub(token,"\u{28}\u{25}\u{70}\u{29}","\u{25}\u{25}\u{25}\u{31}")
35+local pt = string.format("\u{5e}\u{25}\u{25}\u{5b}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{22}\u{2e}\u{2a}\u{22}\u{25}\u{25}\u{5d}\u{3a}\u{25}\u{64}\u{3a}\u{20}\u{2e}\u{2d}\u{20}\u{6e}\u{65}\u{61}\u{72}\u{20}\u{25}\u{73}\u{24}",line,token)
36+assert(string.find(msg,pt))
37+assert(string.find(msg,msg,0x1,true))
38+end
39+assert((doit("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{27}\u{68}\u{69}\u{27}\u{2c}\u{20}\u{30}\u{29}") == "\u{68}\u{69}"))
40+assert((doit("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{29}") == nil))
41+assert(doit("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{2e}\u{75}\u{6e}\u{70}\u{61}\u{63}\u{6b}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{31}\u{2c}\u{20}\u{6e}\u{3d}\u{32}\u{5e}\u{33}\u{30}\u{29}"))
42+assert(doit("\u{61}\u{3d}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{29}"))
43+assert((not (doit("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{28}\u{31}\u{29}") and doit("\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{28}\u{29}"))))
44+assert(doit("\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{28}\u{29}"))
45+assert(doit("\u{72}\u{65}\u{70}\u{65}\u{61}\u{74}\u{20}\u{75}\u{6e}\u{74}\u{69}\u{6c}\u{20}\u{31}\u{3b}\u{20}\u{61}"))
46+assert(doit("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{3b}\u{3b}"))
47+assert(doit("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{66}\u{61}\u{6c}\u{73}\u{65}\u{29}"))
48+assert(doit("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6e}\u{69}\u{6c}\u{29}"))
49+assert(doit("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{61}\u{20}\u{28}\u{2e}\u{2e}\u{2e}\u{20}\u{2c}\u{20}\u{2e}\u{2e}\u{2e}\u{29}\u{20}\u{65}\u{6e}\u{64}"))
50+assert(doit("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{61}\u{20}\u{28}\u{2c}\u{20}\u{2e}\u{2e}\u{2e}\u{29}\u{20}\u{65}\u{6e}\u{64}"))
51+assert(doit("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{74}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{74}\u{20}\u{3d}\u{20}\u{74}\u{5b}\u{23}\u{74}\u{5d}\u{20}\u{2b}\u{20}\u{31}"))
52+checksyntax("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{34}\u{a}\u{a}","\u{27}\u{7d}\u{27}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{28}\u{74}\u{6f}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{27}\u{7b}\u{27}\u{20}\u{61}\u{74}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{31}\u{29}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}",0x3)
53+do
54+local function checksyntax
55+(prog,msg,line)
56+local st,err = load(prog)
57+assert(string.find(err,("\u{6c}\u{69}\u{6e}\u{65}\u{20}" .. line)))
58+assert(string.find(err,msg,0x1,true))
59+end
60+checksyntax("\u{20}\u{20}\u{20}\u{20}\u{3a}\u{3a}\u{41}\u{3a}\u{3a}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{3a}\u{3a}\u{41}\u{3a}\u{3a}\u{a}\u{20}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{41}\u{27}\u{20}\u{61}\u{6c}\u{72}\u{65}\u{61}\u{64}\u{79}\u{20}\u{64}\u{65}\u{66}\u{69}\u{6e}\u{65}\u{64}",0x1)
61+checksyntax("\u{20}\u{20}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{41}\u{a}\u{20}\u{20}\u{20}\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{41}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}","\u{6e}\u{6f}\u{20}\u{76}\u{69}\u{73}\u{69}\u{62}\u{6c}\u{65}\u{20}\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{41}\u{27}",0x2)
62+end
63+if (not T) then
64+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{43}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
65+else
66+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}")
67+local a = {}
68+for i = 0x1, 0x2710
69+do
70+a[i]=true
71+end
72+collectgarbage()
73+T.totalmem((T.totalmem() + 0x2710))
74+local st,msg = pcall(function ()
75+for i = 0x1, 0x186a0
76+do
77+a[i]=tostring(i)
78+end
79+end)
80+T.totalmem(0x0)
81+assert((not (st and (msg == ("\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}" .. "\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}")))))
82+local res = T.testC("\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{70}\u{75}\u{73}\u{68}\u{20}\u{31}\u{36}\u{20}\u{65}\u{6c}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{73}\u{20}\u{6f}\u{6e}\u{20}\u{74}\u{68}\u{65}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{77}\u{6f}\u{72}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{34}\u{20}\u{72}\u{65}\u{6d}\u{61}\u{69}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{6c}\u{6f}\u{74}\u{73}\u{a}\u{20}\u{20}\u{20}\u{20}\u{74}\u{72}\u{61}\u{63}\u{65}\u{62}\u{61}\u{63}\u{6b}\u{20}\u{78}\u{75}\u{78}\u{75}\u{20}\u{31}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{a}\u{20}\u{20}")
83+assert(string.find(res,"\u{78}\u{75}\u{78}\u{75}\u{2e}\u{2d}\u{6d}\u{61}\u{69}\u{6e}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}"))
84+end
85+checkmessage("\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{20}\u{2b}\u{20}\u{31}","\u{61}\u{72}\u{69}\u{74}\u{68}\u{6d}\u{65}\u{74}\u{69}\u{63}")
86+checkmessage("\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{20}\u{7c}\u{20}\u{31}","\u{62}\u{69}\u{74}\u{77}\u{69}\u{73}\u{65}\u{20}\u{6f}\u{70}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
87+checkmessage("\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{20}\u{3c}\u{20}\u{31}","\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}")
88+checkmessage("\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{20}\u{3c}\u{3d}\u{20}\u{31}","\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{65}")
89+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{31}\u{3b}\u{20}\u{62}\u{62}\u{62}\u{62}\u{3d}\u{32}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{33}\u{29}\u{2b}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
90+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{64}\u{6f}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{31}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{61}\u{61}\u{61}\u{3a}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
91+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
92+assert((not string.find(doit("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{31}\u{33}\u{7d}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{62}\u{62}\u{62}\u{3d}\u{31}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{5b}\u{62}\u{62}\u{62}\u{62}\u{5d}\u{28}\u{33}\u{29}"),"\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")))
93+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{31}\u{33}\u{7d}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{62}\u{62}\u{62}\u{3d}\u{31}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{5b}\u{62}\u{62}\u{62}\u{62}\u{5d}\u{28}\u{33}\u{29}","\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")
94+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{28}\u{31}\u{29}\u{2e}\u{2e}\u{7b}\u{7d}","\u{61}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
95+checkmessage("\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{5f}\u{45}\u{4e}\u{56}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{7d}\u{3b}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{61}\u{2e}\u{5f}\u{45}\u{4e}\u{56}\u{2e}\u{78}\u{20}\u{2b}\u{20}\u{31}\u{29}","\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{78}\u{27}")
96+_G.aaa,_G.bbbb=nil
97+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3b}\u{20}\u{61}\u{28}\u{31}\u{33}\u{29}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{27}")
98+checkmessage("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{61}\u{64}\u{64}\u{20}\u{3d}\u{20}\u{33}\u{34}\u{7d}\u{29}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{a}","\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{61}\u{64}\u{64}\u{27}")
99+checkmessage("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{6c}\u{74}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{7d}\u{29}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{3e}\u{20}\u{61}\u{a}","\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{6c}\u{74}\u{27}")
100+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
101+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{64}\u{6f}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{31}\u{20}\u{65}\u{6e}\u{64}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{61}\u{61}\u{3a}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
102+checkmessage("\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{23}\u{70}\u{72}\u{69}\u{6e}\u{74}","\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{6f}\u{66}\u{20}\u{61}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
103+checkmessage("\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{23}\u{33}","\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{6f}\u{66}\u{20}\u{61}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
104+_G.aaa=nil
105+checkmessage("\u{61}\u{61}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{3a}\u{64}\u{64}\u{64}\u{28}\u{39}\u{29}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{61}\u{27}")
106+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{62}\u{62}\u{62}\u{3d}\u{31}\u{7d}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{3a}\u{64}\u{64}\u{64}\u{28}\u{39}\u{29}","\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{27}")
107+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{62}\u{62}\u{62}\u{3d}\u{7b}\u{7d}\u{7d}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{3a}\u{64}\u{64}\u{64}\u{28}\u{39}\u{29}","\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{64}\u{64}\u{64}\u{27}")
108+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{2c}\u{63}\u{3b}\u{20}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{62}\u{2b}\u{31}\u{2e}\u{31}\u{20}\u{65}\u{6e}\u{64}\u{29}\u{28}\u{29}","\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{27}\u{62}\u{27}")
109+assert((not doit("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{62}\u{62}\u{62}\u{3d}\u{7b}\u{64}\u{64}\u{64}\u{3d}\u{6e}\u{65}\u{78}\u{74}\u{7d}\u{7d}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{2e}\u{62}\u{62}\u{62}\u{3a}\u{64}\u{64}\u{64}\u{28}\u{6e}\u{69}\u{6c}\u{29}")))
110+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{2c}\u{63}\u{63}\u{3b}\u{20}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{63}\u{63}\u{5b}\u{31}\u{5d}\u{20}\u{65}\u{6e}\u{64}\u{29}\u{28}\u{29}","\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{27}\u{63}\u{63}\u{27}")
111+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{2c}\u{63}\u{63}\u{3b}\u{20}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{61}\u{2e}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{20}\u{65}\u{6e}\u{64}\u{29}\u{28}\u{29}","\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{27}\u{61}\u{27}")
112+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{5f}\u{45}\u{4e}\u{56}\u{20}\u{3d}\u{20}\u{7b}\u{78}\u{3d}\u{7b}\u{7d}\u{7d}\u{3b}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{27}")
113+checkmessage("\u{42}\u{42}\u{3d}\u{31}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{78}\u{3d}\u{61}\u{61}\u{61}\u{2b}\u{42}\u{42}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{61}\u{27}")
114+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{78}\u{3d}\u{33}\u{2e}\u{33}\u{2f}\u{61}\u{61}\u{61}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{61}\u{27}")
115+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{32}\u{3b}\u{20}\u{42}\u{42}\u{3d}\u{6e}\u{69}\u{6c}\u{3b}\u{78}\u{3d}\u{61}\u{61}\u{61}\u{2a}\u{42}\u{42}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{42}\u{42}\u{27}")
116+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{78}\u{3d}\u{2d}\u{61}\u{61}\u{61}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{61}\u{27}")
117+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{31}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{2c}\u{62}\u{62}\u{62}\u{62}\u{3d}\u{32}\u{2c}\u{33}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{62}\u{62}\u{62}\u{28}\u{33}\u{29}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
118+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{31}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{61}\u{2c}\u{62}\u{62}\u{62}\u{62}\u{3d}\u{32}\u{2c}\u{33}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{62}\u{62}\u{62}\u{62}\u{28}\u{31}\u{29}\u{20}\u{6f}\u{72}\u{20}\u{61}\u{61}\u{61}\u{28}\u{33}\u{29}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{62}\u{62}\u{62}\u{62}\u{27}")
119+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{2c}\u{63}\u{2c}\u{66}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{31}\u{2c}\u{31}\u{3b}\u{20}\u{66}\u{28}\u{28}\u{61}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{29}\u{20}\u{6f}\u{72}\u{20}\u{63}\u{29}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{66}\u{27}")
120+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{2c}\u{63}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{31}\u{2c}\u{31}\u{3b}\u{20}\u{28}\u{28}\u{61}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{29}\u{20}\u{6f}\u{72}\u{20}\u{63}\u{29}\u{28}\u{29}","\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{61}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
121+assert((not string.find(doit("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{78}\u{3d}\u{28}\u{61}\u{61}\u{61}\u{20}\u{6f}\u{72}\u{20}\u{61}\u{61}\u{61}\u{29}\u{2b}\u{28}\u{61}\u{61}\u{61}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{61}\u{61}\u{29}"),"\u{27}\u{61}\u{61}\u{61}\u{27}")))
122+assert((not string.find(doit("\u{61}\u{61}\u{61}\u{3d}\u{7b}\u{7d}\u{3b}\u{20}\u{28}\u{61}\u{61}\u{61}\u{20}\u{6f}\u{72}\u{20}\u{61}\u{61}\u{61}\u{29}\u{28}\u{29}"),"\u{27}\u{61}\u{61}\u{61}\u{27}")))
123+checkmessage("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{20}\u{3c}\u{20}\u{31}\u{30}\u{29}","\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")
124+checkmessage("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{20}\u{3c}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{29}","\u{74}\u{77}\u{6f}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}")
125+checkmessage("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{27}\u{31}\u{30}\u{27}\u{20}\u{3c}\u{20}\u{31}\u{30}\u{29}","\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")
126+checkmessage("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{30}\u{20}\u{3c}\u{20}\u{27}\u{32}\u{33}\u{27}\u{29}","\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")
127+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}\u{3b}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{3c}\u{3c}\u{20}\u{32}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}")
128+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{20}\u{3e}\u{3e}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
129+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{2e}\u{31}\u{20}\u{3c}\u{3c}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
130+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}\u{20}\u{26}\u{20}\u{31}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
131+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}\u{20}\u{26}\u{20}\u{31}\u{65}\u{31}\u{30}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
132+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{2e}\u{30}\u{20}\u{7c}\u{20}\u{31}\u{65}\u{34}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
133+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{65}\u{31}\u{30}\u{30}\u{20}\u{7e}\u{20}\u{31}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
134+checkmessage("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{73}\u{75}\u{62}\u{28}\u{27}\u{61}\u{27}\u{2c}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{31}\u{30}\u{30}\u{29}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
135+checkmessage("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{72}\u{65}\u{70}\u{28}\u{27}\u{61}\u{27}\u{2c}\u{20}\u{33}\u{2e}\u{33}\u{29}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
136+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{36}\u{65}\u{34}\u{30}\u{20}\u{26}\u{20}\u{37}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
137+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{34}\u{20}\u{3c}\u{3c}\u{20}\u{37}\u{65}\u{33}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
138+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7e}\u{2d}\u{33}\u{65}\u{34}\u{30}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
139+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7e}\u{2d}\u{33}\u{2e}\u{30}\u{30}\u{39}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
140+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{2e}\u{30}\u{30}\u{39}\u{20}\u{26}\u{20}\u{31}","\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
141+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{34}\u{20}\u{3e}\u{3e}\u{20}\u{7b}\u{7d}","\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
142+checkmessage("\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{34}\u{20}\u{2f}\u{2f}\u{20}\u{30}","\u{64}\u{69}\u{76}\u{69}\u{64}\u{65}\u{20}\u{62}\u{79}\u{20}\u{7a}\u{65}\u{72}\u{6f}")
143+checkmessage("\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{20}\u{25}\u{20}\u{30}","\u{27}\u{6e}\u{25}\u{30}\u{27}")
144+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{7d}\u{29}\u{2e}\u{78}","\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{61}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
145+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{2c}\u{20}\u{31}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{74}\u{61}\u{62}\u{6c}\u{65}")
146+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{69}\u{6e}\u{2c}\u{20}\u{31}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{46}\u{49}\u{4c}\u{45}")
147+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{2c}\u{20}\u{31}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{69}\u{6e}\u{69}\u{74}\u{69}\u{61}\u{6c}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
148+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{27}\u{78}\u{27}\u{2c}\u{20}\u{31}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")
149+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{7b}\u{7d}\u{2c}\u{20}\u{31}\u{30}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{6c}\u{69}\u{6d}\u{69}\u{74}")
150+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{7b}\u{7d}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{6c}\u{69}\u{6d}\u{69}\u{74}")
151+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{31}\u{30}\u{2c}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{73}\u{74}\u{65}\u{70}")
152+checkmessage("\u{66}\u{6f}\u{72}\u{20}\u{69}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{31}\u{30}\u{2c}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
153+_G.D=debug
154+checkmessage("\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{6c}\u{69}\u{67}\u{68}\u{74}\u{20}\u{75}\u{64}\u{61}\u{74}\u{61}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{44}\u{2e}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{69}\u{64}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{65}\u{6e}\u{64}\u{2c}\u{20}\u{31}\u{29}\u{a}\u{20}\u{20}\u{44}\u{2e}\u{73}\u{65}\u{74}\u{75}\u{73}\u{65}\u{72}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{28}\u{78}\u{2c}\u{20}\u{7b}\u{7d}\u{29}\u{a}","\u{6c}\u{69}\u{67}\u{68}\u{74}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}")
155+_G.D=nil
156+do
157+checkmessage("\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{69}\u{6f}\u{2e}\u{69}\u{6e}\u{70}\u{75}\u{74}\u{28}\u{29}\u{29}","\u{28}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{2c}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{46}\u{49}\u{4c}\u{45}\u{2a}\u{29}")
158+_G.XX=setmetatable({},{["\u{5f}\u{5f}\u{6e}\u{61}\u{6d}\u{65}"] = "\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}"})
159+assert(string.find(tostring(XX),"\u{5e}\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}"))
160+checkmessage("\u{69}\u{6f}\u{2e}\u{69}\u{6e}\u{70}\u{75}\u{74}\u{28}\u{58}\u{58}\u{29}","\u{28}\u{46}\u{49}\u{4c}\u{45}\u{2a}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{2c}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}\u{29}")
161+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{58}\u{58}\u{20}\u{2b}\u{20}\u{31}","\u{6f}\u{6e}\u{20}\u{61}\u{20}\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
162+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7e}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{69}\u{6e}","\u{6f}\u{6e}\u{20}\u{61}\u{20}\u{46}\u{49}\u{4c}\u{45}\u{2a}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
163+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{58}\u{58}\u{20}\u{3c}\u{20}\u{58}\u{58}","\u{74}\u{77}\u{6f}\u{20}\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}")
164+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{7d}\u{20}\u{3c}\u{20}\u{58}\u{58}","\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}")
165+checkmessage("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{58}\u{58}\u{20}\u{3c}\u{20}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{69}\u{6e}","\u{4d}\u{79}\u{20}\u{54}\u{79}\u{70}\u{65}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{46}\u{49}\u{4c}\u{45}\u{2a}")
166+_G.XX=nil
167+if T then
168+local x = setmetatable({},{["\u{5f}\u{5f}\u{6e}\u{61}\u{6d}\u{65}"] = "\u{54}\u{41}\u{42}\u{4c}\u{45}"})
169+assert((T.testC("\u{4c}\u{74}\u{6f}\u{6c}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}",x) == tostring(x)))
170+local a,b = T.testC("\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{4c}\u{74}\u{6f}\u{6c}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}",x)
171+assert(((a == 0xa) and (b == tostring(x))))
172+setmetatable(x,{["\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"] = function (o)
173+assert((o == x))
174+return "\u{41}\u{42}\u{43}"
175+end})
176+local a,b,c = T.testC("\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{4c}\u{74}\u{6f}\u{6c}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}",x)
177+assert((((a == x) and (b == 0xa)) and (c == "\u{41}\u{42}\u{43}")))
178+end
179+end
180+checkmessage("\u{28}\u{69}\u{6f}\u{2e}\u{77}\u{72}\u{69}\u{74}\u{65}\u{20}\u{6f}\u{72}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{29}\u{7b}\u{7d}","\u{69}\u{6f}\u{2e}\u{77}\u{72}\u{69}\u{74}\u{65}")
181+checkmessage("\u{28}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{20}\u{6f}\u{72}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{29}\u{7b}\u{7d}","\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}")
182+do
183+local f = function (a)
184+return (a + 0x1)
185+end
186+f=assert(load(string.dump(f,true)))
187+assert((f(0x3) == 0x4))
188+checkerr("\u{5e}\u{25}\u{3f}\u{3a}\u{25}\u{2d}\u{31}\u{3a}",f,{})
189+f=function ()
190+local a
191+;
192+a={}
193+;
194+return (a + 0x2)
195+end
196+f=assert(load(string.dump(f,true)))
197+checkerr("\u{5e}\u{25}\u{3f}\u{3a}\u{25}\u{2d}\u{31}\u{3a}\u{2e}\u{2a}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}",f)
198+end
199+local t = {}
200+for i = 0x1, 0x3e8
201+do
202+t[i]=("\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{78}" .. i)
203+end
204+local s = table.concat(t,"\u{3b}\u{20}")
205+t=nil
206+checkmessage((s .. "\u{3b}\u{20}\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{62}\u{62}\u{62}\u{20}\u{2b}\u{20}\u{31}"),"\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{62}\u{62}\u{62}\u{27}")
207+checkmessage(("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{5f}\u{45}\u{4e}\u{56}\u{3d}\u{5f}\u{45}\u{4e}\u{56}\u{3b}" .. (s .. "\u{3b}\u{20}\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{62}\u{62}\u{62}\u{20}\u{2b}\u{20}\u{31}")),"\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{62}\u{62}\u{62}\u{27}")
208+checkmessage((s .. "\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{74}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{20}\u{3d}\u{20}\u{74}\u{2e}\u{62}\u{62}\u{62}\u{20}\u{2b}\u{20}\u{31}"),"\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{27}")
209+checkmessage((s .. "\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{74}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{3b}\u{20}\u{74}\u{3a}\u{62}\u{62}\u{62}\u{28}\u{29}"),"\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{62}\u{62}\u{62}\u{27}")
210+checkmessage("\u{61}\u{61}\u{61}\u{3d}\u{39}\u{a}\u{72}\u{65}\u{70}\u{65}\u{61}\u{74}\u{20}\u{75}\u{6e}\u{74}\u{69}\u{6c}\u{20}\u{33}\u{3d}\u{3d}\u{33}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{3d}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{63}\u{6f}\u{73}\u{28}\u{33}\u{29}\u{29}\u{a}\u{69}\u{66}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{78}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{20}\u{3d}\u{20}\u{31}\u{2c}\u{20}\u{7b}\u{a}\u{20}\u{20}\u{7b}\u{78}\u{3d}\u{27}\u{61}\u{27}\u{2e}\u{2e}\u{27}\u{62}\u{27}\u{2e}\u{2e}\u{27}\u{63}\u{27}\u{2c}\u{20}\u{79}\u{3d}\u{27}\u{62}\u{27}\u{2c}\u{20}\u{7a}\u{3d}\u{78}\u{7d}\u{2c}\u{a}\u{20}\u{20}\u{7b}\u{31}\u{2c}\u{32}\u{2c}\u{33}\u{2c}\u{34}\u{2c}\u{35}\u{7d}\u{20}\u{6f}\u{72}\u{20}\u{33}\u{2b}\u{33}\u{3c}\u{3d}\u{33}\u{2b}\u{33}\u{2c}\u{a}\u{20}\u{20}\u{33}\u{2b}\u{31}\u{3e}\u{33}\u{2b}\u{31}\u{2c}\u{a}\u{20}\u{20}\u{7b}\u{64}\u{20}\u{3d}\u{20}\u{78}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{61}\u{61}\u{5b}\u{78}\u{20}\u{6f}\u{72}\u{20}\u{79}\u{5d}\u{7d}\u{7d}\u{a}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{61}\u{27}")
211+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{2c}\u{79}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{2c}\u{31}\u{a}\u{69}\u{66}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{31}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{30}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{a}\u{78}\u{2e}\u{61}\u{28}\u{29}","\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{61}\u{27}")
212+checkmessage("\u{70}\u{72}\u{65}\u{66}\u{69}\u{78}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{31}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{a}\u{20}\u{20}\u{69}\u{66}\u{20}\u{6e}\u{69}\u{6c}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{62}\u{72}\u{65}\u{61}\u{6b}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{28}\u{70}\u{72}\u{65}\u{66}\u{69}\u{78}\u{2c}\u{20}\u{61}\u{29}\u{a}\u{65}\u{6e}\u{64}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{69}\u{6e}\u{73}\u{65}\u{72}\u{74}\u{27}")
213+checkmessage("\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{74}\u{61}\u{69}\u{6c}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{22}\u{61}\u{22}\u{29}\u{a}","\u{73}\u{69}\u{6e}")
214+checkmessage("\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{28}\u{22}\u{6e}\u{6f}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{22}\u{29}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}")
215+checkmessage("\u{78}\u{20}\u{3d}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{20}\u{2e}\u{2e}\u{20}\u{22}\u{61}\u{22}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{65}\u{6e}\u{61}\u{74}\u{65}")
216+checkmessage("\u{78}\u{20}\u{3d}\u{20}\u{22}\u{61}\u{22}\u{20}\u{2e}\u{2e}\u{20}\u{66}\u{61}\u{6c}\u{73}\u{65}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{65}\u{6e}\u{61}\u{74}\u{65}")
217+checkmessage("\u{78}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{20}\u{2e}\u{2e}\u{20}\u{32}","\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}\u{65}\u{6e}\u{61}\u{74}\u{65}")
218+checkmessage("\u{67}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{69}\u{6e}\u{29}\u{2e}\u{5f}\u{5f}\u{67}\u{63}\u{28}\u{29}","\u{6e}\u{6f}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
219+checkmessage("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{56}\u{61}\u{72}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6d}\u{61}\u{69}\u{6e}\u{28}\u{29}\u{a}\u{20}\u{20}\u{4e}\u{6f}\u{53}\u{75}\u{63}\u{68}\u{4e}\u{61}\u{6d}\u{65}\u{20}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{28}\u{29}\u{20}\u{56}\u{61}\u{72}\u{3d}\u{30}\u{20}\u{65}\u{6e}\u{64}\u{29}\u{a}\u{65}\u{6e}\u{64}\u{a}\u{6d}\u{61}\u{69}\u{6e}\u{28}\u{29}\u{a}","\u{67}\u{6c}\u{6f}\u{62}\u{61}\u{6c}\u{20}\u{27}\u{4e}\u{6f}\u{53}\u{75}\u{63}\u{68}\u{4e}\u{61}\u{6d}\u{65}\u{27}")
220+print("\u{2b}")
221+aaa={}
222+;
223+setmetatable(aaa,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = string})
224+checkmessage("\u{61}\u{61}\u{61}\u{3a}\u{73}\u{75}\u{62}\u{28}\u{29}","\u{62}\u{61}\u{64}\u{20}\u{73}\u{65}\u{6c}\u{66}")
225+checkmessage("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{73}\u{75}\u{62}\u{28}\u{27}\u{61}\u{27}\u{2c}\u{20}\u{7b}\u{7d}\u{29}","\u{23}\u{32}")
226+checkmessage("\u{28}\u{27}\u{61}\u{27}\u{29}\u{3a}\u{73}\u{75}\u{62}\u{7b}\u{7d}","\u{23}\u{31}")
227+checkmessage("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{2e}\u{73}\u{6f}\u{72}\u{74}\u{28}\u{7b}\u{31}\u{2c}\u{32}\u{2c}\u{33}\u{7d}\u{2c}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{2e}\u{73}\u{6f}\u{72}\u{74}\u{29}","\u{27}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{2e}\u{73}\u{6f}\u{72}\u{74}\u{27}")
228+checkmessage("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{67}\u{73}\u{75}\u{62}\u{28}\u{27}\u{73}\u{27}\u{2c}\u{20}\u{27}\u{73}\u{27}\u{2c}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{29}","\u{27}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{27}")
229+_G.aaa=nil
230+local function f
231+(n)
232+local c = coroutine.create(f)
233+local a,b = coroutine.resume(c)
234+return b
235+end
236+assert(string.find(f(),"\u{43}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))
237+checkmessage("\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{28}\u{29}","\u{6f}\u{75}\u{74}\u{73}\u{69}\u{64}\u{65}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}")
238+f=coroutine.wrap(function ()
239+table.sort({0x1,0x2,0x3},coroutine.yield)
240+end)
241+checkerr("\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{61}\u{63}\u{72}\u{6f}\u{73}\u{73}",f)
242+local idsize = (0x3c - 0x1)
243+local function checksize
244+(source)
245+local _,msg = load("\u{78}",source)
246+msg=string.match(msg,"\u{5e}\u{28}\u{5b}\u{5e}\u{3a}\u{5d}\u{2a}\u{29}\u{3a}")
247+assert((msg:len() <= idsize))
248+end
249+for i = (0x3c - 0xa), (0x3c + 0xa)
250+do
251+checksize(("\u{40}" .. string.rep("\u{78}",i)))
252+checksize(string.rep("\u{78}",(i - 0xa)))
253+checksize(("\u{3d}" .. string.rep("\u{78}",i)))
254+end
255+local function lineerror
256+(s,l)
257+local err,msg = pcall(load(s))
258+local line = tonumber(string.match(msg,"\u{3a}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{3a}"))
259+assert(((line == l) or (not (line and (not l)))))
260+end
261+lineerror("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{a}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{69}\u{3d}\u{31}\u{2c}\u{27}\u{61}\u{27}\u{20}\u{64}\u{6f}\u{20}\u{a}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{69}\u{29}\u{20}\u{a}\u{20}\u{65}\u{6e}\u{64}",0x2)
262+lineerror("\u{a}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{a}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{6b}\u{2c}\u{76}\u{20}\u{69}\u{6e}\u{20}\u{33}\u{20}\u{a}\u{20}\u{64}\u{6f}\u{20}\u{a}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{6b}\u{29}\u{20}\u{a}\u{20}\u{65}\u{6e}\u{64}",0x3)
263+lineerror("\u{a}\u{a}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{6b}\u{2c}\u{76}\u{20}\u{69}\u{6e}\u{20}\u{a}\u{20}\u{33}\u{20}\u{a}\u{20}\u{64}\u{6f}\u{20}\u{a}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{6b}\u{29}\u{20}\u{a}\u{20}\u{65}\u{6e}\u{64}",0x4)
264+lineerror("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{61}\u{2e}\u{78}\u{2e}\u{79}\u{20}\u{28}\u{29}\u{a}\u{61}\u{3d}\u{61}\u{2b}\u{31}\u{a}\u{65}\u{6e}\u{64}",0x1)
265+lineerror("\u{61}\u{20}\u{3d}\u{20}\u{a}\u{61}\u{a}\u{2b}\u{a}\u{7b}\u{7d}",0x3)
266+lineerror("\u{61}\u{20}\u{3d}\u{20}\u{a}\u{33}\u{a}\u{2b}\u{a}\u{28}\u{a}\u{34}\u{a}\u{2f}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{29}",0x6)
267+lineerror("\u{61}\u{20}\u{3d}\u{20}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{a}\u{2b}\u{a}\u{28}\u{a}\u{34}\u{a}\u{2f}\u{a}\u{37}\u{29}",0x3)
268+lineerror("\u{61}\u{a}\u{3d}\u{a}\u{2d}\u{a}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{a}\u{3b}",0x3)
269+lineerror("\u{61}\u{a}\u{28}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{3c}\u{3c}\u{a}\u{32}\u{33}\u{29}\u{a}",0x2)
270+lineerror("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{33}\u{7d}\u{a}\u{61}\u{a}\u{2e}\u{a}\u{78}\u{a}\u{28}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{3c}\u{3c}\u{a}\u{32}\u{33}\u{a}\u{29}\u{a}",0x5)
271+lineerror("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{33}\u{7d}\u{a}\u{61}\u{a}\u{2e}\u{a}\u{78}\u{a}\u{28}\u{a}\u{32}\u{33}\u{20}\u{2b}\u{20}\u{61}\u{a}\u{29}\u{a}",0x6)
272+local p = "\u{20}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{67}\u{28}\u{29}\u{20}\u{66}\u{28}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{28}\u{78}\u{29}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{27}\u{61}\u{27}\u{2c}\u{20}\u{58}\u{58}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{67}\u{28}\u{29}\u{a}"
273+XX=0x3
274+;
275+lineerror(p,0x3)
276+XX=0x0
277+;
278+lineerror(p,false)
279+XX=0x1
280+;
281+lineerror(p,0x2)
282+XX=0x2
283+;
284+lineerror(p,0x1)
285+_G.XX,_G.g,_G.f=nil
286+lineerror("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{66}\u{61}\u{6c}\u{73}\u{65}\u{a}\u{69}\u{66}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{27}\u{74}\u{65}\u{73}\u{74}\u{27}\u{a}\u{65}\u{6e}\u{64}",0x3)
287+lineerror("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{66}\u{61}\u{6c}\u{73}\u{65}\u{a}\u{69}\u{66}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{69}\u{66}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{27}\u{74}\u{65}\u{73}\u{74}\u{27}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{65}\u{6e}\u{64}",0x5)
288+lineerror("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{30}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{31}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{63}\u{20}\u{3d}\u{20}\u{62}\u{20}\u{25}\u{20}\u{61}\u{a}",0x3)
289+do
290+local s = string.format("\u{25}\u{73}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{5f}\u{5f}\u{41}\u{2e}\u{78}",string.rep("\u{a}",0x12c))
291+lineerror(s,0x12d)
292+end
293+if (not _soft) then
294+collectgarbage()
295+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")
296+local C = 0x0
297+local l = (debug.getinfo(0x1,"\u{6c}").currentline + 0x1)
298+local function auxy
299+()
300+C=(C + 0x1)
301+;
302+auxy()
303+end
304+function YY()
305+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
306+auxy()
307+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
308+end
309+local function checkstackmessage
310+(m)
311+print(("\u{28}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{61}\u{66}\u{74}\u{65}\u{72}\u{20}" .. (C .. "\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{29}")))
312+C=0x0
313+return string.find(m,"\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")
314+end
315+assert(checkstackmessage(doit("\u{59}\u{59}\u{28}\u{29}")))
316+assert(checkstackmessage(doit("\u{59}\u{59}\u{28}\u{29}")))
317+assert(checkstackmessage(doit("\u{59}\u{59}\u{28}\u{29}")))
318+_G.YY=nil
319+local l1
320+local function g
321+(x)
322+l1=(debug.getinfo(x,"\u{6c}").currentline + 0x2)
323+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
324+auxy()
325+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
326+end
327+local _,stackmsg = xpcall(g,debug.traceback,0x1)
328+print("\u{2b}")
329+local stack = {}
330+for line in string.gmatch(stackmsg,"\u{5b}\u{5e}\u{a}\u{5d}\u{2a}")
331+do
332+local curr = string.match(line,"\u{3a}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{3a}")
333+if curr then
334+table.insert(stack,tonumber(curr))
335+end
336+end
337+local i = 0x1
338+while (stack[i] ~= l1) do
339+assert((stack[i] == l))
340+i=(i + 0x1)
341+end
342+assert((i > 0xf))
343+local res,msg = xpcall(error,error)
344+assert((not (res and (type(msg) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))))
345+print("\u{2b}")
346+local function f
347+(x)
348+if (x == 0x0) then
349+error("\u{61}\u{a}")
350+else
351+local aux = function ()
352+return f((x - 0x1))
353+end
354+local a,b = xpcall(aux,aux)
355+return a,b
356+end
357+end
358+f(0x3)
359+local function loop
360+(x,y,z)
361+return (0x1 + loop(x,y,z))
362+end
363+local res,msg = xpcall(loop,function (m)
364+assert(string.find(m,"\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))
365+checkerr("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{68}\u{61}\u{6e}\u{64}\u{6c}\u{69}\u{6e}\u{67}",loop)
366+assert((math.sin(0x0) == 0x0))
367+return 0xf
368+end)
369+assert((msg == 0xf))
370+local f = function ()
371+for i = 0xf41dc, 0xf4240, 0x1
372+do
373+table.unpack({},0x1,i)
374+end
375+end
376+checkerr("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",f)
377+end
378+do
379+local t = {}
380+local res,msg = pcall(function ()
381+error(t)
382+end)
383+assert((not (res and (msg == t))))
384+res,msg=pcall(function ()
385+error(nil)
386+end)
387+assert((not (res and (msg == nil))))
388+local function f
389+()
390+error({["\u{6d}\u{73}\u{67}"] = "\u{78}"})
391+end
392+res,msg=xpcall(f,function (r)
393+return {["\u{6d}\u{73}\u{67}"] = (r.msg .. "\u{79}")}
394+end)
395+assert((msg.msg == "\u{78}\u{79}"))
396+res,msg=pcall(assert,false,"\u{58}",t)
397+assert((not (res and (msg == "\u{58}"))))
398+res,msg=pcall(function ()
399+assert(false)
400+end)
401+local line = string.match(msg,"\u{25}\u{77}\u{2b}\u{25}\u{2e}\u{6c}\u{75}\u{61}\u{3a}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{3a}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{61}\u{69}\u{6c}\u{65}\u{64}\u{21}\u{24}")
402+assert((tonumber(line) == (debug.getinfo(0x1,"\u{6c}").currentline - 0x2)))
403+res,msg=pcall(assert,false,t)
404+assert((not (res and (msg == t))))
405+res,msg=pcall(assert,nil,nil)
406+assert((not (res and (msg == nil))))
407+res,msg=pcall(assert)
408+assert((not (res and string.find(msg,"\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}"))))
409+end
410+local a,b,c = xpcall(string.find,error,"\u{61}\u{6c}\u{6f}","\u{61}\u{6c}")
411+assert(((a and (b == 0x1)) and (c == 0x2)))
412+a,b,c=xpcall(string.find,function (x)
413+return {}
414+end,true,"\u{61}\u{6c}")
415+assert((not ((a and (type(b) == "\u{74}\u{61}\u{62}\u{6c}\u{65}")) and (c == nil))))
416+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{6f}\u{6b}\u{65}\u{6e}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{73}")
417+checksyntax("\u{73}\u{79}\u{6e}\u{74}\u{61}\u{78}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}","","\u{65}\u{72}\u{72}\u{6f}\u{72}",0x1)
418+checksyntax("\u{31}\u{2e}\u{30}\u{30}\u{30}","","\u{31}\u{2e}\u{30}\u{30}\u{30}",0x1)
419+checksyntax("\u{5b}\u{5b}\u{61}\u{5d}\u{5d}","","\u{5b}\u{5b}\u{61}\u{5d}\u{5d}",0x1)
420+checksyntax("\u{27}\u{61}\u{61}\u{27}","","\u{27}\u{61}\u{61}\u{27}",0x1)
421+checksyntax("\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{3c}\u{3c}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","","\u{3c}\u{3c}",0x1)
422+checksyntax("\u{66}\u{6f}\u{72}\u{20}\u{3e}\u{3e}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}","","\u{3e}\u{3e}",0x1)
423+checksyntax("\u{61}\u{1}\u{61}\u{20}\u{3d}\u{20}\u{31}","","\u{3c}\u{5c}\u{31}\u{3e}",0x1)
424+checksyntax("\u{ff}\u{61}\u{20}\u{3d}\u{20}\u{31}","","\u{3c}\u{5c}\u{32}\u{35}\u{35}\u{3e}",0x1)
425+doit("\u{49}\u{20}\u{3d}\u{20}\u{6c}\u{6f}\u{61}\u{64}\u{28}\u{22}\u{61}\u{3d}\u{39}\u{2b}\u{22}\u{29}\u{3b}\u{20}\u{61}\u{61}\u{61}\u{3d}\u{33}")
426+assert(((_G.aaa == 0x3) and (not _G.I)))
427+_G.I,_G.aaa=nil
428+print("\u{2b}")
429+local lim = 0x3e8
430+if _soft then
431+lim=0x64
432+end
433+for i = 0x1, lim
434+do
435+doit("\u{61}\u{20}\u{3d}\u{20}")
436+doit("\u{61}\u{20}\u{3d}\u{20}\u{34}\u{2b}\u{6e}\u{69}\u{6c}")
437+end
438+local function testrep
439+(init,rep,close,repc,finalresult)
440+local s = (init .. (string.rep(rep,0x64) .. (close .. string.rep(repc,0x64))))
441+local res,msg = load(s)
442+assert(res)
443+if finalresult then
444+assert((res() == finalresult))
445+end
446+s=(init .. string.rep(rep,0x1f4))
447+local res,msg = load(s)
448+assert((not (res and (string.find(msg,"\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}") or string.find(msg,"\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}")))))
449+end
450+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3b}\u{20}\u{61}","\u{2c}\u{61}","\u{3d}\u{20}\u{31}","\u{2c}\u{31}")
451+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3b}\u{20}\u{61}\u{3d}","\u{7b}","\u{30}","\u{7d}")
452+testrep("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}","\u{28}","\u{32}","\u{29}",0x2)
453+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{61}\u{20}\u{28}\u{78}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{20}\u{65}\u{6e}\u{64}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}","\u{61}\u{28}","\u{32}\u{2e}\u{32}","\u{29}",2.2)
454+testrep("","\u{64}\u{6f}\u{20}","","\u{20}\u{65}\u{6e}\u{64}")
455+testrep("","\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{61}\u{20}\u{64}\u{6f}\u{20}","","\u{20}\u{65}\u{6e}\u{64}")
456+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3b}\u{20}","\u{69}\u{66}\u{20}\u{61}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{65}\u{6c}\u{73}\u{65}\u{20}","","\u{20}\u{65}\u{6e}\u{64}")
457+testrep("","\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{29}\u{20}","","\u{20}\u{65}\u{6e}\u{64}")
458+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{27}\u{27}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}","\u{61}\u{2e}\u{2e}","\u{27}\u{61}\u{27}","","\u{61}")
459+testrep("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}","\u{61}\u{5e}","\u{61}","",0x1)
460+checkmessage(("\u{61}\u{20}\u{3d}\u{20}\u{66}\u{28}\u{78}" .. (string.rep("\u{2c}\u{78}",0x104) .. "\u{29}")),"\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{67}\u{69}\u{73}\u{74}\u{65}\u{72}\u{73}")
461+local lim = 0x7f
462+local s = "\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{41}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}"
463+for j = 0x1, lim
464+do
465+s=(s .. ("\u{61}" .. (j .. "\u{2c}\u{20}")))
466+end
467+s=(s .. "\u{62}\u{2c}\u{63}\u{a}")
468+s=(s .. "\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{42}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}")
469+for j = 0x1, lim
470+do
471+s=(s .. ("\u{62}" .. (j .. "\u{2c}\u{20}")))
472+end
473+s=(s .. "\u{62}\u{a}")
474+s=(s .. "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{43}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{62}\u{2b}\u{63}")
475+local c = (0x1 + 0x2)
476+for j = 0x1, lim
477+do
478+s=(s .. ("\u{2b}\u{61}" .. (j .. ("\u{2b}\u{62}" .. j))))
479+c=(c + 0x2)
480+end
481+s=(s .. "\u{a}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{65}\u{6e}\u{64}")
482+local a,b = load(s)
483+assert((((c > 0xff) and string.find(b,"\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{75}\u{70}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{73}")) and string.find(b,"\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{35}")))
484+s="\u{a}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}"
485+for j = 0x1, 0x12c
486+do
487+s=(s .. ("\u{61}" .. (j .. "\u{2c}\u{20}")))
488+end
489+s=(s .. "\u{62}\u{a}")
490+local a,b = load(s)
491+assert((string.find(b,"\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{32}") and string.find(b,"\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}")))
492+mt.__index=oldmm
493+print("\u{4f}\u{4b}")
desk/res/lua/cycled/events.luanew file+610
@@ -0,0 +1,610 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+X=0x14
4+;
5+B=0x1e
6+_ENV=setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = _G})
7+collectgarbage()
8+X=(X + 0xa)
9+assert(((X == 0x1e) and (_G.X == 0x14)))
10+B=false
11+assert((B == false))
12+_ENV["\u{42}"]=undef
13+assert((B == 0x1e))
14+assert((getmetatable({}) == nil))
15+assert((getmetatable(0x4) == nil))
16+assert((getmetatable(nil) == nil))
17+a={["\u{6e}\u{61}\u{6d}\u{65}"] = "\u{4e}\u{41}\u{4d}\u{45}"}
18+;
19+setmetatable(a,{["\u{5f}\u{5f}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}"] = "\u{78}\u{75}\u{78}\u{75}",["\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"] = function (x)
20+return x.name
21+end})
22+assert((getmetatable(a) == "\u{78}\u{75}\u{78}\u{75}"))
23+assert((tostring(a) == "\u{4e}\u{41}\u{4d}\u{45}"))
24+assert((pcall(setmetatable,a,{}) == false))
25+a.name="\u{67}\u{6f}\u{72}\u{6f}\u{72}\u{6f}\u{62}\u{61}"
26+assert((tostring(a) == "\u{67}\u{6f}\u{72}\u{6f}\u{72}\u{6f}\u{62}\u{61}"))
27+local a,t = {0xa,0x14,0x1e,["\u{78}"] = "\u{31}\u{30}",["\u{79}"] = "\u{32}\u{30}"},{}
28+assert((setmetatable(a,t) == a))
29+assert((getmetatable(a) == t))
30+assert((setmetatable(a,nil) == a))
31+assert((getmetatable(a) == nil))
32+assert((setmetatable(a,t) == a))
33+function f(t,i,e)
34+assert((not e))
35+local p = rawget(t,"\u{70}\u{61}\u{72}\u{65}\u{6e}\u{74}")
36+return (p and (p[i] + 0x3)),"\u{64}\u{75}\u{6d}\u{6d}\u{79}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}"
37+end
38+t.__index=f
39+a.parent={["\u{7a}"] = 0x19,["\u{78}"] = 0xc,[0x4] = 0x18}
40+assert(((((a[0x1] == 0xa) and (a.z == 0x1c)) and (a[0x4] == 0x1b)) and (a.x == "\u{31}\u{30}")))
41+collectgarbage()
42+a=setmetatable({},t)
43+function f(t,i,v)
44+rawset(t,i,(v - 0x3))
45+end
46+setmetatable(t,t)
47+t.__newindex=f
48+a[0x1]=0x1e
49+;
50+a.x="\u{31}\u{30}\u{31}"
51+;
52+a[0x5]=0xc8
53+assert((((a[0x1] == 0x1b) and (a.x == 0x62)) and (a[0x5] == 0xc5)))
54+do
55+local mt = {}
56+mt.__newindex=mt
57+local t = setmetatable({},mt)
58+t[0x1]=0xa
59+assert((mt[0x1] == 0xa))
60+end
61+local c = {}
62+a=setmetatable({},t)
63+t.__newindex=c
64+t.__index=c
65+a[0x1]=0xa
66+;
67+a[0x2]=0x14
68+;
69+a[0x3]=0x5a
70+;
71+for i = 0x4, 0x14
72+do
73+a[i]=(i * 0xa)
74+end
75+assert((((a[0x1] == 0xa) and (a[0x2] == 0x14)) and (a[0x3] == 0x5a)))
76+for i = 0x4, 0x14
77+do
78+assert((a[i] == (i * 0xa)))
79+end
80+assert((next(a) == nil))
81+do
82+local a
83+;
84+a=setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,n)
85+return (a[(n - 0x3)] + 0x4),"\u{6c}\u{69}\u{78}\u{6f}"
86+end})})})
87+a[0x0]=0x14
88+for i = 0x0, 0xa
89+do
90+assert((a[(i * 0x3)] == (0x14 + (i * 0x4))))
91+end
92+end
93+do
94+local foi
95+local a = {}
96+for i = 0x1, 0xa
97+do
98+a[i]=0x0
99+;
100+a[("\u{61}" .. i)]=0x0
101+;
102+end
103+setmetatable(a,{["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k,v)
104+foi=true
105+;
106+rawset(t,k,v)
107+end})
108+foi=false
109+;
110+a[0x1]=0x0
111+;
112+assert((not foi))
113+foi=false
114+;
115+a["\u{61}\u{31}"]=0x0
116+;
117+assert((not foi))
118+foi=false
119+;
120+a["\u{61}\u{31}\u{31}"]=0x0
121+;
122+assert(foi)
123+foi=false
124+;
125+a[0xb]=0x0
126+;
127+assert(foi)
128+foi=false
129+;
130+a[0x1]=undef
131+;
132+assert((not foi))
133+a[0x1]=undef
134+foi=false
135+;
136+a[0x1]=nil
137+;
138+assert(foi)
139+end
140+setmetatable(t,nil)
141+function f(t, ...)
142+return t,{...}
143+end
144+t.__call=f
145+do
146+local x,y = a(table.unpack({"\u{61}",0x1}))
147+assert(((((x == a) and (y[0x1] == "\u{61}")) and (y[0x2] == 0x1)) and (y[0x3] == undef)))
148+x,y=a()
149+assert(((x == a) and (y[0x1] == undef)))
150+end
151+local b = setmetatable({},t)
152+setmetatable(b,t)
153+function f(op)
154+return function (...)
155+cap={[0x0] = op,...}
156+;
157+return ...
158+end
159+end
160+t.__add=f("\u{61}\u{64}\u{64}")
161+t.__sub=f("\u{73}\u{75}\u{62}")
162+t.__mul=f("\u{6d}\u{75}\u{6c}")
163+t.__div=f("\u{64}\u{69}\u{76}")
164+t.__idiv=f("\u{69}\u{64}\u{69}\u{76}")
165+t.__mod=f("\u{6d}\u{6f}\u{64}")
166+t.__unm=f("\u{75}\u{6e}\u{6d}")
167+t.__pow=f("\u{70}\u{6f}\u{77}")
168+t.__len=f("\u{6c}\u{65}\u{6e}")
169+t.__band=f("\u{62}\u{61}\u{6e}\u{64}")
170+t.__bor=f("\u{62}\u{6f}\u{72}")
171+t.__bxor=f("\u{62}\u{78}\u{6f}\u{72}")
172+t.__shl=f("\u{73}\u{68}\u{6c}")
173+t.__shr=f("\u{73}\u{68}\u{72}")
174+t.__bnot=f("\u{62}\u{6e}\u{6f}\u{74}")
175+t.__lt=f("\u{6c}\u{74}")
176+t.__le=f("\u{6c}\u{65}")
177+local function checkcap
178+(t)
179+assert((# ((cap + 0x1) == (# t))))
180+for i = 0x1, (# t)
181+do
182+assert((cap[(i - 0x1)] == t[i]))
183+assert((math.type(cap[(i - 0x1)]) == math.type(t[i])))
184+end
185+end
186+assert(((b + 0x5) == b))
187+;
188+checkcap({"\u{61}\u{64}\u{64}",b,0x5})
189+assert(((5.2 + b) == 5.2))
190+;
191+checkcap({"\u{61}\u{64}\u{64}",5.2,b})
192+assert(((b + "\u{35}") == b))
193+;
194+checkcap({"\u{61}\u{64}\u{64}",b,"\u{35}"})
195+assert(((0x5 + b) == 0x5))
196+;
197+checkcap({"\u{61}\u{64}\u{64}",0x5,b})
198+assert((("\u{35}" + b) == "\u{35}"))
199+;
200+checkcap({"\u{61}\u{64}\u{64}","\u{35}",b})
201+b=(b - 0x3)
202+;
203+assert((getmetatable(b) == t))
204+;
205+checkcap({"\u{73}\u{75}\u{62}",b,0x3})
206+assert(((0x5 - a) == 0x5))
207+;
208+checkcap({"\u{73}\u{75}\u{62}",0x5,a})
209+assert((("\u{35}" - a) == "\u{35}"))
210+;
211+checkcap({"\u{73}\u{75}\u{62}","\u{35}",a})
212+assert(((a * a) == a))
213+;
214+checkcap({"\u{6d}\u{75}\u{6c}",a,a})
215+assert(((a / 0x0) == a))
216+;
217+checkcap({"\u{64}\u{69}\u{76}",a,0x0})
218+assert(((a / 0.0) == a))
219+;
220+checkcap({"\u{64}\u{69}\u{76}",a,0.0})
221+assert(((a % 0x2) == a))
222+;
223+checkcap({"\u{6d}\u{6f}\u{64}",a,0x2})
224+assert(((a // (0x1 / 0x0)) == a))
225+;
226+checkcap({"\u{69}\u{64}\u{69}\u{76}",a,(0x1 / 0x0)})
227+;
228+(function ()
229+assert(((a & "\u{68}\u{69}") == a))
230+end)()
231+;
232+checkcap({"\u{62}\u{61}\u{6e}\u{64}",a,"\u{68}\u{69}"})
233+;
234+(function ()
235+assert(((0xa & a) == 0xa))
236+end)()
237+;
238+checkcap({"\u{62}\u{61}\u{6e}\u{64}",0xa,a})
239+;
240+(function ()
241+assert(((a | 0xa) == a))
242+end)()
243+;
244+checkcap({"\u{62}\u{6f}\u{72}",a,0xa})
245+assert(((a | "\u{68}\u{69}") == a))
246+;
247+checkcap({"\u{62}\u{6f}\u{72}",a,"\u{68}\u{69}"})
248+assert((("\u{68}\u{69}" ~ a) == "\u{68}\u{69}"))
249+;
250+checkcap({"\u{62}\u{78}\u{6f}\u{72}","\u{68}\u{69}",a})
251+;
252+(function ()
253+assert(((0xa ~ a) == 0xa))
254+end)()
255+;
256+checkcap({"\u{62}\u{78}\u{6f}\u{72}",0xa,a})
257+assert((- (a == a)))
258+;
259+checkcap({"\u{75}\u{6e}\u{6d}",a,a})
260+assert(((a ^ 4.0) == a))
261+;
262+checkcap({"\u{70}\u{6f}\u{77}",a,4.0})
263+assert(((a ^ "\u{34}") == a))
264+;
265+checkcap({"\u{70}\u{6f}\u{77}",a,"\u{34}"})
266+assert(((0x4 ^ a) == 0x4))
267+;
268+checkcap({"\u{70}\u{6f}\u{77}",0x4,a})
269+assert((("\u{34}" ^ a) == "\u{34}"))
270+;
271+checkcap({"\u{70}\u{6f}\u{77}","\u{34}",a})
272+assert((# (a == a)))
273+;
274+checkcap({"\u{6c}\u{65}\u{6e}",a,a})
275+assert((~ (a == a)))
276+;
277+checkcap({"\u{62}\u{6e}\u{6f}\u{74}",a,a})
278+assert(((a << 0x3) == a))
279+;
280+checkcap({"\u{73}\u{68}\u{6c}",a,0x3})
281+assert(((1.5 >> a) == 1.5))
282+;
283+checkcap({"\u{73}\u{68}\u{72}",1.5,a})
284+assert((5.0 > a))
285+;
286+checkcap({"\u{6c}\u{74}",a,5.0})
287+assert((a >= 0xa))
288+;
289+checkcap({"\u{6c}\u{65}",0xa,a})
290+assert((a <= (- 10.0)))
291+;
292+checkcap({"\u{6c}\u{65}",a,(- 10.0)})
293+assert((a < (- 0xa)))
294+;
295+checkcap({"\u{6c}\u{74}",a,(- 0xa)})
296+t=setmetatable({0x1,0x2,0x3},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
297+return 0xa
298+end})
299+assert((# ((t == 0xa) and (rawlen(t) == 0x3))))
300+assert((rawlen("\u{61}\u{62}\u{63}") == 0x3))
301+assert((not pcall(rawlen,io.stdin)))
302+assert((not pcall(rawlen,0x22)))
303+assert((not pcall(rawlen)))
304+assert((rawlen(string.rep("\u{61}",0x3e8)) == 0x3e8))
305+t={}
306+t.__lt=function (a,b,c)
307+collectgarbage()
308+assert((c == nil))
309+if (type(a) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
310+a=a.x
311+end
312+if (type(b) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
313+b=b.x
314+end
315+return (a < b),"\u{64}\u{75}\u{6d}\u{6d}\u{79}"
316+end
317+t.__le=function (a,b,c)
318+assert((c == nil))
319+if (type(a) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
320+a=a.x
321+end
322+if (type(b) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
323+b=b.x
324+end
325+return (a <= b),"\u{64}\u{75}\u{6d}\u{6d}\u{79}"
326+end
327+t.__eq=function (a,b,c)
328+assert((c == nil))
329+if (type(a) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
330+a=a.x
331+end
332+if (type(b) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
333+b=b.x
334+end
335+return (a == b),"\u{64}\u{75}\u{6d}\u{6d}\u{79}"
336+end
337+function Op(x)
338+return setmetatable({["\u{78}"] = x},t)
339+end
340+local function test
341+(a,b,c)
342+assert((not (((Op(0x1) < Op(0x1)) and (Op(0x1) < Op(0x2))) and (not (Op(0x2) < Op(0x1))))))
343+assert((not (((0x1 < Op(0x1)) and (Op(0x1) < 0x2)) and (not (0x2 < Op(0x1))))))
344+assert((not (((Op("\u{61}") < Op("\u{61}")) and (Op("\u{61}") < Op("\u{62}"))) and (not (Op("\u{62}") < Op("\u{61}"))))))
345+assert((not ((("\u{61}" < Op("\u{61}")) and (Op("\u{61}") < "\u{62}")) and (not (Op("\u{62}") < Op("\u{61}"))))))
346+assert((((Op(0x1) <= Op(0x1)) and (Op(0x1) <= Op(0x2))) and (not (Op(0x2) <= Op(0x1)))))
347+assert((((Op("\u{61}") <= Op("\u{61}")) and (Op("\u{61}") <= Op("\u{62}"))) and (not (Op("\u{62}") <= Op("\u{61}")))))
348+assert((not ((Op(0x1) > Op(0x1)) and (not ((Op(0x1) > Op(0x2)) and (Op(0x2) > Op(0x1)))))))
349+assert((not ((Op("\u{61}") > Op("\u{61}")) and (not ((Op("\u{61}") > Op("\u{62}")) and (Op("\u{62}") > Op("\u{61}")))))))
350+assert(((Op(0x1) >= Op(0x1)) and (not ((Op(0x1) >= Op(0x2)) and (Op(0x2) >= Op(0x1))))))
351+assert(((0x1 >= Op(0x1)) and (not ((0x1 >= Op(0x2)) and (Op(0x2) >= 0x1)))))
352+assert(((Op("\u{61}") >= Op("\u{61}")) and (not ((Op("\u{61}") >= Op("\u{62}")) and (Op("\u{62}") >= Op("\u{61}"))))))
353+assert((("\u{61}" >= Op("\u{61}")) and (not ((Op("\u{61}") >= "\u{62}") and (Op("\u{62}") >= Op("\u{61}"))))))
354+assert(((Op(0x1) == Op(0x1)) and (Op(0x1) ~= Op(0x2))))
355+assert(((Op("\u{61}") == Op("\u{61}")) and (Op("\u{61}") ~= Op("\u{62}"))))
356+assert(((a == a) and (a ~= b)))
357+assert((Op(0x3) == c))
358+end
359+test(Op(0x1),Op(0x2),Op(0x3))
360+local function rawSet
361+(x)
362+local y = {}
363+for _,k in pairs(x)
364+do
365+y[k]=0x1
366+end
367+return y
368+end
369+local function Set
370+(x)
371+return setmetatable(rawSet(x),t)
372+end
373+t.__lt=function (a,b)
374+for k in pairs(a)
375+do
376+if (not b[k]) then
377+return false
378+end
379+b[k]=undef
380+end
381+return (next(b) ~= nil)
382+end
383+t.__le=function (a,b)
384+for k in pairs(a)
385+do
386+if (not b[k]) then
387+return false
388+end
389+end
390+return true
391+end
392+assert((Set({0x1,0x2,0x3}) < Set({0x1,0x2,0x3,0x4})))
393+assert((not (Set({0x1,0x2,0x3,0x4}) < Set({0x1,0x2,0x3,0x4}))))
394+assert((Set({0x1,0x2,0x3,0x4}) <= Set({0x1,0x2,0x3,0x4})))
395+assert((Set({0x1,0x2,0x3,0x4}) >= Set({0x1,0x2,0x3,0x4})))
396+assert((not (Set({0x1,0x3}) <= Set({0x3,0x5}))))
397+assert((not (Set({0x1,0x3}) <= Set({0x3,0x5}))))
398+assert((not (Set({0x1,0x3}) >= Set({0x3,0x5}))))
399+t.__eq=function (a,b)
400+for k in pairs(a)
401+do
402+if (not b[k]) then
403+return false
404+end
405+b[k]=undef
406+end
407+return (next(b) == nil)
408+end
409+local s = Set({0x1,0x3,0x5})
410+assert((s == Set({0x3,0x5,0x1})))
411+assert((not rawequal(s,Set({0x3,0x5,0x1}))))
412+assert(rawequal(s,s))
413+assert((Set({0x1,0x3,0x5,0x1}) == rawSet({0x3,0x5,0x1})))
414+assert((rawSet({0x1,0x3,0x5,0x1}) == Set({0x3,0x5,0x1})))
415+assert((Set({0x1,0x3,0x5}) ~= Set({0x3,0x5,0x1,0x6})))
416+t[Set({0x1,0x3,0x5})]=0x1
417+assert((t[Set({0x1,0x3,0x5})] == undef))
418+do
419+local mt = {["\u{5f}\u{5f}\u{65}\u{71}"] = true}
420+local a = setmetatable({0xa},mt)
421+local b = setmetatable({0xa},mt)
422+mt.__eq=nil
423+assert((a ~= b))
424+mt.__eq=function (x,y)
425+return (x[0x1] == y[0x1])
426+end
427+assert((a == b))
428+end
429+if (not T) then
430+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
431+else
432+local u1 = T.newuserdata(0x0,0x1)
433+local u2 = T.newuserdata(0x0,0x1)
434+local u3 = T.newuserdata(0x0,0x1)
435+assert(((u1 ~= u2) and (u1 ~= u3)))
436+debug.setuservalue(u1,0x1)
437+;
438+debug.setuservalue(u2,0x2)
439+;
440+debug.setuservalue(u3,0x1)
441+;
442+debug.setmetatable(u1,{["\u{5f}\u{5f}\u{65}\u{71}"] = function (a,b)
443+return (debug.getuservalue(a) == debug.getuservalue(b))
444+end})
445+debug.setmetatable(u2,{["\u{5f}\u{5f}\u{65}\u{71}"] = function (a,b)
446+return true
447+end})
448+assert((((u1 == u3) and (u3 == u1)) and (u1 ~= u2)))
449+assert((((u2 == u1) and (u2 == u3)) and (u3 == u2)))
450+assert((u2 ~= {}))
451+assert((rawequal(u1,u1) and (not rawequal(u1,u3))))
452+local mirror = {}
453+debug.setmetatable(u3,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = mirror,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = mirror})
454+for i = 0x1, 0xa
455+do
456+u3[i]=i
457+end
458+for i = 0x1, 0xa
459+do
460+assert((u3[i] == i))
461+end
462+end
463+t.__concat=function (a,b,c)
464+assert((c == nil))
465+if (type(a) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
466+a=a.val
467+end
468+if (type(b) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") then
469+b=b.val
470+end
471+if A then
472+return (a .. b)
473+else
474+return setmetatable({["\u{76}\u{61}\u{6c}"] = (a .. b)},t)
475+end
476+end
477+c={["\u{76}\u{61}\u{6c}"] = "\u{63}"}
478+;
479+setmetatable(c,t)
480+d={["\u{76}\u{61}\u{6c}"] = "\u{64}"}
481+;
482+setmetatable(d,t)
483+A=true
484+assert(((c .. d) == "\u{63}\u{64}"))
485+assert(((0x0 .. ("\u{61}" .. ("\u{62}" .. (c .. (d .. ("\u{65}" .. ("\u{66}" .. ((0x5 + 0x3) .. "\u{67}")))))))) == "\u{30}\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{38}\u{67}"))
486+A=false
487+assert(((c .. (d .. (c .. d))).val == "\u{63}\u{64}\u{63}\u{64}"))
488+x=(c .. d)
489+assert(((getmetatable(x) == t) and (x.val == "\u{63}\u{64}")))
490+x=(0x0 .. ("\u{61}" .. ("\u{62}" .. (c .. (d .. ("\u{65}" .. ("\u{66}" .. "\u{67}")))))))
491+assert((x.val == "\u{30}\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}"))
492+c={}
493+local x
494+setmetatable(c,{["\u{5f}\u{5f}\u{63}\u{6f}\u{6e}\u{63}\u{61}\u{74}"] = function (a,b)
495+assert((((type(a) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}") and (b == c)) or ((type(b) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}") and (a == c))))
496+return c
497+end})
498+assert((((c .. 0x5) == c) and ((0x5 .. c) == c)))
499+assert((((0x4 .. (c .. 0x5)) == c) and ((0x4 .. (0x5 .. (0x6 .. (0x7 .. c)))) == c)))
500+local t1,t2,c,d
501+t1={}
502+;
503+c={}
504+;
505+setmetatable(c,t1)
506+d={}
507+t1.__eq=function ()
508+return true
509+end
510+t1.__lt=function ()
511+return true
512+end
513+t1.__le=function ()
514+return false
515+end
516+setmetatable(d,t1)
517+assert((((c == d) and (c < d)) and (not (d <= c))))
518+t2={}
519+t2.__eq=t1.__eq
520+t2.__lt=t1.__lt
521+setmetatable(d,t2)
522+assert((((c == d) and (c < d)) and (not (d <= c))))
523+local i
524+local tt = {["\u{5f}\u{5f}\u{63}\u{61}\u{6c}\u{6c}"] = function (t, ...)
525+i=(i + 0x1)
526+if t.f then
527+return t.f(...)
528+else
529+return {...}
530+end
531+end}
532+local a = setmetatable({},tt)
533+local b = setmetatable({["\u{66}"] = a},tt)
534+local c = setmetatable({["\u{66}"] = b},tt)
535+i=0x0
536+x=c(0x3,0x4,0x5)
537+assert((((i == 0x3) and (x[0x1] == 0x3)) and (x[0x3] == 0x5)))
538+assert((_G.X == 0x14))
539+_G.X,_G.B=nil
540+print("\u{2b}")
541+local _g = _G
542+_ENV=setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k)
543+return _g[k]
544+end})
545+a={}
546+rawset(a,"\u{78}",0x1,0x2,0x3)
547+assert(((a.x == 0x1) and (rawget(a,"\u{78}",0x3) == 0x1)))
548+print("\u{2b}")
549+mt={["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (a,b)
550+return (a + b)
551+end,["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function (x)
552+return math.floor(x)
553+end}
554+debug.setmetatable(0xa,mt)
555+assert((getmetatable((- 0x2)) == mt))
556+assert(((0xa)[0x3] == 0xd))
557+assert(((0xa)["\u{33}"] == 0xd))
558+assert((# (3.45 == 0x3)))
559+debug.setmetatable(0x17,nil)
560+assert((getmetatable((- 0x2)) == nil))
561+debug.setmetatable(true,mt)
562+assert((getmetatable(false) == mt))
563+mt.__index=function (a,b)
564+return (a or b)
565+end
566+assert(((true)[false] == true))
567+assert(((false)[false] == false))
568+debug.setmetatable(false,nil)
569+assert((getmetatable(true) == nil))
570+debug.setmetatable(nil,mt)
571+assert((getmetatable(nil) == mt))
572+mt.__add=function (a,b)
573+return ((a or 0x1) + (b or 0x2))
574+end
575+assert(((0xa + nil) == 0xc))
576+assert(((nil + 0x17) == 0x18))
577+assert(((nil + nil) == 0x3))
578+debug.setmetatable(nil,nil)
579+assert((getmetatable(nil) == nil))
580+debug.setmetatable(nil,{})
581+a={}
582+;
583+setmetatable(a,a)
584+;
585+a.__index=a
586+;
587+a.__newindex=a
588+assert((not pcall(function (a,b)
589+return a[b]
590+end,a,0xa)))
591+assert((not pcall(function (a,b,c)
592+a[b]=c
593+end,a,0xa,true)))
594+T,K,V=nil
595+grandparent={}
596+grandparent.__newindex=function (t,k,v)
597+T=t
598+;
599+K=k
600+;
601+V=v
602+end
603+parent={}
604+parent.__newindex=parent
605+setmetatable(parent,grandparent)
606+child=setmetatable({},parent)
607+child.foo=0xa
608+assert((((T == parent) and (K == "\u{66}\u{6f}\u{6f}")) and (V == 0xa)))
609+print("\u{4f}\u{4b}")
610+return 0xc
desk/res/lua/cycled/files.luanew file+818
@@ -0,0 +1,818 @@
1+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
2+local maxint = math.maxinteger
3+assert((type(os.getenv("\u{50}\u{41}\u{54}\u{48}")) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
4+assert((io.input(io.stdin) == io.stdin))
5+assert((not pcall(io.input,"\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}\u{6e}\u{74}\u{2d}\u{66}\u{69}\u{6c}\u{65}")))
6+assert((io.output(io.stdout) == io.stdout))
7+local function testerr
8+(msg,f, ...)
9+local stat,err = pcall(f,...)
10+return (not (stat and string.find(err,msg,0x1,true)))
11+end
12+local function checkerr
13+(msg,f, ...)
14+assert(testerr(msg,f,...))
15+end
16+assert((not (io.close(io.stdin) and (not (io.stdout:close() and (not io.stderr:close()))))))
17+checkerr("\u{67}\u{6f}\u{74}\u{20}\u{6e}\u{6f}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}",io.stdin.close)
18+assert(((type(io.input()) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}") and (io.type(io.output()) == "\u{66}\u{69}\u{6c}\u{65}")))
19+assert(((type(io.stdin) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}") and (io.type(io.stderr) == "\u{66}\u{69}\u{6c}\u{65}")))
20+assert((not io.type(0x8)))
21+local a = {}
22+;
23+setmetatable(a,{})
24+assert((not io.type(a)))
25+assert((getmetatable(io.input()).__name == "\u{46}\u{49}\u{4c}\u{45}\u{2a}"))
26+local a,b,c = io.open("\u{78}\u{75}\u{78}\u{75}\u{5f}\u{6e}\u{61}\u{6f}\u{5f}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}")
27+assert((not ((a and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
28+a,b,c=io.open("\u{2f}\u{61}\u{2f}\u{62}\u{2f}\u{63}\u{2f}\u{64}","\u{77}")
29+assert((not ((a and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
30+local file = os.tmpname()
31+local f,msg = io.open(file,"\u{77}")
32+if (not f) then
33+(Message or print)("\u{27}\u{6f}\u{73}\u{2e}\u{74}\u{6d}\u{70}\u{6e}\u{61}\u{6d}\u{65}\u{27}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{6f}\u{70}\u{65}\u{6e}\u{3b}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}")
34+else
35+f:close()
36+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{2f}\u{6f}")
37+local otherfile = os.tmpname()
38+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"\u{72}\u{77}")
39+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"\u{72}\u{62}\u{2b}")
40+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"\u{72}\u{2b}\u{62}\u{6b}")
41+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"")
42+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"\u{2b}")
43+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.open,file,"\u{62}")
44+assert(io.open(file,"\u{72}\u{2b}\u{62}")):close()
45+assert(io.open(file,"\u{72}\u{2b}")):close()
46+assert(io.open(file,"\u{72}\u{62}")):close()
47+assert(os.setlocale("\u{43}","\u{61}\u{6c}\u{6c}"))
48+io.input(io.stdin)
49+;
50+io.output(io.stdout)
51+;
52+os.remove(file)
53+assert((not loadfile(file)))
54+checkerr("",dofile,file)
55+assert((not io.open(file)))
56+io.output(file)
57+assert((io.output() ~= io.stdout))
58+if (not _port) then
59+local status,msg,code = io.stdin:seek("\u{73}\u{65}\u{74}",0x3e8)
60+assert((not ((status and (type(msg) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(code) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
61+end
62+assert((io.output():seek() == 0x0))
63+assert((io.write("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}"):seek() == string.len("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}")))
64+assert((io.output():seek("\u{63}\u{75}\u{72}",(- 0x3)) == (string.len("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}") - 0x3)))
65+assert(io.write("\u{6a}\u{6f}\u{61}\u{6f}"))
66+assert((io.output():seek("\u{65}\u{6e}\u{64}") == string.len("\u{61}\u{6c}\u{6f}\u{20}\u{6a}\u{6f}\u{61}\u{6f}")))
67+assert((io.output():seek("\u{73}\u{65}\u{74}") == 0x0))
68+assert(io.write("\u{22}\u{61}\u{6c}\u{6f}\u{22}","\u{7b}\u{61}\u{7d}\u{a}","\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}","\u{74}\u{68}\u{69}\u{72}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{a}"))
69+assert(io.write("\u{58}\u{66}\u{6f}\u{75}\u{72}\u{74}\u{68}\u{5f}\u{6c}\u{69}\u{6e}\u{65}"))
70+io.output(io.stdout)
71+collectgarbage()
72+assert(((io.input() == io.stdin) and rawequal(io.output(),io.stdout)))
73+print("\u{2b}")
74+collectgarbage()
75+for i = 0x1, 0x78
76+do
77+for i = 0x1, 0x5
78+do
79+io.input(file)
80+assert(io.open(file,"\u{72}"))
81+io.lines(file)
82+end
83+collectgarbage()
84+end
85+io.input():close()
86+io.close()
87+assert(os.rename(file,otherfile))
88+assert((not os.rename(file,otherfile)))
89+io.output(io.open(otherfile,"\u{61}\u{62}"))
90+assert(io.write("\u{a}\u{a}\u{9}\u{9}\u{20}\u{20}",0xd7a,"\u{a}"))
91+;
92+io.close()
93+do
94+local F = nil
95+do
96+local f <close> = assert(io.open(file,"\u{77}"))
97+F=f
98+end
99+assert((tostring(F) == "\u{66}\u{69}\u{6c}\u{65}\u{20}\u{28}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{29}"))
100+end
101+assert(os.remove(file))
102+do
103+local f <close> = assert(io.open(file,"\u{77}"))
104+f:write(maxint,"\u{a}")
105+f:write(string.format("\u{30}\u{58}\u{25}\u{78}\u{a}",maxint))
106+f:write("\u{30}\u{78}\u{41}\u{42}\u{43}\u{70}\u{2d}\u{33}","\u{a}")
107+f:write(0x0,"\u{a}")
108+f:write((- maxint),"\u{a}")
109+f:write(string.format("\u{30}\u{78}\u{25}\u{58}\u{a}",(- maxint)))
110+f:write("\u{2d}\u{30}\u{78}\u{41}\u{42}\u{43}\u{70}\u{2d}\u{33}","\u{a}")
111+assert(f:close())
112+local f <close> = assert(io.open(file,"\u{72}"))
113+assert((f:read("\u{6e}") == maxint))
114+assert((f:read("\u{6e}") == maxint))
115+assert((f:read("\u{6e}") == 343.5))
116+assert((f:read("\u{6e}") == 0x0))
117+assert((f:read("\u{2a}\u{6e}") == (- maxint)))
118+assert((f:read("\u{6e}") == (- maxint)))
119+assert((f:read("\u{2a}\u{6e}") == (- 343.5)))
120+end
121+assert(os.remove(file))
122+do
123+local f <close> = assert(io.open(file,"\u{77}"))
124+f:write("\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{31}\u{32}\u{33}\u{34}\u{a}\u{33}\u{2e}\u{34}\u{35}\u{a}\u{6f}\u{6e}\u{65}\u{a}\u{74}\u{77}\u{6f}\u{a}\u{74}\u{68}\u{72}\u{65}\u{65}\u{a}")
125+local l1,l2,l3,l4,n1,n2,c,dummy
126+assert(f:close())
127+local f <close> = assert(io.open(file,"\u{72}"))
128+l1,l2,n1,n2,dummy=f:read("\u{6c}","\u{4c}","\u{6e}","\u{6e}")
129+assert((((((l1 == "\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}") and (l2 == "\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}")) and (n1 == 0x4d2)) and (n2 == 3.45)) and (dummy == nil)))
130+assert(f:close())
131+local f <close> = assert(io.open(file,"\u{72}"))
132+l1,l2,n1,n2,c,l3,l4,dummy=f:read(0x7,"\u{6c}","\u{6e}","\u{6e}",0x1,"\u{6c}","\u{6c}")
133+assert(((((((((l1 == "\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}") and (l2 == "\u{61}\u{6e}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{6c}\u{69}\u{6e}\u{65}")) and (c == "\u{a}")) and (n1 == 0x4d2)) and (n2 == 3.45)) and (l3 == "\u{6f}\u{6e}\u{65}")) and (l4 == "\u{74}\u{77}\u{6f}")) and (dummy == nil)))
134+assert(f:close())
135+local f <close> = assert(io.open(file,"\u{72}"))
136+l1,n1,n2,dummy=f:read("\u{6c}","\u{6e}","\u{6e}","\u{6c}")
137+assert(((l1 == "\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}") and (not n1)))
138+end
139+assert(os.remove(file))
140+f=assert(io.open(file,"\u{77}"))
141+f:write("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{2c}\u{20}\u{7a}\u{20}\u{3d}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{28}\u{31}\u{30}\u{29}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{79}\u{20}\u{3d}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{2e}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{28}\u{32}\u{30}\u{29}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{20}\u{2b}\u{20}\u{79}\u{20}\u{2a}\u{20}\u{7a}\u{a}")
142+assert(f:close())
143+f=coroutine.wrap(dofile)
144+assert((f(file) == 0xa))
145+assert((f(0x64,0x65) == 0x14))
146+assert((f(0xc8) == (0x64 + (0xc8 * 0x65))))
147+assert(os.remove(file))
148+f=assert(io.open(file,"\u{77}"))
149+f:write("\u{2d}\u{31}\u{32}\u{2e}\u{33}\u{2d}\u{9}\u{2d}\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{2b}\u{20}\u{20}\u{2e}\u{33}\u{7c}\u{35}\u{2e}\u{45}\u{2d}\u{33}\u{58}\u{20}\u{20}\u{2b}\u{32}\u{33}\u{34}\u{65}\u{2b}\u{31}\u{33}\u{45}\u{20}\u{30}\u{78}\u{44}\u{45}\u{41}\u{44}\u{42}\u{45}\u{45}\u{46}\u{44}\u{45}\u{41}\u{44}\u{42}\u{45}\u{45}\u{46}\u{78}\u{a}\u{30}\u{78}\u{31}\u{2e}\u{31}\u{33}\u{41}\u{70}\u{2b}\u{33}\u{65}\u{a}")
150+f:write("\u{31}\u{32}\u{33}\u{34}")
151+;
152+for i = 0x1, 0x3e8
153+do
154+f:write("\u{30}")
155+end
156+;
157+f:write("\u{a}")
158+f:write("\u{2e}\u{65}\u{2b}\u{9}\u{30}\u{2e}\u{65}\u{3b}\u{9}\u{2d}\u{2d}\u{3b}\u{20}\u{20}\u{30}\u{78}\u{58}\u{3b}\u{a}")
159+assert(f:close())
160+f=assert(io.open(file,"\u{72}"))
161+assert((f:read("\u{6e}") == (- 12.3)))
162+;
163+assert((f:read(0x1) == "\u{2d}"))
164+assert((f:read("\u{6e}") == (- 0xffff)))
165+;
166+assert((f:read(0x2) == "\u{2b}\u{20}"))
167+assert((f:read("\u{6e}") == 0.3))
168+;
169+assert((f:read(0x1) == "\u{7c}"))
170+assert((f:read("\u{6e}") == 5e-3))
171+;
172+assert((f:read(0x1) == "\u{58}"))
173+assert((f:read("\u{6e}") == 2.34e15))
174+;
175+assert((f:read(0x1) == "\u{45}"))
176+assert((f:read("\u{6e}") == 0xdeadbeefdeadbeef))
177+;
178+assert((f:read(0x2) == "\u{78}\u{a}"))
179+assert((f:read("\u{6e}") == 8.61328125))
180+;
181+assert((f:read(0x1) == "\u{65}"))
182+do
183+assert((not f:read("\u{6e}")))
184+local s = f:read("\u{4c}")
185+assert(string.find(s,"\u{5e}\u{30}\u{30}\u{2a}\u{a}\u{24}"))
186+end
187+assert((not f:read("\u{6e}")))
188+;
189+assert((f:read(0x2) == "\u{65}\u{2b}"))
190+assert((not f:read("\u{6e}")))
191+;
192+assert((f:read(0x1) == "\u{3b}"))
193+assert((not f:read("\u{6e}")))
194+;
195+assert((f:read(0x2) == "\u{2d}\u{3b}"))
196+assert((not f:read("\u{6e}")))
197+;
198+assert((f:read(0x1) == "\u{58}"))
199+assert((not f:read("\u{6e}")))
200+;
201+assert((f:read(0x1) == "\u{3b}"))
202+assert((not f:read("\u{6e}")))
203+;
204+assert((not f:read(0x0)))
205+assert(f:close())
206+assert(os.remove(file))
207+assert((not pcall(io.lines,"\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{78}\u{69}\u{73}\u{74}\u{65}\u{6e}\u{74}\u{2d}\u{66}\u{69}\u{6c}\u{65}")))
208+assert(os.rename(otherfile,file))
209+io.output(otherfile)
210+local n = 0x0
211+local f = io.lines(file)
212+while f() do
213+n=(n + 0x1)
214+end
215+;
216+assert((n == 0x6))
217+checkerr("\u{66}\u{69}\u{6c}\u{65}\u{20}\u{69}\u{73}\u{20}\u{61}\u{6c}\u{72}\u{65}\u{61}\u{64}\u{79}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}",f)
218+checkerr("\u{66}\u{69}\u{6c}\u{65}\u{20}\u{69}\u{73}\u{20}\u{61}\u{6c}\u{72}\u{65}\u{61}\u{64}\u{79}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}",f)
219+n=0x0
220+for l in io.lines(file)
221+do
222+io.write(l,"\u{a}")
223+;
224+n=(n + 0x1)
225+end
226+io.close()
227+assert((n == 0x6))
228+local f = assert(io.open(otherfile))
229+assert((io.type(f) == "\u{66}\u{69}\u{6c}\u{65}"))
230+io.output(file)
231+assert((not io.output():read()))
232+n=0x0
233+for l in f:lines()
234+do
235+io.write(l,"\u{a}")
236+;
237+n=(n + 0x1)
238+end
239+assert((tostring(f):sub(0x1,0x5) == "\u{66}\u{69}\u{6c}\u{65}\u{20}"))
240+assert(f:close())
241+;
242+io.close()
243+assert((n == 0x6))
244+checkerr("\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{66}\u{69}\u{6c}\u{65}",io.close,f)
245+assert((tostring(f) == "\u{66}\u{69}\u{6c}\u{65}\u{20}\u{28}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{29}"))
246+assert((io.type(f) == "\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{66}\u{69}\u{6c}\u{65}"))
247+io.input(file)
248+f=io.open(otherfile):lines()
249+n=0x0
250+for l in io.lines()
251+do
252+assert((l == f()))
253+;
254+n=(n + 0x1)
255+end
256+f=nil
257+;
258+collectgarbage()
259+assert((n == 0x6))
260+assert(os.remove(otherfile))
261+do
262+io.output(otherfile)
263+io.write(string.rep("\u{61}",0x12c),"\u{a}")
264+io.close()
265+local t = {}
266+;
267+for i = 0x1, 0xfa
268+do
269+t[i]=0x1
270+end
271+t={io.lines(otherfile,table.unpack(t))()}
272+assert((# (((t == 0xfa) and (t[0x1] == "\u{61}")) and (t[(# t)] == "\u{61}"))))
273+t[(# (t + 0x1))]=0x1
274+checkerr("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{73}",io.lines,otherfile,table.unpack(t))
275+collectgarbage()
276+assert(os.remove(otherfile))
277+end
278+io.input(file)
279+do
280+local a,b,c = io.input():write("\u{78}\u{75}\u{78}\u{75}")
281+assert((not ((a and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
282+end
283+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}",io.read,"\u{78}")
284+assert((io.read(0x0) == ""))
285+assert((io.read(0x5,"\u{6c}") == "\u{22}\u{61}\u{6c}\u{6f}\u{22}"))
286+assert((io.read(0x0) == ""))
287+assert((io.read() == "\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}"))
288+local x = io.input():seek()
289+assert((io.read() == "\u{74}\u{68}\u{69}\u{72}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}"))
290+assert(io.input():seek("\u{73}\u{65}\u{74}",x))
291+assert((io.read("\u{4c}") == "\u{74}\u{68}\u{69}\u{72}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{a}"))
292+assert((io.read(0x1) == "\u{58}"))
293+assert((io.read(string.len("\u{66}\u{6f}\u{75}\u{72}\u{74}\u{68}\u{5f}\u{6c}\u{69}\u{6e}\u{65}")) == "\u{66}\u{6f}\u{75}\u{72}\u{74}\u{68}\u{5f}\u{6c}\u{69}\u{6e}\u{65}"))
294+assert(io.input():seek("\u{63}\u{75}\u{72}",(- string.len("\u{66}\u{6f}\u{75}\u{72}\u{74}\u{68}\u{5f}\u{6c}\u{69}\u{6e}\u{65}"))))
295+assert((io.read() == "\u{66}\u{6f}\u{75}\u{72}\u{74}\u{68}\u{5f}\u{6c}\u{69}\u{6e}\u{65}"))
296+assert((io.read() == ""))
297+assert((io.read("\u{6e}") == 0xd7a))
298+assert((io.read(0x1) == "\u{a}"))
299+assert((not io.read(0x0)))
300+assert((not io.read(0x1)))
301+assert((not io.read(0x7530)))
302+assert((({io.read(0x1)})[0x2] == undef))
303+assert((not io.read()))
304+assert((({io.read()})[0x2] == undef))
305+assert((not io.read("\u{6e}")))
306+assert((({io.read("\u{6e}")})[0x2] == undef))
307+assert((io.read("\u{61}") == ""))
308+assert((io.read("\u{61}") == ""))
309+collectgarbage()
310+print("\u{2b}")
311+io.close(io.input())
312+checkerr("\u{20}\u{69}\u{6e}\u{70}\u{75}\u{74}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{69}\u{73}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}",io.read)
313+assert(os.remove(file))
314+local t = "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
315+for i = 0x1, 0xa
316+do
317+t=(t .. t)
318+;
319+end
320+assert((string.len(t) == (0xa * (0x2 ^ 0xa))))
321+io.output(file)
322+io.write("\u{61}\u{6c}\u{6f}"):write("\u{a}")
323+io.close()
324+checkerr("\u{20}\u{6f}\u{75}\u{74}\u{70}\u{75}\u{74}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{69}\u{73}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}",io.write)
325+local f = io.open(file,"\u{61}\u{2b}\u{62}")
326+io.output(f)
327+collectgarbage()
328+assert(io.write(("\u{20}" .. (t .. "\u{20}"))))
329+assert(io.write("\u{3b}","\u{65}\u{6e}\u{64}\u{20}\u{6f}\u{66}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{a}"))
330+f:flush()
331+;
332+io.flush()
333+f:close()
334+print("\u{2b}")
335+io.input(file)
336+assert((io.read() == "\u{61}\u{6c}\u{6f}"))
337+assert((io.read(0x1) == "\u{20}"))
338+assert((io.read(string.len(t)) == t))
339+assert((io.read(0x1) == "\u{20}"))
340+assert(io.read(0x0))
341+assert((io.read("\u{61}") == "\u{3b}\u{65}\u{6e}\u{64}\u{20}\u{6f}\u{66}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{a}"))
342+assert((not io.read(0x0)))
343+assert(io.close(io.input()))
344+do
345+local function ismsg
346+(m)
347+return ((type(m) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (not tonumber(m)))
348+end
349+local f = io.open(file,"\u{77}")
350+local r,m,c = f:read()
351+assert((not ((r and ismsg(m)) and (type(c) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
352+assert(f:close())
353+f=io.open(file,"\u{72}")
354+r,m,c=f:write("\u{77}\u{68}\u{61}\u{74}\u{65}\u{76}\u{65}\u{72}")
355+assert((not ((r and ismsg(m)) and (type(c) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}"))))
356+assert(f:close())
357+f=io.open(file,"\u{77}")
358+r,m=pcall(f:lines())
359+assert(((r == false) and ismsg(m)))
360+assert(f:close())
361+end
362+assert(os.remove(file))
363+io.output(file)
364+;
365+io.write("\u{a}\u{a}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{6f}\u{74}\u{68}\u{65}\u{72}"):close()
366+io.input(file)
367+assert((io.read("\u{4c}") == "\u{a}"))
368+assert((io.read("\u{4c}") == "\u{a}"))
369+assert((io.read("\u{4c}") == "\u{6c}\u{69}\u{6e}\u{65}\u{a}"))
370+assert((io.read("\u{4c}") == "\u{6f}\u{74}\u{68}\u{65}\u{72}"))
371+assert((not io.read("\u{4c}")))
372+io.input():close()
373+local f = assert(io.open(file))
374+local s = ""
375+for l in f:lines("\u{4c}")
376+do
377+s=(s .. l)
378+end
379+assert((s == "\u{a}\u{a}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{6f}\u{74}\u{68}\u{65}\u{72}"))
380+f:close()
381+io.input(file)
382+s=""
383+for l in io.lines(nil,"\u{4c}")
384+do
385+s=(s .. l)
386+end
387+assert((s == "\u{a}\u{a}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{6f}\u{74}\u{68}\u{65}\u{72}"))
388+io.input():close()
389+s=""
390+for l in io.lines(file,"\u{4c}")
391+do
392+s=(s .. l)
393+end
394+assert((s == "\u{a}\u{a}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{6f}\u{74}\u{68}\u{65}\u{72}"))
395+s=""
396+for l in io.lines(file,"\u{6c}")
397+do
398+s=(s .. l)
399+end
400+assert((s == "\u{6c}\u{69}\u{6e}\u{65}\u{6f}\u{74}\u{68}\u{65}\u{72}"))
401+io.output(file)
402+;
403+io.write("\u{61}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{20}\u{2b}\u{20}\u{33}\u{34}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{2a}\u{61}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{2d}\u{61}\u{a}"):close()
404+local t = {}
405+assert(load(io.lines(file,"\u{4c}"),nil,nil,t))()
406+assert((t.a == (- ((0xa + 0x22) * 0x2))))
407+do
408+local function gettoclose
409+(lv)
410+lv=(lv + 0x1)
411+local stvar = 0x0
412+for i = 0x1, 0x3e8
413+do
414+local n,v = debug.getlocal(lv,i)
415+if (n == "\u{28}\u{66}\u{6f}\u{72}\u{20}\u{73}\u{74}\u{61}\u{74}\u{65}\u{29}") then
416+stvar=(stvar + 0x1)
417+if (stvar == 0x4) then
418+return v
419+end
420+end
421+end
422+end
423+local f
424+for l in io.lines(file)
425+do
426+f=gettoclose(0x1)
427+assert((io.type(f) == "\u{66}\u{69}\u{6c}\u{65}"))
428+break
429+end
430+assert((io.type(f) == "\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{66}\u{69}\u{6c}\u{65}"))
431+f=nil
432+local function foo
433+(name)
434+for l in io.lines(name)
435+do
436+f=gettoclose(0x1)
437+assert((io.type(f) == "\u{66}\u{69}\u{6c}\u{65}"))
438+error(f)
439+end
440+end
441+local st,msg = pcall(foo,file)
442+assert(((st == false) and (io.type(msg) == "\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{66}\u{69}\u{6c}\u{65}")))
443+end
444+io.output(file)
445+;
446+io.write("\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}"):close()
447+for a,b in io.lines(file,0x1,0x1)
448+do
449+if (a == "\u{a}") then
450+assert((not b))
451+else
452+assert((tonumber(a) == (tonumber(b) - 0x1)))
453+end
454+end
455+for a,b,c in io.lines(file,0x1,0x2,"\u{61}")
456+do
457+assert((((a == "\u{30}") and (b == "\u{31}\u{32}")) and (c == "\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}")))
458+end
459+for a,b,c in io.lines(file,"\u{61}",0x0,0x1)
460+do
461+if (a == "") then
462+break
463+end
464+assert(((a == "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}") and (not (b and (not c)))))
465+end
466+collectgarbage()
467+io.output(file)
468+;
469+io.write("\u{30}\u{30}\u{a}\u{31}\u{30}\u{a}\u{32}\u{30}\u{a}\u{33}\u{30}\u{a}\u{34}\u{30}\u{a}"):close()
470+for a,b in io.lines(file,"\u{6e}","\u{6e}")
471+do
472+if (a == 0x28) then
473+assert((not b))
474+else
475+assert((a == (b - 0xa)))
476+end
477+end
478+io.output(file)
479+;
480+io.write("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{79}\u{a}\u{3d}\u{20}\u{58}\u{a}\u{58}\u{20}\u{3d}\u{a}\u{58}\u{20}\u{2a}\u{a}\u{32}\u{20}\u{2b}\u{a}\u{58}\u{3b}\u{a}\u{58}\u{20}\u{3d}\u{a}\u{58}\u{a}\u{2d}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{79}\u{3b}\u{a}"):close()
481+_G.X=0x1
482+assert((not load(io.lines(file))))
483+collectgarbage()
484+load(io.lines(file,"\u{4c}"))()
485+assert((_G.X == 0x2))
486+load(io.lines(file,0x1))()
487+assert((_G.X == 0x4))
488+load(io.lines(file,0x3))()
489+assert((_G.X == 0x8))
490+_G.X=nil
491+print("\u{2b}")
492+local x1 = "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{a}\u{a}\u{5c}\u{63}\u{6f}\u{6d}\u{20}\u{22}\u{22}\u{27}\u{27}\u{63}\u{6f}\u{69}\u{73}\u{61}\u{73}\u{20}\u{5b}\u{5b}\u{65}\u{73}\u{74}\u{72}\u{61}\u{6e}\u{68}\u{61}\u{73}\u{5d}\u{5d}\u{20}\u{5d}\u{5d}\u{27}"
493+io.output(file)
494+assert(io.write(string.format("\u{58}\u{32}\u{20}\u{3d}\u{20}\u{25}\u{71}\u{a}\u{2d}\u{2d}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{65}\u{6e}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{45}\u{4f}\u{53}",x1)))
495+io.close()
496+assert(loadfile(file))()
497+assert((x1 == _G.X2))
498+_G.X2=nil
499+print("\u{2b}")
500+assert(os.remove(file))
501+assert((not os.remove(file)))
502+assert((not os.remove(otherfile)))
503+local function testloadfile
504+(s,expres)
505+io.output(file)
506+if s then
507+io.write(s)
508+end
509+io.close()
510+local res = assert(loadfile(file))()
511+assert(os.remove(file))
512+assert((res == expres))
513+end
514+testloadfile(nil,nil)
515+testloadfile("\u{23}\u{20}\u{61}\u{20}\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{6e}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}",nil)
516+testloadfile("\u{ef}\u{bb}\u{bf}\u{23}\u{20}\u{73}\u{6f}\u{6d}\u{65}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{33}\u{34}",0xea)
517+testloadfile("\u{ef}\u{bb}\u{bf}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{33}\u{39}",0xef)
518+testloadfile("\u{ef}\u{bb}\u{bf}",nil)
519+testloadfile("\u{23}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{27}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{31}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}",0x2)
520+io.output(io.open(file,"\u{77}\u{62}"))
521+assert(io.write(string.dump(function ()
522+return 0xa,"\u{0}\u{61}\u{6c}\u{6f}\u{ff}","\u{68}\u{69}"
523+end)))
524+io.close()
525+a,b,c=assert(loadfile(file))()
526+assert((((a == 0xa) and (b == "\u{0}\u{61}\u{6c}\u{6f}\u{ff}")) and (c == "\u{68}\u{69}")))
527+assert(os.remove(file))
528+do
529+io.output(io.open(file,"\u{77}\u{62}"))
530+assert(io.write(string.dump(function ()
531+return 0x1
532+end)))
533+io.close()
534+f=assert(loadfile(file,"\u{62}",{}))
535+assert(((type(f) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and (f() == 0x1)))
536+assert(os.remove(file))
537+end
538+io.output(io.open(file,"\u{77}\u{62}"))
539+assert(io.write("\u{23}\u{74}\u{68}\u{69}\u{73}\u{20}\u{69}\u{73}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{61}\u{20}\u{62}\u{69}\u{6e}\u{61}\u{72}\u{79}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{0}\u{a}",string.dump(function ()
540+return 0x14,"\u{0}\u{0}\u{0}"
541+end)))
542+io.close()
543+a,b,c=assert(loadfile(file))()
544+assert((((a == 0x14) and (b == "\u{0}\u{0}\u{0}")) and (c == nil)))
545+assert(os.remove(file))
546+do
547+local f = io.open(file,"\u{77}")
548+f:write("\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{28}\u{2e}\u{2e}\u{2e}\u{29}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{35}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{62}\u{2c}\u{20}\u{63}\u{2c}\u{20}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6c}\u{73}\u{65}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{5f}\u{45}\u{4e}\u{56}\u{a}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}")
549+f:close()
550+local t = {["\u{62}"] = 0xc,["\u{63}"] = "\u{78}\u{75}\u{78}\u{75}",["\u{64}"] = print}
551+local f = assert(loadfile(file,"\u{74}",t))
552+local b,c,d = f(0x1)
553+assert(((((t.a == 0xf) and (b == 0xc)) and (c == t.c)) and (d == print)))
554+assert((f() == t))
555+f=assert(loadfile(file,"\u{74}",nil))
556+assert((f() == nil))
557+f=assert(loadfile(file))
558+assert((f() == _G))
559+assert(os.remove(file))
560+end
561+do
562+io.open(file,"\u{77}"):write("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{30}"):close()
563+local s,m = loadfile(file,"\u{62}")
564+assert((not (s and string.find(m,"\u{61}\u{20}\u{74}\u{65}\u{78}\u{74}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}"))))
565+io.open(file,"\u{77}"):write("\u{1b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{30}"):close()
566+local s,m = loadfile(file,"\u{74}")
567+assert((not (s and string.find(m,"\u{61}\u{20}\u{62}\u{69}\u{6e}\u{61}\u{72}\u{79}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}"))))
568+assert(os.remove(file))
569+end
570+io.output(file)
571+assert(io.write("\u{71}\u{75}\u{61}\u{6c}\u{71}\u{75}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}\u{a}"))
572+assert(io.write("\u{6d}\u{61}\u{69}\u{73}\u{20}\u{71}\u{75}\u{61}\u{6c}\u{71}\u{75}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}"))
573+io.close()
574+assert(io.output(assert(io.open(otherfile,"\u{77}\u{62}"))):write("\u{6f}\u{75}\u{74}\u{72}\u{61}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}\u{0}\u{1}\u{3}\u{0}\u{0}\u{0}\u{0}\u{ff}\u{0}"):close())
575+local filehandle = assert(io.open(file,"\u{72}\u{2b}"))
576+local otherfilehandle = assert(io.open(otherfile,"\u{72}\u{62}"))
577+assert((filehandle ~= otherfilehandle))
578+assert((type(filehandle) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}"))
579+assert((filehandle:read("\u{6c}") == "\u{71}\u{75}\u{61}\u{6c}\u{71}\u{75}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}"))
580+io.input(otherfilehandle)
581+assert((io.read(string.len("\u{6f}\u{75}\u{74}\u{72}\u{61}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}")) == "\u{6f}\u{75}\u{74}\u{72}\u{61}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}"))
582+assert((filehandle:read("\u{6c}") == "\u{6d}\u{61}\u{69}\u{73}\u{20}\u{71}\u{75}\u{61}\u{6c}\u{71}\u{75}\u{65}\u{72}\u{20}\u{63}\u{6f}\u{69}\u{73}\u{61}"))
583+filehandle:close()
584+;
585+assert((type(filehandle) == "\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}"))
586+io.input(otherfilehandle)
587+assert((io.read(0x4) == "\u{0}\u{1}\u{3}\u{0}"))
588+assert((io.read(0x3) == "\u{0}\u{0}\u{0}"))
589+assert((io.read(0x0) == ""))
590+assert((io.read(0x1) == "\u{ff}"))
591+assert((io.read("\u{61}") == "\u{0}"))
592+assert((not io.read(0x0)))
593+assert((otherfilehandle == io.input()))
594+otherfilehandle:close()
595+assert(os.remove(file))
596+assert(os.remove(otherfile))
597+collectgarbage()
598+io.output(file):write("\u{20}\u{31}\u{32}\u{33}\u{2e}\u{34}\u{9}\u{2d}\u{35}\u{36}\u{65}\u{2d}\u{32}\u{20}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{a}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{74}\u{68}\u{69}\u{72}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{a}\u{a}\u{61}\u{6e}\u{64}\u{20}\u{74}\u{68}\u{65}\u{20}\u{72}\u{65}\u{73}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{74}\u{68}\u{65}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{a}"):close()
599+io.input(file)
600+local _,a,b,c,d,e,h,__ = io.read(0x1,"\u{6e}","\u{6e}","\u{6c}","\u{6c}","\u{6c}","\u{61}",0xa)
601+assert(io.close(io.input()))
602+assert(((_ == "\u{20}") and (not __)))
603+assert((((type(a) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}") and (a == 123.4)) and (b == (- 0.56))))
604+assert(((d == "\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}") and (e == "\u{74}\u{68}\u{69}\u{72}\u{64}\u{20}\u{6c}\u{69}\u{6e}\u{65}")))
605+assert((h == "\u{a}\u{61}\u{6e}\u{64}\u{20}\u{74}\u{68}\u{65}\u{20}\u{72}\u{65}\u{73}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{74}\u{68}\u{65}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{a}"))
606+assert(os.remove(file))
607+collectgarbage()
608+do
609+local f = assert(io.open(file,"\u{77}"))
610+local fr = assert(io.open(file,"\u{72}"))
611+assert(f:setvbuf("\u{66}\u{75}\u{6c}\u{6c}",0x7d0))
612+f:write("\u{78}")
613+assert((fr:read("\u{61}\u{6c}\u{6c}") == ""))
614+f:close()
615+fr:seek("\u{73}\u{65}\u{74}")
616+assert((fr:read("\u{61}\u{6c}\u{6c}") == "\u{78}"))
617+f=assert(io.open(file),"\u{77}")
618+assert(f:setvbuf("\u{6e}\u{6f}"))
619+f:write("\u{78}")
620+fr:seek("\u{73}\u{65}\u{74}")
621+assert((fr:read("\u{61}\u{6c}\u{6c}") == "\u{78}"))
622+f:close()
623+f=assert(io.open(file,"\u{61}"))
624+assert(f:setvbuf("\u{6c}\u{69}\u{6e}\u{65}"))
625+f:write("\u{78}")
626+fr:seek("\u{73}\u{65}\u{74}",0x1)
627+assert((fr:read("\u{61}\u{6c}\u{6c}") == ""))
628+f:write("\u{61}\u{a}"):seek("\u{73}\u{65}\u{74}",0x1)
629+assert((fr:read("\u{61}\u{6c}\u{6c}") == "\u{78}\u{61}\u{a}"))
630+f:close()
631+;
632+fr:close()
633+assert(os.remove(file))
634+end
635+if (not _soft) then
636+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{73}\u{20}\u{28}\u{3e}\u{20}\u{42}\u{55}\u{46}\u{53}\u{49}\u{5a}\u{29}")
637+io.output(file)
638+for i = 0x1, 0x1389
639+do
640+io.write("\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}")
641+end
642+io.write("\u{a}\u{31}\u{32}\u{33}\u{34}\u{36}"):close()
643+io.input(file)
644+local x = io.read("\u{61}")
645+io.input():seek("\u{73}\u{65}\u{74}",0x0)
646+local y = (io.read(0x7531) .. (io.read(0x3ed) .. (io.read(0x0) .. (io.read(0x1) .. io.read(0x186a3)))))
647+assert(((x == y) and (string.len(x) == ((0x1389 * 0xd) + 0x6))))
648+io.input():seek("\u{73}\u{65}\u{74}",0x0)
649+y=io.read()
650+assert((x == (y .. ("\u{a}" .. io.read()))))
651+assert((not io.read()))
652+io.close(io.input())
653+assert(os.remove(file))
654+x=nil
655+;
656+y=nil
657+end
658+if (not _port) then
659+local progname
660+do
661+local arg = (arg or ARG)
662+local i = 0x0
663+while arg[i] do
664+i=(i - 0x1)
665+end
666+progname=("\u{22}" .. (arg[(i + 0x1)] .. "\u{22}"))
667+end
668+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{6f}\u{70}\u{65}\u{6e}\u{2f}\u{70}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{65}\u{78}\u{65}\u{63}\u{75}\u{74}\u{65}")
669+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.popen,"\u{63}\u{61}\u{74}","")
670+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.popen,"\u{63}\u{61}\u{74}","\u{72}\u{2b}")
671+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6d}\u{6f}\u{64}\u{65}",io.popen,"\u{63}\u{61}\u{74}","\u{72}\u{77}")
672+do
673+local file = os.tmpname()
674+local f = assert(io.popen(("\u{63}\u{61}\u{74}\u{20}\u{2d}\u{20}\u{3e}\u{20}" .. file),"\u{77}"))
675+f:write("\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}")
676+assert(f:close())
677+local f = assert(io.popen(("\u{63}\u{61}\u{74}\u{20}\u{2d}\u{20}\u{3c}\u{20}" .. file),"\u{72}"))
678+assert((f:read("\u{61}") == "\u{61}\u{20}\u{6c}\u{69}\u{6e}\u{65}"))
679+assert(f:close())
680+assert(os.remove(file))
681+end
682+local tests = {{"\u{6c}\u{73}\u{20}\u{3e}\u{20}\u{2f}\u{64}\u{65}\u{76}\u{2f}\u{6e}\u{75}\u{6c}\u{6c}","\u{6f}\u{6b}"},{"\u{6e}\u{6f}\u{74}\u{2d}\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{66}\u{6f}\u{75}\u{6e}\u{64}\u{2d}\u{63}\u{6f}\u{6d}\u{6d}\u{61}\u{6e}\u{64}","\u{65}\u{78}\u{69}\u{74}"},{"\u{65}\u{78}\u{69}\u{74}\u{20}\u{33}","\u{65}\u{78}\u{69}\u{74}",0x3},{"\u{65}\u{78}\u{69}\u{74}\u{20}\u{31}\u{32}\u{39}","\u{65}\u{78}\u{69}\u{74}",0x81},{"\u{6b}\u{69}\u{6c}\u{6c}\u{20}\u{2d}\u{73}\u{20}\u{48}\u{55}\u{50}\u{20}\u{24}\u{24}","\u{73}\u{69}\u{67}\u{6e}\u{61}\u{6c}",0x1},{"\u{6b}\u{69}\u{6c}\u{6c}\u{20}\u{2d}\u{73}\u{20}\u{4b}\u{49}\u{4c}\u{4c}\u{20}\u{24}\u{24}","\u{73}\u{69}\u{67}\u{6e}\u{61}\u{6c}",0x9},{"\u{73}\u{68}\u{20}\u{2d}\u{63}\u{20}\u{27}\u{6b}\u{69}\u{6c}\u{6c}\u{20}\u{2d}\u{73}\u{20}\u{48}\u{55}\u{50}\u{20}\u{24}\u{24}\u{27}","\u{65}\u{78}\u{69}\u{74}"},{(progname .. "\u{20}\u{2d}\u{65}\u{20}\u{22}\u{20}\u{22}"),"\u{6f}\u{6b}"},{(progname .. "\u{20}\u{2d}\u{65}\u{20}\u{22}\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{30}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}\u{22}"),"\u{6f}\u{6b}"},{(progname .. "\u{20}\u{2d}\u{65}\u{20}\u{22}\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{32}\u{30}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}\u{22}"),"\u{65}\u{78}\u{69}\u{74}",0x14}}
683+print("\u{a}\u{28}\u{73}\u{6f}\u{6d}\u{65}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{73}\u{20}\u{61}\u{72}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{6e}\u{6f}\u{77}\u{29}")
684+for _,v in ipairs(tests)
685+do
686+local x,y,z = io.popen(v[0x1]):close()
687+local x1,y1,z1 = os.execute(v[0x1])
688+assert((((x == x1) and (y == y1)) and (z == z1)))
689+if (v[0x2] == "\u{6f}\u{6b}") then
690+assert(((x and (y == "\u{65}\u{78}\u{69}\u{74}")) and (z == 0x0)))
691+else
692+assert((not (x and (y == v[0x2]))))
693+assert((((v[0x3] == nil) and (z > 0x0)) or (v[0x3] == z)))
694+end
695+end
696+end
697+f=io.tmpfile()
698+assert((io.type(f) == "\u{66}\u{69}\u{6c}\u{65}"))
699+f:write("\u{61}\u{6c}\u{6f}")
700+f:seek("\u{73}\u{65}\u{74}")
701+assert((f:read("\u{61}") == "\u{61}\u{6c}\u{6f}"))
702+end
703+print("\u{2b}")
704+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{64}\u{61}\u{74}\u{65}\u{2f}\u{74}\u{69}\u{6d}\u{65}")
705+assert((os.date("") == ""))
706+assert((os.date("\u{21}") == ""))
707+assert((os.date("\u{0}\u{0}") == "\u{0}\u{0}"))
708+assert((os.date("\u{21}\u{0}\u{0}") == "\u{0}\u{0}"))
709+local x = string.rep("\u{61}",0x2710)
710+assert((os.date(x) == x))
711+local t = os.time()
712+D=os.date("\u{2a}\u{74}",t)
713+assert((os.date(string.rep("\u{25}\u{64}",0x3e8),t) == string.rep(os.date("\u{25}\u{64}",t),0x3e8)))
714+assert((os.date(string.rep("\u{25}",0xc8)) == string.rep("\u{25}",0x64)))
715+local function checkDateTable
716+(t)
717+_G.D=os.date("\u{2a}\u{74}",t)
718+assert((os.time(D) == t))
719+load(os.date("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{44}\u{2e}\u{79}\u{65}\u{61}\u{72}\u{3d}\u{3d}\u{25}\u{59}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{44}\u{2e}\u{6d}\u{6f}\u{6e}\u{74}\u{68}\u{3d}\u{3d}\u{25}\u{6d}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{44}\u{2e}\u{64}\u{61}\u{79}\u{3d}\u{3d}\u{25}\u{64}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{44}\u{2e}\u{68}\u{6f}\u{75}\u{72}\u{3d}\u{3d}\u{25}\u{48}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{44}\u{2e}\u{6d}\u{69}\u{6e}\u{3d}\u{3d}\u{25}\u{4d}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{44}\u{2e}\u{73}\u{65}\u{63}\u{3d}\u{3d}\u{25}\u{53}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{44}\u{2e}\u{77}\u{64}\u{61}\u{79}\u{3d}\u{3d}\u{25}\u{77}\u{2b}\u{31}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{44}\u{2e}\u{79}\u{64}\u{61}\u{79}\u{3d}\u{3d}\u{25}\u{6a}\u{29}",t))()
720+_G.D=nil
721+end
722+checkDateTable(os.time())
723+if (not _port) then
724+checkDateTable(0x0)
725+checkDateTable(0x1)
726+checkDateTable(0x3e8)
727+checkDateTable(0x7fffffff)
728+checkDateTable(0x80000000)
729+end
730+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}")
731+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}\u{39}")
732+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}")
733+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}\u{4f}")
734+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}\u{45}")
735+checkerr("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}\u{20}\u{73}\u{70}\u{65}\u{63}\u{69}\u{66}\u{69}\u{65}\u{72}",os.date,"\u{25}\u{45}\u{61}")
736+checkerr("\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{6e}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = 0x3e8,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1,["\u{68}\u{6f}\u{75}\u{72}"] = "\u{78}"})
737+checkerr("\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{6e}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = 0x3e8,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1,["\u{68}\u{6f}\u{75}\u{72}"] = 1.5})
738+checkerr("\u{6d}\u{69}\u{73}\u{73}\u{69}\u{6e}\u{67}",os.time,{["\u{68}\u{6f}\u{75}\u{72}"] = 0xc})
739+if (string.packsize("\u{69}") == 0x4) then
740+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{79}\u{65}\u{61}\u{72}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = (- ((0x1 << 0x1f) + 0x76b)),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
741+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{79}\u{65}\u{61}\u{72}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = (- (0x1 << 0x1f)),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
742+if (math.maxinteger > (0x2 ^ 0x1f)) then
743+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{79}\u{65}\u{61}\u{72}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = ((0x1 << 0x1f) + 0x76c),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
744+end
745+end
746+if (not _port) then
747+assert((type(os.date("\u{25}\u{45}\u{78}")) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
748+assert((type(os.date("\u{25}\u{4f}\u{79}")) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
749+local t0 = os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7b2,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x0})
750+local t1 = os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7b2,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x0,["\u{73}\u{65}\u{63}"] = ((0x1 << 0x1f) - 0x1)})
751+assert(((t1 - t0) == ((0x1 << 0x1f) - 0x1)))
752+t0=os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7b2,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
753+t1=os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7b2,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1,["\u{73}\u{65}\u{63}"] = (- (0x1 << 0x1f))})
754+assert(((t1 - t0) == (- (0x1 << 0x1f))))
755+if (maxint >= (0x2 ^ 0x3e)) then
756+checkerr("\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = (- maxint),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
757+if (string.packsize("\u{69}") == 0x4) then
758+if testerr("\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.date,"\u{25}\u{59}",(0x2 ^ 0x28)) then
759+print("\u{20}\u{20}\u{34}\u{2d}\u{62}\u{79}\u{74}\u{65}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{5f}\u{74}")
760+checkerr("\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{65}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = 0xfa0,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
761+else
762+print("\u{20}\u{20}\u{38}\u{2d}\u{62}\u{79}\u{74}\u{65}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{5f}\u{74}")
763+checkerr("\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{65}\u{64}",os.date,"\u{25}\u{59}",(0x2 ^ 0x3c))
764+assert(tonumber(os.time({["\u{79}\u{65}\u{61}\u{72}"] = ((0x1 << 0x1f) + 0x76b),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0xc,["\u{64}\u{61}\u{79}"] = 0x1f,["\u{68}\u{6f}\u{75}\u{72}"] = 0x17,["\u{6d}\u{69}\u{6e}"] = 0x3b,["\u{73}\u{65}\u{63}"] = 0x3b})))
765+checkerr("\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{65}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = ((0x1 << 0x1f) + 0x76b),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0xc,["\u{64}\u{61}\u{79}"] = 0x1f,["\u{68}\u{6f}\u{75}\u{72}"] = 0x17,["\u{6d}\u{69}\u{6e}"] = 0x3b,["\u{73}\u{65}\u{63}"] = 0x3c})
766+end
767+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{64}\u{61}\u{79}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = 0x0,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = (0x2 ^ 0x20)})
768+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{6d}\u{6f}\u{6e}\u{74}\u{68}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = 0x0,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = (- ((0x1 << 0x1f) + 0x1)),["\u{64}\u{61}\u{79}"] = 0x1})
769+checkerr("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{79}\u{65}\u{61}\u{72}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{75}\u{74}\u{2d}\u{6f}\u{66}\u{2d}\u{62}\u{6f}\u{75}\u{6e}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = ((0x1 << 0x1f) + 0x76c),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
770+else
771+print("\u{20}\u{20}\u{38}\u{2d}\u{62}\u{79}\u{74}\u{65}\u{20}\u{74}\u{69}\u{6d}\u{65}\u{5f}\u{74}")
772+assert(tonumber(os.date("\u{25}\u{59}",(0x2 ^ 0x3c))))
773+checkerr("\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{65}\u{64}",os.time,{["\u{79}\u{65}\u{61}\u{72}"] = (0x2 ^ 0x3c),["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1})
774+end
775+end
776+end
777+do
778+local D = os.date("\u{2a}\u{74}")
779+local t = os.time(D)
780+if (D.isdst == nil) then
781+print("\u{6e}\u{6f}\u{20}\u{64}\u{61}\u{79}\u{6c}\u{69}\u{67}\u{68}\u{74}\u{20}\u{73}\u{61}\u{76}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{6e}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{69}\u{6f}\u{6e}")
782+else
783+assert((type(D.isdst) == "\u{62}\u{6f}\u{6f}\u{6c}\u{65}\u{61}\u{6e}"))
784+end
785+D.isdst=nil
786+local t1 = os.time(D)
787+assert((t == t1))
788+end
789+local D = os.date("\u{2a}\u{74}")
790+t=os.time(D)
791+D.year=(D.year - 0x1)
792+;
793+local t1 = os.time(D)
794+assert((math.abs(((os.difftime(t,t1) / (0x18 * 0xe10)) - 0x16d)) < 0x2))
795+t=os.time()
796+t1=os.time(os.date("\u{2a}\u{74}"))
797+local diff = os.difftime(t1,t)
798+assert(((0x0 <= diff) and (diff <= 0x1)))
799+diff=os.difftime(t,t1)
800+assert((- ((0x1 <= diff) and (diff <= 0x0))))
801+local t1 = os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7d0,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0xa,["\u{64}\u{61}\u{79}"] = 0x1,["\u{68}\u{6f}\u{75}\u{72}"] = 0x17,["\u{6d}\u{69}\u{6e}"] = 0xc})
802+local t2 = os.time({["\u{79}\u{65}\u{61}\u{72}"] = 0x7d0,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0xa,["\u{64}\u{61}\u{79}"] = 0x1,["\u{68}\u{6f}\u{75}\u{72}"] = 0x17,["\u{6d}\u{69}\u{6e}"] = 0xa,["\u{73}\u{65}\u{63}"] = 0x13})
803+assert((os.difftime(t1,t2) == ((0x3c * 0x2) - 0x13)))
804+t1={["\u{79}\u{65}\u{61}\u{72}"] = 0x7d5,["\u{6d}\u{6f}\u{6e}\u{74}\u{68}"] = 0x1,["\u{64}\u{61}\u{79}"] = 0x1,["\u{68}\u{6f}\u{75}\u{72}"] = 0x1,["\u{6d}\u{69}\u{6e}"] = 0x0,["\u{73}\u{65}\u{63}"] = (- 0xe12)}
805+os.time(t1)
806+assert((((((((t1.day == 0x1f) and (t1.month == 0xc)) and (t1.year == 0x7d4)) and (t1.hour == 0x17)) and (t1.min == 0x3b)) and (t1.sec == 0x3a)) and (t1.yday == 0x16e)))
807+io.output(io.stdout)
808+local t = os.date("\u{25}\u{64}\u{20}\u{25}\u{6d}\u{20}\u{25}\u{59}\u{20}\u{25}\u{48}\u{20}\u{25}\u{4d}\u{20}\u{25}\u{53}")
809+local d,m,a,h,min,s = string.match(t,"\u{28}\u{25}\u{64}\u{2b}\u{29}\u{20}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{20}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{20}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{20}\u{28}\u{25}\u{64}\u{2b}\u{29}\u{20}\u{28}\u{25}\u{64}\u{2b}\u{29}")
810+d=tonumber(d)
811+m=tonumber(m)
812+a=tonumber(a)
813+h=tonumber(h)
814+min=tonumber(min)
815+s=tonumber(s)
816+io.write(string.format("\u{74}\u{65}\u{73}\u{74}\u{20}\u{64}\u{6f}\u{6e}\u{65}\u{20}\u{6f}\u{6e}\u{20}\u{25}\u{32}\u{2e}\u{32}\u{64}\u{2f}\u{25}\u{32}\u{2e}\u{32}\u{64}\u{2f}\u{25}\u{64}",d,m,a))
817+io.write(string.format("\u{2c}\u{20}\u{61}\u{74}\u{20}\u{25}\u{32}\u{2e}\u{32}\u{64}\u{3a}\u{25}\u{32}\u{2e}\u{32}\u{64}\u{3a}\u{25}\u{32}\u{2e}\u{32}\u{64}\u{a}",h,min,s))
818+io.write(string.format("\u{25}\u{73}\u{a}",_VERSION))
desk/res/lua/cycled/foo.luanew file+82
@@ -0,0 +1,82 @@
1+foosjis=nil
2+az=bar[nil]
3+baz=bar(0x1).foo
4+i=0x3
5+i,a[i]=(i + 0x1),(0x14 >> 0x9)
6+hello="\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{64}\u{6b}\u{6e}\u{64}\u{6a}\u{d0}\u{b2}\u{d0}\u{b3}\u{d0}\u{be}\u{d0}\u{b2}\u{d1}\u{88}\u{d0}\u{be}\u{d0}\u{b2}"
7+x={[hello] = 0x8,["\u{68}\u{65}\u{6c}\u{6c}\u{6f}"] = 0xc}
8+;
9+test_cases={{0x7fffffff,"\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{37}"},{0x7fffffff,"\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{37}"},{0xffffffff,"\u{34}\u{32}\u{39}\u{34}\u{39}\u{36}\u{37}\u{32}\u{39}\u{35}"},{0xffffffff,"\u{34}\u{32}\u{39}\u{34}\u{39}\u{36}\u{37}\u{32}\u{39}\u{35}"},{0x7fffffffffffffff,"\u{39}\u{2e}\u{32}\u{32}\u{33}\u{33}\u{37}\u{32}\u{30}\u{33}\u{36}\u{38}\u{35}\u{34}\u{38}\u{65}\u{2b}\u{31}\u{38}"},{0x7fffffffffffffff,"\u{39}\u{2e}\u{32}\u{32}\u{33}\u{33}\u{37}\u{32}\u{30}\u{33}\u{36}\u{38}\u{35}\u{34}\u{38}\u{65}\u{2b}\u{31}\u{38}"},{0x100000000,"\u{34}\u{32}\u{39}\u{34}\u{39}\u{36}\u{37}\u{32}\u{39}\u{36}"},{0x100000000,"\u{34}\u{32}\u{39}\u{34}\u{39}\u{36}\u{37}\u{32}\u{39}\u{36}"},{0x100000000000,"\u{31}\u{37}\u{35}\u{39}\u{32}\u{31}\u{38}\u{36}\u{30}\u{34}\u{34}\u{34}\u{31}\u{36}"},{0x100000000000,"\u{31}\u{37}\u{35}\u{39}\u{32}\u{31}\u{38}\u{36}\u{30}\u{34}\u{34}\u{34}\u{31}\u{36}"},{0x80000000,"\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{38}"},{0x80000000,"\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{38}"},{0x800000000000,"\u{31}\u{2e}\u{34}\u{30}\u{37}\u{33}\u{37}\u{34}\u{38}\u{38}\u{33}\u{35}\u{35}\u{33}\u{33}\u{65}\u{2b}\u{31}\u{34}"},{0x800000000000,"\u{31}\u{2e}\u{34}\u{30}\u{37}\u{33}\u{37}\u{34}\u{38}\u{38}\u{33}\u{35}\u{35}\u{33}\u{33}\u{65}\u{2b}\u{31}\u{34}"}}
10+::helli::
11+foo={3.0,3.1416,3.1416,3.1416,340.0,0.1171875,162.1875,162.1875,3.141592653589793,1984.0}
12+do
13+foo=0x1
14+return 0x8,foo
15+end
16+print("\u{74}\u{68}\u{65}\u{20}\u{77}\u{61}\u{79}\u{20}\u{6f}\u{66}\u{20}\u{74}\u{68}\u{65}\u{20}\u{66}\u{75}\u{74}\u{75}\u{72}\u{65}")
17+print("\u{68}\u{65}\u{6c}\u{6c}\u{6f}")
18+h({["\u{6b}\u{65}\u{79}\u{31}"] = "\u{53}\u{6f}\u{6e}\u{6d}\u{69}\u{7e}\u{34}\u{35}\u{31}"})
19+goto helli
20+break
21+while true do
22+break
23+end
24+repeat
25+do
26+foo=0x9
27+;
28+end
29+until true
30+if (l == 0x3) then
31+a=(a + 0x1)
32+;
33+assert((getlocal(0x2,0x1) == "\u{28}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{29}"))
34+elseif (l == 0x4) then
35+a=(a + 0x1)
36+;
37+assert((getlocal(0x2,0x1) == "\u{41}"))
38+else
39+;
40+end
41+for i = 0x1, 0x64
42+do
43+karlSum=(karlSum + i)
44+end
45+for j = 0x64, 0x1, 0x1
46+do
47+fredSum=(fredSum + j)
48+end
49+for key,val in pairs(u)
50+do
51+print(key,val)
52+end
53+function Dog:new()
54+newObj={["\u{73}\u{6f}\u{75}\u{6e}\u{64}"] = "\u{77}\u{6f}\u{6f}\u{66}"}
55+self.__index=self
56+return setmetatable(newObj,self)
57+end
58+function Dog:makeSound()
59+print(("\u{49}\u{20}\u{73}\u{61}\u{79}\u{20}" .. self.sound))
60+end
61+local function g
62+(x)
63+return math.sin(x)
64+end
65+local a = require("\u{6d}\u{6f}\u{64}\u{32}")
66+local b = require("\u{6d}\u{6f}\u{64}\u{32}")
67+function adder(x)
68+return function (y)
69+return (x + y)
70+end
71+end
72+x=(- (0x1 + 0x8))
73+if (_VERSION ~= version) then
74+io.stderr:write("\u{54}\u{68}\u{69}\u{73}\u{20}\u{74}\u{65}\u{73}\u{74}\u{20}\u{73}\u{75}\u{69}\u{74}\u{65}\u{20}\u{69}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}",version,"\u{2c}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{6f}\u{72}\u{20}",_VERSION,"\u{a}\u{45}\u{78}\u{69}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}")
75+return
76+end
77+math.randomseed()
78+local random_x,random_y = math.randomseed()
79+do
80+local random_x,random_y = math.randomseed()
81+print(string.format("\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{73}\u{65}\u{65}\u{64}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{25}\u{64}",random_x,random_y))
82+end
desk/res/lua/cycled/gc.luanew file+790
@@ -0,0 +1,790 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}\u{20}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
4+collectgarbage()
5+local oldmode = collectgarbage("\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}")
6+assert((collectgarbage("\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}") == "\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}"))
7+assert((collectgarbage("\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}") == "\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}"))
8+assert((collectgarbage("\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}") == "\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}"))
9+assert((collectgarbage("\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}") == "\u{69}\u{6e}\u{63}\u{72}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{61}\u{6c}"))
10+local function nop
11+()
12+
13+end
14+local function gcinfo
15+()
16+return (collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") * 0x400)
17+end
18+do
19+local a = collectgarbage("\u{73}\u{65}\u{74}\u{70}\u{61}\u{75}\u{73}\u{65}",0xc8)
20+local b = collectgarbage("\u{73}\u{65}\u{74}\u{73}\u{74}\u{65}\u{70}\u{6d}\u{75}\u{6c}",0xc8)
21+local t = {0x0,0x2,0xa,0x5a,0x1f4,0x1388,0x7530,0x7ffffffe}
22+for i = 0x1, (# t)
23+do
24+local p = t[i]
25+for j = 0x1, (# t)
26+do
27+local m = t[j]
28+collectgarbage("\u{73}\u{65}\u{74}\u{70}\u{61}\u{75}\u{73}\u{65}",p)
29+collectgarbage("\u{73}\u{65}\u{74}\u{73}\u{74}\u{65}\u{70}\u{6d}\u{75}\u{6c}",m)
30+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
31+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x2710)
32+end
33+end
34+collectgarbage("\u{73}\u{65}\u{74}\u{70}\u{61}\u{75}\u{73}\u{65}",a)
35+collectgarbage("\u{73}\u{65}\u{74}\u{73}\u{74}\u{65}\u{70}\u{6d}\u{75}\u{6c}",b)
36+collectgarbage()
37+end
38+_G["\u{77}\u{68}\u{69}\u{6c}\u{65}"]=0xea
39+local function GC1
40+()
41+local u
42+local b
43+local finish = false
44+u=setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
45+finish=true
46+end})
47+b={0x22}
48+repeat
49+u={}
50+until finish
51+assert((b[0x1] == 0x22))
52+finish=false
53+;
54+local i = 0x1
55+u=setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
56+finish=true
57+end})
58+repeat
59+i=(i + 0x1)
60+;
61+u=(tostring(i) .. tostring(i))
62+until finish
63+assert((b[0x1] == 0x22))
64+finish=false
65+u=setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
66+finish=true
67+end})
68+repeat
69+local i
70+;
71+u=function ()
72+return i
73+end
74+until finish
75+assert((b[0x1] == 0x22))
76+end
77+local function GC2
78+()
79+local u
80+local finish = false
81+u={setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
82+finish=true
83+end})}
84+local b = {0x22}
85+repeat
86+u={{}}
87+until finish
88+assert((b[0x1] == 0x22))
89+finish=false
90+;
91+local i = 0x1
92+u={setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
93+finish=true
94+end})}
95+repeat
96+i=(i + 0x1)
97+;
98+u={(tostring(i) .. tostring(i))}
99+until finish
100+assert((b[0x1] == 0x22))
101+finish=false
102+u={setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
103+finish=true
104+end})}
105+repeat
106+local i
107+;
108+u={function ()
109+return i
110+end}
111+until finish
112+assert((b[0x1] == 0x22))
113+end
114+local function GC
115+()
116+GC1()
117+;
118+GC2()
119+end
120+do
121+print("\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{73}")
122+local limit = 0x1388
123+for i = 0x1, limit
124+do
125+local a = {}
126+;
127+a=nil
128+end
129+local a = "\u{61}"
130+for i = 0x1, limit
131+do
132+a=(i .. "\u{62}")
133+;
134+a=string.gsub(a,"\u{28}\u{25}\u{64}\u{25}\u{64}\u{2a}\u{29}","\u{25}\u{31}\u{20}\u{25}\u{31}")
135+a="\u{61}"
136+end
137+a={}
138+function a:test()
139+for i = 0x1, limit
140+do
141+load(string.format("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{74}\u{65}\u{6d}\u{70}\u{28}\u{61}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}\u{61}\u{25}\u{64}\u{27}\u{20}\u{65}\u{6e}\u{64}",i),"")()
142+assert((temp() == string.format("\u{61}\u{25}\u{64}",i)))
143+end
144+end
145+a:test()
146+_G.temp=nil
147+end
148+do
149+local f = function ()
150+
151+end
152+end
153+print("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}")
154+local prog = "\u{64}\u{6f}\u{a}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{78}\u{2c}\u{79}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{73}\u{69}\u{6e}\u{28}\u{61}\u{2b}\u{30}\u{2e}\u{34}\u{35}\u{36}\u{2d}\u{30}\u{2e}\u{32}\u{33}\u{65}\u{2d}\u{31}\u{32}\u{29}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{7a}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{69}\u{6e}\u{28}\u{25}\u{78}\u{2b}\u{7a}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{77}\u{29}\u{20}\u{61}\u{3d}\u{61}\u{2b}\u{77}\u{3b}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{65}\u{6e}\u{64}\u{a}"
155+do
156+local step = 0x1
157+if _soft then
158+step=0xd
159+end
160+for i = 0x1, string.len(prog), step
161+do
162+for j = i, string.len(prog), step
163+do
164+pcall(load(string.sub(prog,i,j),""))
165+end
166+end
167+end
168+rawset(_G,"\u{61}",nil)
169+_G.x=nil
170+do
171+foo=nil
172+print("\u{6c}\u{6f}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}")
173+local x = "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
174+assert((string.len(x) == 0x50))
175+local s = ""
176+local k = math.min(0x12c,((math.maxinteger // 0x50) // 0x2))
177+for n = 0x1, k
178+do
179+s=(s .. x)
180+;
181+local j = tostring(n)
182+end
183+assert((string.len(s) == (k * 0x50)))
184+s=string.sub(s,0x1,0x2710)
185+local s,i = string.gsub(s,"\u{28}\u{25}\u{64}\u{25}\u{64}\u{25}\u{64}\u{25}\u{64}\u{29}","")
186+assert((i == (0x2710 // 0x4)))
187+assert((_G["\u{77}\u{68}\u{69}\u{6c}\u{65}"] == 0xea))
188+_G["\u{77}\u{68}\u{69}\u{6c}\u{65}"]=nil
189+end
190+do
191+print("\u{73}\u{74}\u{65}\u{70}\u{73}")
192+print("\u{73}\u{74}\u{65}\u{70}\u{73}\u{20}\u{28}\u{32}\u{29}")
193+local function dosteps
194+(siz)
195+collectgarbage()
196+local a = {}
197+for i = 0x1, 0x64
198+do
199+a[i]={{}}
200+;
201+local b = {}
202+end
203+local x = gcinfo()
204+local i = 0x0
205+repeat
206+i=(i + 0x1)
207+until collectgarbage("\u{73}\u{74}\u{65}\u{70}",siz)
208+assert((gcinfo() < x))
209+return i
210+end
211+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
212+if (not _port) then
213+assert((dosteps(0xa) < dosteps(0x2)))
214+end
215+assert((dosteps(0x4e20) == 0x1))
216+assert((collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x4e20) == true))
217+assert((collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x4e20) == true))
218+assert((not collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}")))
219+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
220+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
221+end
222+if (not _port) then
223+collectgarbage()
224+;
225+collectgarbage()
226+local x = gcinfo()
227+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
228+repeat
229+local a = {}
230+until (gcinfo() > (0x3 * x))
231+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
232+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
233+repeat
234+local a = {}
235+until (gcinfo() <= (x * 0x2))
236+end
237+print("\u{63}\u{6c}\u{65}\u{61}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}")
238+local lim = 0xf
239+local a = {}
240+for i = 0x1, lim
241+do
242+a[{}]=i
243+end
244+b={}
245+for k,v in pairs(a)
246+do
247+b[k]=v
248+end
249+for n in pairs(b)
250+do
251+a[n]=undef
252+assert(((type(n) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") and (next(n) == nil)))
253+collectgarbage()
254+end
255+b=nil
256+collectgarbage()
257+for n in pairs(a)
258+do
259+error("\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}")
260+end
261+for i = 0x1, lim
262+do
263+a[i]=i
264+end
265+for i = 0x1, lim
266+do
267+assert((a[i] == i))
268+end
269+print("\u{77}\u{65}\u{61}\u{6b}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}")
270+a={}
271+;
272+setmetatable(a,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}"})
273+;
274+for i = 0x1, lim
275+do
276+a[{}]=i
277+end
278+for i = 0x1, lim
279+do
280+a[i]=i
281+end
282+for i = 0x1, lim
283+do
284+local s = string.rep("\u{40}",i)
285+;
286+a[s]=(s .. "\u{23}")
287+end
288+collectgarbage()
289+local i = 0x0
290+for k,v in pairs(a)
291+do
292+assert(((k == v) or ((k .. "\u{23}") == v)))
293+;
294+i=(i + 0x1)
295+end
296+assert((i == (0x2 * lim)))
297+a={}
298+;
299+setmetatable(a,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{76}"})
300+;
301+a[0x1]=string.rep("\u{62}",0x15)
302+collectgarbage()
303+assert(a[0x1])
304+a[0x1]=undef
305+for i = 0x1, lim
306+do
307+a[i]={}
308+end
309+for i = 0x1, lim
310+do
311+a[(i .. "\u{78}")]={}
312+end
313+for i = 0x1, lim
314+do
315+local t = {}
316+;
317+a[t]=t
318+end
319+for i = 0x1, lim
320+do
321+a[(i + lim)]=(i .. "\u{78}")
322+end
323+collectgarbage()
324+local i = 0x0
325+for k,v in pairs(a)
326+do
327+assert(((k == v) or (((k - lim) .. "\u{78}") == v)))
328+;
329+i=(i + 0x1)
330+end
331+assert((i == (0x2 * lim)))
332+a={}
333+;
334+setmetatable(a,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
335+;
336+local x,y,z = {},{},{}
337+a[0x1],a[0x2],a[0x3]=x,y,z
338+a[string.rep("\u{24}",0xb)]=string.rep("\u{24}",0xb)
339+for i = 0x4, lim
340+do
341+a[i]={}
342+end
343+for i = 0x1, lim
344+do
345+a[{}]=i
346+end
347+for i = 0x1, lim
348+do
349+local t = {}
350+;
351+a[t]=t
352+end
353+collectgarbage()
354+assert((next(a) ~= nil))
355+local i = 0x0
356+for k,v in pairs(a)
357+do
358+assert((((((k == 0x1) and (v == x)) or ((k == 0x2) and (v == y))) or ((k == 0x3) and (v == z))) or (k == v)))
359+;
360+i=(i + 0x1)
361+end
362+assert((i == 0x4))
363+x,y,z=nil
364+collectgarbage()
365+assert((next(a) == string.rep("\u{24}",0xb)))
366+a={}
367+local t = {["\u{78}"] = 0xa}
368+local C = setmetatable({["\u{6b}\u{65}\u{79}"] = t},{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{76}"})
369+local C1 = setmetatable({[t] = 0x1},{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}"})
370+a.x=t
371+setmetatable(a,{["\u{5f}\u{5f}\u{67}\u{63}"] = function (u)
372+assert((C.key == nil))
373+assert((type(next(C1)) == "\u{74}\u{61}\u{62}\u{6c}\u{65}"))
374+end})
375+a,t=nil
376+collectgarbage()
377+collectgarbage()
378+assert(((next(C) == nil) and (next(C1) == nil)))
379+C,C1=nil
380+local mt = {["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}"}
381+a={{0xa},{0x14},{0x1e},{0x28}}
382+;
383+setmetatable(a,mt)
384+x=nil
385+for i = 0x1, 0x64
386+do
387+local n = {}
388+;
389+a[n]={["\u{6b}"] = {x}}
390+;
391+x=n
392+end
393+GC()
394+local n = x
395+local i = 0x0
396+while n do
397+n=a[n].k[0x1]
398+;
399+i=(i + 0x1)
400+end
401+assert((i == 0x64))
402+x=nil
403+GC()
404+for i = 0x1, 0x4
405+do
406+assert((a[i][0x1] == (i * 0xa)))
407+;
408+a[i]=undef
409+end
410+assert((next(a) == nil))
411+local K = {}
412+a[K]={}
413+for i = 0x1, 0xa
414+do
415+a[K][i]={}
416+;
417+a[a[K][i]]=setmetatable({},mt)
418+end
419+x=nil
420+local k = 0x1
421+for j = 0x1, 0x64
422+do
423+local n = {}
424+;
425+local nk = ((k % 0xa) + 0x1)
426+a[a[K][nk]][n]={x,["\u{6b}"] = k}
427+;
428+x=n
429+;
430+k=nk
431+end
432+GC()
433+local n = x
434+local i = 0x0
435+while n do
436+local t = a[a[K][k]][n]
437+;
438+n=t[0x1]
439+;
440+k=t.k
441+;
442+i=(i + 0x1)
443+end
444+assert((i == 0x64))
445+K=nil
446+GC()
447+if T then
448+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
449+local u = {}
450+local s = {}
451+;
452+setmetatable(s,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}"})
453+setmetatable(u,{["\u{5f}\u{5f}\u{67}\u{63}"] = function (o)
454+local i = s[o]
455+s[i]=true
456+assert((not s[(i - 0x1)]))
457+if (i == 0x8) then
458+error("\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{40}")
459+end
460+end})
461+for i = 0x6, 0xa
462+do
463+local n = setmetatable({},getmetatable(u))
464+s[n]=i
465+end
466+warn("\u{40}\u{6f}\u{6e}")
467+;
468+warn("\u{40}\u{73}\u{74}\u{6f}\u{72}\u{65}")
469+collectgarbage()
470+assert(string.find(_WARN,"\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{69}\u{6e}\u{20}\u{5f}\u{5f}\u{67}\u{63}"))
471+assert((string.match(_WARN,"\u{40}\u{28}\u{2e}\u{2d}\u{29}\u{40}") == "\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}"))
472+;
473+_WARN=false
474+for i = 0x8, 0xa
475+do
476+assert(s[i])
477+end
478+for i = 0x1, 0x5
479+do
480+local n = setmetatable({},getmetatable(u))
481+s[n]=i
482+end
483+collectgarbage()
484+for i = 0x1, 0xa
485+do
486+assert(s[i])
487+end
488+getmetatable(u).__gc=nil
489+warn("\u{40}\u{6e}\u{6f}\u{72}\u{6d}\u{61}\u{6c}")
490+end
491+print("\u{2b}")
492+if (T == nil) then
493+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{75}\u{73}\u{65}\u{72}\u{64}\u{61}\u{74}\u{61}\u{20}\u{47}\u{43}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
494+else
495+local function newproxy
496+(u)
497+return debug.setmetatable(T.newuserdata(0x0),debug.getmetatable(u))
498+end
499+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
500+local u = newproxy(nil)
501+debug.setmetatable(u,{["\u{5f}\u{5f}\u{67}\u{63}"] = true})
502+local s = 0x0
503+local a = {[u] = 0x0}
504+;
505+setmetatable(a,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{76}\u{6b}"})
506+for i = 0x1, 0xa
507+do
508+a[newproxy(u)]=i
509+end
510+for k in pairs(a)
511+do
512+assert((getmetatable(k) == getmetatable(u)))
513+end
514+local a1 = {}
515+;
516+for k,v in pairs(a)
517+do
518+a1[k]=v
519+end
520+for k,v in pairs(a1)
521+do
522+a[v]=k
523+end
524+for i = 0x1, 0xa
525+do
526+assert(a[i])
527+end
528+getmetatable(u).a=a1
529+getmetatable(u).u=u
530+do
531+local u = u
532+getmetatable(u).__gc=function (o)
533+assert((a[o] == (0xa - s)))
534+assert((a[(0xa - s)] == undef))
535+assert((getmetatable(o) == getmetatable(u)))
536+assert((getmetatable(o).a[o] == (0xa - s)))
537+s=(s + 0x1)
538+end
539+end
540+a1,u=nil
541+assert((next(a) ~= nil))
542+collectgarbage()
543+assert((s == 0xb))
544+collectgarbage()
545+assert((next(a) == nil))
546+end
547+local u = setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = true})
548+setmetatable(getmetatable(u),{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{76}"})
549+getmetatable(u).__gc=function (o)
550+os.exit(0x1)
551+end
552+u=nil
553+collectgarbage()
554+local u = setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = true})
555+local m = getmetatable(u)
556+m.x={[{0x0}] = 0x1,[0x0] = {0x1}}
557+;
558+setmetatable(m.x,{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
559+;
560+m.__gc=function (o)
561+assert((next(getmetatable(o).x) == nil))
562+m=0xa
563+end
564+u,m=nil
565+collectgarbage()
566+assert((m == 0xa))
567+do
568+collectgarbage()
569+;
570+collectgarbage()
571+local m = collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
572+local a = setmetatable({},{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
573+a[string.rep("\u{61}",(0x2 ^ 0x16))]=0x19
574+a[string.rep("\u{62}",(0x2 ^ 0x16))]={}
575+a[{}]=0xe
576+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") > (m + (0x2 ^ 0xd))))
577+collectgarbage()
578+assert(((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") >= (m + (0x2 ^ 0xc))) and (collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") < (m + (0x2 ^ 0xd)))))
579+local k,v = next(a)
580+assert(((k == string.rep("\u{61}",(0x2 ^ 0x16))) and (v == 0x19)))
581+assert((next(a,k) == nil))
582+assert((a[string.rep("\u{62}",(0x2 ^ 0x16))] == undef))
583+a[k]=undef
584+k=nil
585+collectgarbage()
586+assert((next(a) == nil))
587+assert((a[string.rep("\u{62}",0x64)] == undef))
588+assert((collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") <= (m + 0x1)))
589+end
590+if T then
591+warn("\u{40}\u{73}\u{74}\u{6f}\u{72}\u{65}")
592+u=setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
593+error("\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}")
594+end})
595+u=nil
596+collectgarbage()
597+assert(string.find(_WARN,"\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}"))
598+;
599+_WARN=false
600+warn("\u{40}\u{6e}\u{6f}\u{72}\u{6d}\u{61}\u{6c}")
601+end
602+if (not _soft) then
603+print("\u{6c}\u{6f}\u{6e}\u{67}\u{20}\u{6c}\u{69}\u{73}\u{74}")
604+local a = {}
605+for i = 0x1, 0x30d40
606+do
607+a={["\u{6e}\u{65}\u{78}\u{74}"] = a}
608+end
609+a=nil
610+collectgarbage()
611+end
612+print("\u{73}\u{65}\u{6c}\u{66}\u{2d}\u{72}\u{65}\u{66}\u{65}\u{72}\u{65}\u{6e}\u{63}\u{65}\u{64}\u{20}\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}\u{73}")
613+local thread_id = 0x0
614+local threads = {}
615+local function fn
616+(thread)
617+local x = {}
618+threads[thread_id]=function ()
619+thread=x
620+end
621+coroutine.yield()
622+end
623+while (thread_id < 0x3e8) do
624+local thread = coroutine.create(fn)
625+coroutine.resume(thread,thread)
626+thread_id=(thread_id + 0x1)
627+end
628+do
629+local collected = false
630+collectgarbage()
631+;
632+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
633+do
634+local function f
635+(param)
636+;
637+(function ()
638+assert(((type(f) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and (type(param) == "\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}")))
639+param={param,f}
640+setmetatable(param,{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
641+collected=true
642+end})
643+coroutine.yield(0x64)
644+end)()
645+end
646+local co = coroutine.create(f)
647+assert(coroutine.resume(co,co))
648+end
649+collectgarbage()
650+assert(collected)
651+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
652+end
653+do
654+collectgarbage()
655+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
656+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
657+local x = gcinfo()
658+repeat
659+for i = 0x1, 0x3e8
660+do
661+_ENV.a={}
662+end
663+until (gcinfo() > (0x2 * x))
664+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
665+_ENV.a=nil
666+end
667+if T then
668+local function foo
669+()
670+local a = {["\u{78}"] = 0x14}
671+coroutine.yield(function ()
672+return a.x
673+end)
674+assert((a.x == 0x14))
675+a={["\u{78}"] = 0x1e}
676+assert((T.gccolor(a) == "\u{77}\u{68}\u{69}\u{74}\u{65}"))
677+coroutine.yield(0x64)
678+end
679+local t = setmetatable({},{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
680+collectgarbage()
681+;
682+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
683+t.co=coroutine.wrap(foo)
684+local f = t.co()
685+T.gcstate("\u{61}\u{74}\u{6f}\u{6d}\u{69}\u{63}")
686+assert((T.gcstate() == "\u{61}\u{74}\u{6f}\u{6d}\u{69}\u{63}"))
687+assert((t.co() == 0x64))
688+assert((T.gccolor(t.co) == "\u{77}\u{68}\u{69}\u{74}\u{65}"))
689+T.gcstate("\u{70}\u{61}\u{75}\u{73}\u{65}")
690+assert(((t.co == nil) and (f() == 0x1e)))
691+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
692+local u = T.newuserdata(0x0,0x1)
693+collectgarbage()
694+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
695+local a = {}
696+T.gcstate("\u{61}\u{74}\u{6f}\u{6d}\u{69}\u{63}")
697+T.gcstate("\u{73}\u{77}\u{65}\u{65}\u{70}\u{61}\u{6c}\u{6c}\u{67}\u{63}")
698+local x = {}
699+assert((T.gccolor(u) == "\u{62}\u{6c}\u{61}\u{63}\u{6b}"))
700+assert((T.gccolor(x) == "\u{77}\u{68}\u{69}\u{74}\u{65}"))
701+debug.setuservalue(u,x)
702+assert((T.gccolor(u) == "\u{67}\u{72}\u{61}\u{79}"))
703+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
704+print("\u{2b}")
705+end
706+if T then
707+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
708+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
709+local x = T.newuserdata(0x0)
710+local y = T.newuserdata(0x0)
711+debug.setmetatable(y,{["\u{5f}\u{5f}\u{67}\u{63}"] = nop})
712+debug.setmetatable(x,{["\u{5f}\u{5f}\u{67}\u{63}"] = nop})
713+assert((T.gccolor(y) == "\u{77}\u{68}\u{69}\u{74}\u{65}"))
714+T.checkmemory()
715+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
716+end
717+if T then
718+print("\u{65}\u{6d}\u{65}\u{72}\u{67}\u{65}\u{6e}\u{63}\u{79}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}")
719+collectgarbage()
720+collectgarbage()
721+T.totalmem((T.totalmem() + 0xc8))
722+for i = 0x1, 0xc8
723+do
724+local a = {}
725+end
726+T.totalmem(0x0)
727+collectgarbage()
728+local t = T.totalmem("\u{74}\u{61}\u{62}\u{6c}\u{65}")
729+local a = {{},{},{}}
730+assert((T.totalmem("\u{74}\u{61}\u{62}\u{6c}\u{65}") == (t + 0x4)))
731+t=T.totalmem("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
732+a=function ()
733+
734+end
735+assert((T.totalmem("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") == (t + 0x1)))
736+t=T.totalmem("\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}")
737+a=coroutine.create(function ()
738+
739+end)
740+assert((T.totalmem("\u{74}\u{68}\u{72}\u{65}\u{61}\u{64}") == (t + 0x1)))
741+end
742+do
743+local setmetatable,assert,type,print,getmetatable = setmetatable,assert,type,print,getmetatable
744+local tt = {}
745+tt.__gc=function (o)
746+assert((getmetatable(o) == tt))
747+local a = ("\u{78}\u{75}\u{78}\u{75}" .. ((0xa + 0x3) .. "\u{6a}\u{6f}\u{61}\u{6f}")),{}
748+___Glob=o
749+setmetatable({},tt)
750+print(("\u{3e}\u{3e}\u{3e}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{74}\u{65}\u{20}" .. "\u{3c}\u{3c}\u{3c}\u{a}"))
751+end
752+local u = setmetatable({},tt)
753+___Glob={u}
754+end
755+if T then
756+local error,assert,find,warn = error,assert,string.find,warn
757+local n = 0x0
758+local lastmsg
759+local mt = {["\u{5f}\u{5f}\u{67}\u{63}"] = function (o)
760+n=(n + 0x1)
761+assert((n == o[0x1]))
762+if (n == 0x1) then
763+_WARN=false
764+elseif (n == 0x2) then
765+assert(find(_WARN,"\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}"))
766+lastmsg=_WARN
767+else
768+assert((lastmsg == _WARN))
769+end
770+warn("\u{40}\u{73}\u{74}\u{6f}\u{72}\u{65}")
771+;
772+_WARN=false
773+error("\u{40}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}")
774+end}
775+for i = 0xa, 0x1, (- 0x1)
776+do
777+table.insert(___Glob,setmetatable({i},mt))
778+end
779+end
780+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
781+do
782+local res = true
783+setmetatable({},{["\u{5f}\u{5f}\u{67}\u{63}"] = function ()
784+res=collectgarbage()
785+end})
786+collectgarbage()
787+assert((not res))
788+end
789+collectgarbage(oldmode)
790+print("\u{4f}\u{4b}")
desk/res/lua/cycled/gengc.luanew file+108
@@ -0,0 +1,108 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}\u{20}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{69}\u{6f}\u{6e}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
4+collectgarbage()
5+local oldmode = collectgarbage("\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}")
6+do
7+local U = {}
8+collectgarbage()
9+assert((not (T or (T.gcage(U) == "\u{6f}\u{6c}\u{64}"))))
10+U[0x1]={["\u{78}"] = {0xea}}
11+assert((not (T or ((T.gcage(U) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{31}") and (T.gcage(U[0x1]) == "\u{6e}\u{65}\u{77}")))))
12+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
13+assert((not (T or ((T.gcage(U) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{32}") and (T.gcage(U[0x1]) == "\u{73}\u{75}\u{72}\u{76}\u{69}\u{76}\u{61}\u{6c}")))))
14+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
15+assert((not (T or ((T.gcage(U) == "\u{6f}\u{6c}\u{64}") and (T.gcage(U[0x1]) == "\u{6f}\u{6c}\u{64}\u{31}")))))
16+assert((U[0x1].x[0x1] == 0xea))
17+end
18+do
19+local function foo
20+()
21+
22+end
23+local old = {0xa}
24+collectgarbage()
25+assert((not (T or (T.gcage(old) == "\u{6f}\u{6c}\u{64}"))))
26+setmetatable(old,{})
27+assert((not (T or (T.gcage(getmetatable(old)) == "\u{6f}\u{6c}\u{64}\u{30}"))))
28+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
29+assert((not (T or (T.gcage(getmetatable(old)) == "\u{6f}\u{6c}\u{64}\u{31}"))))
30+setmetatable(getmetatable(old),{["\u{5f}\u{5f}\u{67}\u{63}"] = foo})
31+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
32+end
33+do
34+local A = {}
35+A[0x1]=false
36+local function gcf
37+(obj)
38+A[0x1]=obj
39+assert((not (T or (T.gcage(obj) == "\u{6f}\u{6c}\u{64}\u{31}"))))
40+obj=nil
41+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
42+print(getmetatable(A[0x1]).x)
43+end
44+collectgarbage()
45+local obj = {}
46+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
47+assert((not (T or (T.gcage(obj) == "\u{73}\u{75}\u{72}\u{76}\u{69}\u{76}\u{61}\u{6c}"))))
48+setmetatable(obj,{["\u{5f}\u{5f}\u{67}\u{63}"] = gcf,["\u{78}"] = "\u{2b}"})
49+assert((not (T or (T.gcage(getmetatable(obj)) == "\u{6e}\u{65}\u{77}"))))
50+obj=nil
51+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
52+end
53+do
54+local old = {0xa}
55+collectgarbage()
56+local co = coroutine.create(function ()
57+local x = nil
58+local f = function ()
59+return x[0x1]
60+end
61+x=coroutine.yield(f)
62+coroutine.yield()
63+end)
64+local _,f = coroutine.resume(co)
65+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
66+old[0x1]={"\u{68}\u{65}\u{6c}\u{6c}\u{6f}"}
67+coroutine.resume(co,{0x7b})
68+co=nil
69+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
70+assert(((f() == 0x7b) and (old[0x1][0x1] == "\u{68}\u{65}\u{6c}\u{6c}\u{6f}")))
71+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
72+assert(((f() == 0x7b) and (old[0x1][0x1] == "\u{68}\u{65}\u{6c}\u{6c}\u{6f}")))
73+end
74+do
75+local t = setmetatable({},{["\u{5f}\u{5f}\u{6d}\u{6f}\u{64}\u{65}"] = "\u{6b}\u{76}"})
76+collectgarbage()
77+assert((not (T or (T.gcage(t) == "\u{6f}\u{6c}\u{64}"))))
78+t[0x1]={0xa}
79+assert((not (T or ((T.gcage(t) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{31}") and (T.gccolor(t) == "\u{67}\u{72}\u{61}\u{79}")))))
80+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
81+assert((not (T or ((T.gcage(t) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{32}") and (T.gccolor(t) == "\u{62}\u{6c}\u{61}\u{63}\u{6b}")))))
82+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
83+assert((not (T or (T.gcage(t) == "\u{6f}\u{6c}\u{64}"))))
84+t[0x1]={0xa}
85+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
86+assert((t[0x1] == nil))
87+end
88+if (T == nil) then
89+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{6f}\u{6d}\u{65}\u{20}\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{61}\u{6c}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
90+print("\u{4f}\u{4b}")
91+return
92+end
93+do
94+local U = T.newuserdata(0x0,0x1)
95+collectgarbage()
96+assert((T.gcage(U) == "\u{6f}\u{6c}\u{64}"))
97+debug.setuservalue(U,{["\u{78}"] = {0xea}})
98+assert(((T.gcage(U) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{31}") and (T.gcage(debug.getuservalue(U)) == "\u{6e}\u{65}\u{77}")))
99+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
100+assert(((T.gcage(U) == "\u{74}\u{6f}\u{75}\u{63}\u{68}\u{65}\u{64}\u{32}") and (T.gcage(debug.getuservalue(U)) == "\u{73}\u{75}\u{72}\u{76}\u{69}\u{76}\u{61}\u{6c}")))
101+collectgarbage("\u{73}\u{74}\u{65}\u{70}",0x0)
102+assert(((T.gcage(U) == "\u{6f}\u{6c}\u{64}") and (T.gcage(debug.getuservalue(U)) == "\u{6f}\u{6c}\u{64}\u{31}")))
103+assert((debug.getuservalue(U).x[0x1] == 0xea))
104+end
105+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
106+assert(collectgarbage("\u{69}\u{73}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}"))
107+collectgarbage(oldmode)
108+print("\u{4f}\u{4b}")
desk/res/lua/cycled/goto.luanew file+275
@@ -0,0 +1,275 @@
1+collectgarbage()
2+local function errmsg
3+(code,m)
4+local st,msg = load(code)
5+assert((not (st and string.find(msg,m))))
6+end
7+errmsg("\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{3b}\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
8+errmsg("\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{3b}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
9+errmsg("\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
10+errmsg("\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
11+errmsg("\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{3a}\u{3a}\u{6c}\u{32}\u{3a}\u{3a}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}\u{20}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{27}")
12+errmsg("\u{64}\u{6f}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{62}\u{2c}\u{20}\u{63}\u{63}\u{3b}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{3b}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{61}\u{a}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}\u{a}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{61}\u{61}\u{27}")
13+errmsg("\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
14+errmsg("\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{31}\u{20}\u{64}\u{6f}\u{20}\u{3a}\u{3a}\u{6c}\u{31}\u{3a}\u{3a}\u{20}\u{65}\u{6e}\u{64}\u{20}","\u{6c}\u{61}\u{62}\u{65}\u{6c}\u{20}\u{27}\u{6c}\u{31}\u{27}")
15+errmsg("\u{20}\u{20}\u{72}\u{65}\u{70}\u{65}\u{61}\u{74}\u{a}\u{20}\u{20}\u{20}\u{20}\u{69}\u{66}\u{20}\u{78}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{75}\u{78}\u{75}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{3a}\u{3a}\u{63}\u{6f}\u{6e}\u{74}\u{3a}\u{3a}\u{a}\u{20}\u{20}\u{75}\u{6e}\u{74}\u{69}\u{6c}\u{20}\u{78}\u{75}\u{78}\u{75}\u{20}\u{3c}\u{20}\u{78}\u{a}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{27}\u{78}\u{75}\u{78}\u{75}\u{27}")
16+local x
17+do
18+local y = 0xc
19+goto l1
20+::l2::
21+x=(x + 0x1)
22+;
23+goto l3
24+::l1::
25+x=y
26+;
27+goto l2
28+end
29+::l3::
30+::l3_1::
31+assert((x == 0xd))
32+do
33+local prog = "\u{20}\u{20}\u{64}\u{6f}\u{a}\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{25}\u{73}\u{61}\u{3b}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{3a}\u{3a}\u{6c}\u{25}\u{73}\u{61}\u{3a}\u{3a}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{67}\u{6f}\u{74}\u{6f}\u{20}\u{6c}\u{25}\u{73}\u{62}\u{3b}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{32}\u{a}\u{20}\u{20}\u{20}\u{3a}\u{3a}\u{6c}\u{25}\u{73}\u{62}\u{3a}\u{3a}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{32}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{a}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}"
34+local label = string.rep("\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x28)
35+prog=string.format(prog,label,label,label,label)
36+assert((assert(load(prog))() == 0x1f))
37+end
38+do
39+goto l1
40+local a = 0x17
41+x=a
42+::l1::
43+;
44+end
45+while true do
46+goto l4
47+goto l1
48+goto l1
49+local x = 0x2d
50+::l1::
51+;
52+;
53+;
54+end
55+::l4::
56+assert((x == 0xd))
57+if print then
58+goto l1
59+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}")
60+goto l2
61+local x
62+::l1::
63+;
64+::l2::
65+;
66+;
67+else
68+
69+end
70+local function foo
71+()
72+local a = {}
73+goto l3
74+::l1::
75+a[(# (a + 0x1))]=0x1
76+;
77+goto l2
78+;
79+::l2::
80+a[(# (a + 0x1))]=0x2
81+;
82+goto l5
83+;
84+::l3::
85+::l3a::
86+a[(# (a + 0x1))]=0x3
87+;
88+goto l1
89+;
90+::l4::
91+a[(# (a + 0x1))]=0x4
92+;
93+goto l6
94+;
95+::l5::
96+a[(# (a + 0x1))]=0x5
97+;
98+goto l4
99+;
100+::l6::
101+assert((((((a[0x1] == 0x3) and (a[0x2] == 0x1)) and (a[0x3] == 0x2)) and (a[0x4] == 0x5)) and (a[0x5] == 0x4)))
102+if (not a[0x6]) then
103+a[0x6]=true
104+;
105+goto l3a
106+end
107+end
108+::l6::
109+foo()
110+do
111+local x
112+::L1::
113+local y
114+assert((y == nil))
115+y=true
116+if (x == nil) then
117+x=0x1
118+goto L1
119+else
120+x=(x + 0x1)
121+end
122+assert(((x == 0x2) and (y == true)))
123+end
124+do
125+local first = true
126+local a = false
127+if true then
128+goto LBL
129+::loop::
130+a=true
131+::LBL::
132+if first then
133+first=false
134+goto loop
135+end
136+end
137+assert(a)
138+end
139+do
140+goto escape
141+::a::
142+goto a
143+::b::
144+goto c
145+::c::
146+goto b
147+end
148+::escape::
149+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
150+local function foo
151+()
152+local t = {}
153+do
154+local i = 0x1
155+local a,b,c,d
156+t[0x1]=function ()
157+return a,b,c,d
158+end
159+::l1::
160+local b
161+do
162+local c
163+t[(# (t + 0x1))]=function ()
164+return a,b,c,d
165+end
166+if (i > 0x2) then
167+goto l2
168+end
169+do
170+local d
171+t[(# (t + 0x1))]=function ()
172+return a,b,c,d
173+end
174+i=(i + 0x1)
175+local a
176+goto l1
177+end
178+end
179+end
180+::l2::
181+return t
182+end
183+local a = foo()
184+assert((# (a == 0x6)))
185+for i = 0x2, 0x6
186+do
187+assert((debug.upvalueid(a[0x1],0x1) == debug.upvalueid(a[i],0x1)))
188+end
189+for i = 0x2, 0x6
190+do
191+assert((debug.upvalueid(a[0x1],0x2) ~= debug.upvalueid(a[i],0x2)))
192+assert((debug.upvalueid(a[0x1],0x3) ~= debug.upvalueid(a[i],0x3)))
193+end
194+for i = 0x3, 0x5, 0x2
195+do
196+assert((debug.upvalueid(a[i],0x2) == debug.upvalueid(a[(i - 0x1)],0x2)))
197+assert((debug.upvalueid(a[i],0x3) == debug.upvalueid(a[(i - 0x1)],0x3)))
198+assert((debug.upvalueid(a[i],0x2) ~= debug.upvalueid(a[(i + 0x1)],0x2)))
199+assert((debug.upvalueid(a[i],0x3) ~= debug.upvalueid(a[(i + 0x1)],0x3)))
200+end
201+for i = 0x2, 0x6, 0x2
202+do
203+assert((debug.upvalueid(a[0x1],0x4) == debug.upvalueid(a[i],0x4)))
204+end
205+for i = 0x3, 0x5, 0x2
206+do
207+for j = 0x1, 0x6
208+do
209+assert(((debug.upvalueid(a[i],0x4) == debug.upvalueid(a[j],0x4)) == (i == j)))
210+end
211+end
212+local function testG
213+(a)
214+if (a == 0x1) then
215+goto l1
216+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
217+elseif (a == 0x2) then
218+goto l2
219+elseif (a == 0x3) then
220+goto l3
221+elseif (a == 0x4) then
222+goto l1
223+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
224+::l1::
225+a=(a + 0x1)
226+else
227+goto l4
228+::l4a::
229+a=(a * 0x2)
230+;
231+goto l4b
232+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
233+::l4::
234+goto l4a
235+error("\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{65}\u{76}\u{65}\u{72}\u{20}\u{62}\u{65}\u{20}\u{68}\u{65}\u{72}\u{65}\u{21}")
236+::l4b::
237+end
238+do
239+return a
240+end
241+::l2::
242+do
243+return "\u{32}"
244+end
245+::l3::
246+do
247+return "\u{33}"
248+end
249+::l1::
250+return "\u{31}"
251+end
252+assert((testG(0x1) == "\u{31}"))
253+assert((testG(0x2) == "\u{32}"))
254+assert((testG(0x3) == "\u{33}"))
255+assert((testG(0x4) == 0x5))
256+assert((testG(0x5) == 0xa))
257+do
258+local X
259+goto L1
260+::L2::
261+goto L3
262+::L1::
263+do
264+local a <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
265+X=true
266+end})
267+assert((X == nil))
268+if a then
269+goto L2
270+end
271+end
272+::L3::
273+assert((X == true))
274+end
275+print("\u{4f}\u{4b}")
desk/res/lua/cycled/heavy.luanew file+126
@@ -0,0 +1,126 @@
1+local function teststring
2+()
3+print("\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}")
4+do
5+local a = "\u{78}"
6+local st,msg = pcall(function ()
7+while true do
8+a=(a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. (a .. a)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
9+print(string.format("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{25}\u{64}\u{20}\u{62}\u{79}\u{74}\u{65}\u{73}",(# a)))
10+end
11+end)
12+assert((not (st and (string.find(msg,"\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}") or string.find(msg,"\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}")))))
13+print(("\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}" .. (# (a * 0x64))))
14+end
15+print("\u{2b}")
16+end
17+local function loadrep
18+(x,what)
19+local p = (0x1 << 0x14)
20+local s = string.rep(x,p)
21+local count = 0x0
22+local function f
23+()
24+count=(count + p)
25+if ((count % (0x80 * p)) == 0x0) then
26+io.stderr:write("\u{28}",(count // (0x2 ^ 0x14)),"\u{20}\u{4d}\u{29}")
27+end
28+return s
29+end
30+local st,msg = load(f,"\u{3d}\u{62}\u{69}\u{67}")
31+print("\u{a}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}",(collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") * 0x400))
32+msg=string.match(msg,"\u{5e}\u{5b}\u{5e}\u{a}\u{5d}\u{2b}")
33+print(string.format("\u{74}\u{6f}\u{74}\u{61}\u{6c}\u{3a}\u{20}\u{30}\u{78}\u{25}\u{78}\u{20}\u{25}\u{73}\u{20}\u{28}\u{27}\u{25}\u{73}\u{27}\u{29}",count,what,msg))
34+return st,msg
35+end
36+function controlstruct()
37+print("\u{63}\u{6f}\u{6e}\u{74}\u{72}\u{6f}\u{6c}\u{20}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{75}\u{72}\u{65}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}")
38+local lim = (((0x1 << 0x18) - 0x2) // 0x3)
39+local s = string.rep("\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{a}",lim)
40+s=("\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{74}\u{72}\u{75}\u{65}\u{20}\u{64}\u{6f}\u{20}" .. (s .. "\u{65}\u{6e}\u{64}"))
41+assert(load(s))
42+print(("\u{6f}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}" .. (lim .. "\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{73}")))
43+lim=(lim + 0x3)
44+s=string.rep("\u{61}\u{20}\u{3d}\u{20}\u{61}\u{20}\u{2b}\u{20}\u{31}\u{a}",lim)
45+s=("\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{74}\u{72}\u{75}\u{65}\u{20}\u{64}\u{6f}\u{20}" .. (s .. "\u{65}\u{6e}\u{64}"))
46+local st,msg = load(s)
47+assert((not (st and string.find(msg,"\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}"))))
48+print(msg)
49+end
50+function manylines()
51+print("\u{6c}\u{6f}\u{61}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{73}")
52+local st,msg = loadrep("\u{a}","\u{6c}\u{69}\u{6e}\u{65}\u{73}")
53+assert((not (st and string.find(msg,"\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{73}"))))
54+print("\u{2b}")
55+end
56+function hugeid()
57+print("\u{6c}\u{6f}\u{61}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{68}\u{75}\u{67}\u{65}\u{20}\u{69}\u{64}\u{65}\u{6e}\u{74}\u{69}\u{66}\u{69}\u{65}\u{72}")
58+local st,msg = loadrep("\u{61}","\u{63}\u{68}\u{61}\u{72}\u{73}")
59+assert((not (st and (string.find(msg,"\u{6c}\u{65}\u{78}\u{69}\u{63}\u{61}\u{6c}\u{20}\u{65}\u{6c}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}") or string.find(msg,"\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}")))))
60+print("\u{2b}")
61+end
62+function toomanyinst()
63+print("\u{6c}\u{6f}\u{61}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{63}\u{68}\u{75}\u{6e}\u{6b}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{69}\u{6e}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}")
64+local st,msg = loadrep("\u{61}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{20}","\u{69}\u{6e}\u{73}\u{74}\u{72}\u{75}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{73}")
65+print("\u{2b}")
66+end
67+local function loadrepfunc
68+(prefix,f)
69+local count = (- 0x1)
70+local function aux
71+()
72+count=(count + 0x1)
73+if (count == 0x0) then
74+return prefix
75+else
76+if ((count % 0x100000) == 0x0) then
77+io.stderr:write("\u{28}",(count // (0x2 ^ 0x14)),"\u{20}\u{4d}\u{29}")
78+end
79+return f(count)
80+end
81+end
82+local st,msg = load(aux,"\u{6b}")
83+print("\u{a}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}",(collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") * 0x400))
84+msg=string.match(msg,"\u{5e}\u{5b}\u{5e}\u{a}\u{5d}\u{2b}")
85+print("\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{3a}\u{20}",msg)
86+end
87+function toomanyconst()
88+print("\u{6c}\u{6f}\u{61}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{61}\u{6e}\u{74}\u{73}")
89+loadrepfunc("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{30}\u{2c}",function (n)
90+return string.char(0x22,(((n // (0x80 ^ 0x0)) & 0x7f) + 0x80),(((n // (0x80 ^ 0x1)) & 0x7f) + 0x80),(((n // (0x80 ^ 0x2)) & 0x7f) + 0x80),(((n // (0x80 ^ 0x3)) & 0x7f) + 0x80),(((n // (0x80 ^ 0x4)) & 0x7f) + 0x80),0x22,0x2c)
91+end)
92+end
93+function toomanystr()
94+local a = {}
95+local st,msg = pcall(function ()
96+for i = 0x1, math.huge
97+do
98+if ((i % 0x100000) == 0x0) then
99+io.stderr:write("\u{28}",(i // (0x2 ^ 0x14)),"\u{20}\u{4d}\u{29}")
100+end
101+a[i]=string.pack("\u{49}",i)
102+end
103+end)
104+local size = (# a)
105+a=collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}")
106+print("\u{a}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}",(a * 0x400))
107+print("\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{3a}",msg)
108+print("\u{73}\u{69}\u{7a}\u{65}\u{3a}",size)
109+end
110+function toomanyidx()
111+local a = {}
112+local st,msg = pcall(function ()
113+for i = 0x1, math.huge
114+do
115+if ((i % 0x100000) == 0x0) then
116+io.stderr:write("\u{28}",(i // (0x2 ^ 0x14)),"\u{20}\u{4d}\u{29}")
117+end
118+a[i]=i
119+end
120+end)
121+print("\u{a}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{3a}\u{20}",(collectgarbage("\u{63}\u{6f}\u{75}\u{6e}\u{74}") * 0x400))
122+print("\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{3a}\u{20}",msg)
123+print("\u{73}\u{69}\u{7a}\u{65}\u{3a}",(# a))
124+end
125+toomanyidx()
126+print("\u{4f}\u{4b}")
desk/res/lua/cycled/literals.luanew file+199
@@ -0,0 +1,199 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{63}\u{61}\u{6e}\u{6e}\u{65}\u{72}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+local function dostring
4+(x)
5+return assert(load(x),"")()
6+end
7+dostring("\u{78}\u{20}\u{b}\u{c}\u{20}\u{3d}\u{20}\u{9}\u{d}\u{20}\u{27}\u{61}\u{0}\u{61}\u{27}\u{20}\u{b}\u{c}\u{c}")
8+assert(((x == "\u{61}\u{0}\u{61}") and (string.len(x) == 0x3)))
9+_G.x=nil
10+assert(("\u{a}\u{22}\u{27}\u{5c}" == "\u{a}\u{22}\u{27}\u{5c}"))
11+assert(string.find("\u{7}\u{8}\u{c}\u{a}\u{d}\u{9}\u{b}","\u{5e}\u{25}\u{63}\u{25}\u{63}\u{25}\u{63}\u{25}\u{63}\u{25}\u{63}\u{25}\u{63}\u{25}\u{63}\u{24}"))
12+assert(("\u{63}\u{31}\u{32}" == "\u{63}\u{31}\u{32}"))
13+assert(("\u{63}\u{61}\u{62}" == "\u{63}\u{61}\u{62}"))
14+assert(("\u{63}" == "\u{63}"))
15+assert(("\u{63}\u{a}" == "\u{63}\u{a}"))
16+assert(("\u{0}\u{0}\u{0}\u{61}\u{6c}\u{6f}" == ("\u{0}" .. ("\u{0}\u{0}" .. "\u{61}\u{6c}\u{6f}"))))
17+assert((0xa .. (0x14 .. (- (0x1e == "\u{31}\u{30}\u{32}\u{30}\u{2d}\u{33}\u{30}")))))
18+assert(("\u{0}\u{5}\u{10}\u{1f}\u{3c}\u{ff}\u{e8}" == "\u{0}\u{5}\u{10}\u{1f}\u{3c}\u{ff}\u{e8}"))
19+local function lexstring
20+(x,y,n)
21+local f = assert(load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. (x .. "\u{2c}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{22}\u{64}\u{65}\u{62}\u{75}\u{67}\u{22}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{31}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}")),""))
22+local s,l = f()
23+assert(((s == y) and (l == n)))
24+end
25+lexstring("\u{27}\u{61}\u{62}\u{63}\u{5c}\u{7a}\u{20}\u{20}\u{a}\u{20}\u{20}\u{20}\u{65}\u{66}\u{67}\u{27}","\u{61}\u{62}\u{63}\u{65}\u{66}\u{67}",0x2)
26+lexstring("\u{27}\u{61}\u{62}\u{63}\u{5c}\u{7a}\u{20}\u{20}\u{a}\u{a}\u{a}\u{27}","\u{61}\u{62}\u{63}",0x4)
27+lexstring("\u{27}\u{5c}\u{7a}\u{20}\u{20}\u{a}\u{9}\u{c}\u{b}\u{a}\u{27}","",0x3)
28+lexstring("\u{5b}\u{5b}\u{a}\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}\u{a}\u{a}\u{5d}\u{5d}","\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}\u{a}\u{a}",0x5)
29+lexstring("\u{5b}\u{5b}\u{a}\u{61}\u{6c}\u{6f}\u{d}\u{61}\u{6c}\u{6f}\u{a}\u{a}\u{5d}\u{5d}","\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}\u{a}\u{a}",0x5)
30+lexstring("\u{5b}\u{5b}\u{a}\u{61}\u{6c}\u{6f}\u{d}\u{61}\u{6c}\u{6f}\u{d}\u{a}\u{5d}\u{5d}","\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}\u{a}",0x4)
31+lexstring("\u{5b}\u{5b}\u{d}\u{61}\u{6c}\u{6f}\u{a}\u{d}\u{61}\u{6c}\u{6f}\u{d}\u{a}\u{5d}\u{5d}","\u{61}\u{6c}\u{6f}\u{a}\u{61}\u{6c}\u{6f}\u{a}",0x4)
32+lexstring("\u{5b}\u{5b}\u{61}\u{6c}\u{6f}\u{5d}\u{a}\u{5d}\u{61}\u{6c}\u{6f}\u{5d}\u{5d}","\u{61}\u{6c}\u{6f}\u{5d}\u{a}\u{5d}\u{61}\u{6c}\u{6f}",0x2)
33+assert(("\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}\u{68}\u{69}" == "\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}\u{68}\u{69}"))
34+assert(("\u{0}\u{0}\u{0}\u{0}" == string.char(0x0,0x0,0x0,0x0)))
35+assert(("\u{0}\u{7f}" == "\u{0}\u{7f}"))
36+assert(("\u{80}\u{7ff}" == "\u{c2}\u{80}\u{df}\u{bf}"))
37+assert(("\u{800}\u{ffff}" == "\u{e0}\u{a0}\u{80}\u{ef}\u{bf}\u{bf}"))
38+assert(("\u{10000}\u{1fffff}" == "\u{f0}\u{90}\u{80}\u{80}\u{f7}\u{bf}\u{bf}\u{bf}"))
39+assert(("\u{200000}\u{3ffffff}" == "\u{f8}\u{88}\u{80}\u{80}\u{80}\u{fb}\u{bf}\u{bf}\u{bf}\u{bf}"))
40+assert(("\u{4000000}\u{7fffffff}" == "\u{fc}\u{84}\u{80}\u{80}\u{80}\u{80}\u{fd}\u{bf}\u{bf}\u{bf}\u{bf}\u{bf}"))
41+local function lexerror
42+(s,err)
43+local st,msg = load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. s),"")
44+if (err ~= "\u{3c}\u{65}\u{6f}\u{66}\u{3e}") then
45+err=(err .. "\u{27}")
46+end
47+assert((not (st and string.find(msg,("\u{6e}\u{65}\u{61}\u{72}\u{20}\u{2e}\u{2d}" .. err)))))
48+end
49+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{78}\u{22}","\u{5c}\u{78}\u{22}")
50+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{78}","\u{5c}\u{78}")
51+lexerror("\u{22}\u{5c}\u{78}","\u{5c}\u{78}")
52+lexerror("\u{22}\u{5c}\u{78}\u{35}\u{22}","\u{5c}\u{78}\u{35}\u{22}")
53+lexerror("\u{22}\u{5c}\u{78}\u{35}","\u{5c}\u{78}\u{35}")
54+lexerror("\u{22}\u{5c}\u{78}\u{72}\u{22}","\u{5c}\u{78}\u{72}")
55+lexerror("\u{22}\u{5c}\u{78}\u{72}","\u{5c}\u{78}\u{72}")
56+lexerror("\u{22}\u{5c}\u{78}\u{2e}","\u{5c}\u{78}\u{2e}")
57+lexerror("\u{22}\u{5c}\u{78}\u{38}\u{25}\u{22}","\u{5c}\u{78}\u{38}\u{25}\u{25}")
58+lexerror("\u{22}\u{5c}\u{78}\u{41}\u{47}","\u{5c}\u{78}\u{41}\u{47}")
59+lexerror("\u{22}\u{5c}\u{67}\u{22}","\u{5c}\u{67}")
60+lexerror("\u{22}\u{5c}\u{67}","\u{5c}\u{67}")
61+lexerror("\u{22}\u{5c}\u{2e}\u{22}","\u{5c}\u{25}\u{2e}")
62+lexerror("\u{22}\u{5c}\u{39}\u{39}\u{39}\u{22}","\u{5c}\u{39}\u{39}\u{39}\u{22}")
63+lexerror("\u{22}\u{78}\u{79}\u{7a}\u{5c}\u{33}\u{30}\u{30}\u{22}","\u{5c}\u{33}\u{30}\u{30}\u{22}")
64+lexerror("\u{22}\u{20}\u{20}\u{20}\u{5c}\u{32}\u{35}\u{36}\u{22}","\u{5c}\u{32}\u{35}\u{36}\u{22}")
65+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{7d}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}")
66+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{31}\u{31}\u{72}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{31}")
67+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{22}")
68+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}\u{72}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}\u{72}")
69+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}\u{22}")
70+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{31}\u{31}")
71+lexerror("\u{22}\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{72}\u{22}","\u{61}\u{62}\u{63}\u{5c}\u{75}\u{7b}\u{72}")
72+lexerror("\u{5b}\u{3d}\u{5b}\u{61}\u{6c}\u{6f}\u{5d}\u{5d}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
73+lexerror("\u{5b}\u{3d}\u{5b}\u{61}\u{6c}\u{6f}\u{5d}\u{3d}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
74+lexerror("\u{5b}\u{3d}\u{5b}\u{61}\u{6c}\u{6f}\u{5d}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
75+lexerror("\u{27}\u{61}\u{6c}\u{6f}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
76+lexerror("\u{27}\u{61}\u{6c}\u{6f}\u{20}\u{5c}\u{7a}\u{20}\u{20}\u{a}\u{a}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
77+lexerror("\u{27}\u{61}\u{6c}\u{6f}\u{20}\u{5c}\u{7a}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
78+lexerror("\u{27}\u{61}\u{6c}\u{6f}\u{20}\u{5c}\u{39}\u{38}","\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
79+for i = 0x0, 0xff
80+do
81+local s = string.char(i)
82+assert((not (string.find(s,"\u{5b}\u{61}\u{2d}\u{7a}\u{41}\u{2d}\u{5a}\u{5f}\u{5d}") == (not load((s .. "\u{3d}\u{31}"),"")))))
83+assert((not (string.find(s,"\u{5b}\u{61}\u{2d}\u{7a}\u{41}\u{2d}\u{5a}\u{5f}\u{30}\u{2d}\u{39}\u{5d}") == (not load(("\u{61}" .. (s .. "\u{31}\u{20}\u{3d}\u{20}\u{31}")),"")))))
84+end
85+local var1 = (string.rep("\u{61}",0x3a98) .. "\u{31}")
86+local var2 = (string.rep("\u{61}",0x3a98) .. "\u{32}")
87+local prog = string.format("\u{20}\u{20}\u{25}\u{73}\u{20}\u{3d}\u{20}\u{35}\u{a}\u{20}\u{20}\u{25}\u{73}\u{20}\u{3d}\u{20}\u{25}\u{73}\u{20}\u{2b}\u{20}\u{31}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{73}\u{20}\u{2d}\u{20}\u{25}\u{73}\u{20}\u{65}\u{6e}\u{64}\u{a}",var1,var2,var1,var1,var2)
88+local f = dostring(prog)
89+assert((((_G[var1] == 0x5) and (_G[var2] == 0x6)) and (f() == (- 0x1))))
90+_G[var1],_G[var2]=nil
91+print("\u{2b}")
92+assert(("\u{a}\u{9}" == "\u{a}\u{9}"))
93+assert(("\u{a}\u{20}\u{24}\u{64}\u{65}\u{62}\u{75}\u{67}" == "\u{a}\u{20}\u{24}\u{64}\u{65}\u{62}\u{75}\u{67}"))
94+assert(("\u{20}\u{5b}\u{20}" ~= "\u{20}\u{5d}\u{20}"))
95+local b = "\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
96+assert((string.len(b) == 0x3c0))
97+prog="\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{27}\u{2b}\u{27}\u{29}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{31}\u{20}\u{3d}\u{20}\u{5b}\u{5b}\u{22}\u{74}\u{68}\u{69}\u{73}\u{20}\u{69}\u{73}\u{20}\u{61}\u{20}\u{27}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{73}\u{65}\u{76}\u{65}\u{72}\u{61}\u{6c}\u{20}\u{27}\u{71}\u{75}\u{6f}\u{74}\u{65}\u{73}\u{27}\u{22}\u{5d}\u{5d}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{32}\u{20}\u{3d}\u{20}\u{22}\u{27}\u{71}\u{75}\u{6f}\u{74}\u{65}\u{73}\u{27}\u{22}\u{a}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{66}\u{69}\u{6e}\u{64}\u{28}\u{61}\u{31}\u{2c}\u{20}\u{61}\u{32}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{33}\u{34}\u{29}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{27}\u{2b}\u{27}\u{29}\u{a}\u{a}\u{61}\u{31}\u{20}\u{3d}\u{20}\u{5b}\u{3d}\u{3d}\u{5b}\u{74}\u{65}\u{6d}\u{70}\u{20}\u{3d}\u{20}\u{5b}\u{5b}\u{61}\u{6e}\u{20}\u{61}\u{72}\u{62}\u{69}\u{74}\u{72}\u{61}\u{72}\u{79}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{5d}\u{5d}\u{3b}\u{20}\u{5d}\u{3d}\u{3d}\u{5d}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{6c}\u{6f}\u{61}\u{64}\u{28}\u{61}\u{31}\u{29}\u{29}\u{28}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{74}\u{65}\u{6d}\u{70}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{61}\u{6e}\u{20}\u{61}\u{72}\u{62}\u{69}\u{74}\u{72}\u{61}\u{72}\u{79}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{27}\u{29}\u{a}\u{5f}\u{47}\u{2e}\u{74}\u{65}\u{6d}\u{70}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{2d}\u{2d}\u{20}\u{6c}\u{6f}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}\u{20}\u{2d}\u{2d}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{22}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{22}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{6c}\u{65}\u{6e}\u{28}\u{62}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{39}\u{36}\u{30}\u{29}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{27}\u{2b}\u{27}\u{29}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{5b}\u{5b}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{30}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{a}\u{5d}\u{5d}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{6c}\u{65}\u{6e}\u{28}\u{61}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{31}\u{38}\u{36}\u{33}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{73}\u{75}\u{62}\u{28}\u{61}\u{2c}\u{20}\u{31}\u{2c}\u{20}\u{34}\u{30}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{73}\u{75}\u{62}\u{28}\u{62}\u{2c}\u{20}\u{31}\u{2c}\u{20}\u{34}\u{30}\u{29}\u{29}\u{a}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{a}"
98+print("\u{2b}")
99+_G.x=nil
100+dostring(prog)
101+assert(x)
102+_G.x=nil
103+do
104+local function getadd
105+(s)
106+return string.format("\u{25}\u{70}",s)
107+end
108+local s1 <const> = "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
109+local s2 <const> = "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
110+local s3 = "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
111+local function foo
112+()
113+return s1
114+end
115+local function foo1
116+()
117+return s3
118+end
119+local function foo2
120+()
121+return "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"
122+end
123+local a1 = getadd(s1)
124+assert((a1 == getadd(s2)))
125+assert((a1 == getadd(foo())))
126+assert((a1 == getadd(foo1())))
127+assert((a1 == getadd(foo2())))
128+local sd = ("\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}" .. "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}")
129+assert(((sd == s1) and (getadd(sd) ~= a1)))
130+end
131+prog="\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{31}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{61}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{32}\u{a}\u{a}\u{a}\u{78}\u{20}\u{3d}\u{20}\u{5b}\u{3d}\u{5b}\u{a}\u{68}\u{69}\u{a}\u{5d}\u{3d}\u{5d}\u{a}\u{79}\u{20}\u{3d}\u{20}\u{22}\u{5c}\u{a}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{5c}\u{72}\u{5c}\u{6e}\u{5c}\u{a}\u{22}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{22}\u{64}\u{65}\u{62}\u{75}\u{67}\u{22}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{31}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{a}"
132+for _,n in pairs({"\u{a}","\u{d}","\u{a}\u{d}","\u{d}\u{a}"})
133+do
134+local prog,nn = string.gsub(prog,"\u{a}",n)
135+assert((dostring(prog) == nn))
136+assert(((_G.x == "\u{68}\u{69}\u{a}") and (_G.y == "\u{a}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{d}\u{a}\u{a}")))
137+end
138+_G.x,_G.y=nil
139+local a = "\u{5d}\u{3d}"
140+assert((a == "\u{5d}\u{3d}"))
141+a="\u{5b}\u{3d}\u{3d}\u{3d}\u{5b}\u{5b}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{5d}\u{5b}\u{3d}\u{3d}\u{3d}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{3d}\u{3d}\u{5d}\u{3d}\u{3d}\u{3d}"
142+assert((a == "\u{5b}\u{3d}\u{3d}\u{3d}\u{5b}\u{5b}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{5d}\u{5b}\u{3d}\u{3d}\u{3d}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{3d}\u{3d}\u{5d}\u{3d}\u{3d}\u{3d}"))
143+a="\u{5b}\u{3d}\u{3d}\u{3d}\u{5b}\u{5b}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{5d}\u{5b}\u{3d}\u{3d}\u{3d}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{3d}\u{3d}\u{5d}\u{3d}\u{3d}\u{3d}"
144+assert((a == "\u{5b}\u{3d}\u{3d}\u{3d}\u{5b}\u{5b}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{5d}\u{5b}\u{3d}\u{3d}\u{3d}\u{3d}\u{5b}\u{5d}\u{5d}\u{3d}\u{3d}\u{3d}\u{5d}\u{3d}\u{3d}\u{3d}"))
145+a="\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}"
146+assert((a == "\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}\u{5d}"))
147+local x = {"\u{3d}","\u{5b}","\u{5d}","\u{a}"}
148+local len = 0x4
149+local function gen
150+(c,n)
151+if (n == 0x0) then
152+coroutine.yield(c)
153+else
154+for _,a in pairs(x)
155+do
156+gen((c .. a),(n - 0x1))
157+end
158+end
159+end
160+for s in coroutine.wrap(function ()
161+gen("",len)
162+end)
163+do
164+assert((s == load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{5b}\u{3d}\u{3d}\u{3d}\u{3d}\u{5b}\u{a}" .. (s .. "\u{5d}\u{3d}\u{3d}\u{3d}\u{3d}\u{5d}")),"")()))
165+end
166+if (os.setlocale("\u{70}\u{74}\u{5f}\u{42}\u{52}") or os.setlocale("\u{70}\u{74}\u{62}")) then
167+assert(((tonumber("\u{33}\u{2c}\u{34}") == 3.4) and (tonumber("\u{33}\u{2e}\u{34}") == 3.4)))
168+assert((tonumber("\u{20}\u{20}\u{2d}\u{2e}\u{34}\u{20}\u{20}") == (- 0.4)))
169+assert((tonumber("\u{20}\u{20}\u{2b}\u{30}\u{78}\u{2e}\u{34}\u{31}\u{20}\u{20}") == 0.25390625))
170+assert((not load("\u{61}\u{20}\u{3d}\u{20}\u{28}\u{33}\u{2c}\u{34}\u{29}")))
171+assert((assert(load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{33}\u{2e}\u{34}"))() == 3.4))
172+assert((assert(load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2e}\u{34}\u{2c}\u{33}"))() == 0.4))
173+assert((assert(load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{34}\u{2e}"))() == 4.0))
174+assert((assert(load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{34}\u{2e}\u{2b}\u{2e}\u{35}"))() == 4.5))
175+assert(((("\u{20}\u{30}\u{78}\u{2e}\u{31}\u{20}" + "\u{20}\u{30}\u{78}\u{2c}\u{31}") + "\u{2d}\u{30}\u{58}\u{2e}\u{31}\u{9}") == 0.0625))
176+assert((not (tonumber("\u{69}\u{6e}\u{66}") and (not tonumber("\u{4e}\u{41}\u{4e}")))))
177+assert((assert(load(string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{71}",4.51)))() == 4.51))
178+local a,b = load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{34}\u{2e}\u{35}\u{2e}")
179+assert(string.find(b,"\u{27}\u{34}\u{25}\u{2e}\u{35}\u{25}\u{2e}\u{27}"))
180+assert(os.setlocale("\u{43}"))
181+else
182+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{70}\u{74}\u{5f}\u{42}\u{52}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{65}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{76}\u{61}\u{69}\u{6c}\u{61}\u{62}\u{6c}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{64}\u{65}\u{63}\u{69}\u{6d}\u{61}\u{6c}\u{20}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
183+end
184+local s = "\u{61}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{d}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{a}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{d}\u{a}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{a}\u{d}"
185+local c = string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{71}",s)
186+assert((assert(load(c))() == s))
187+assert((not load("\u{61}\u{20}\u{3d}\u{20}\u{27}\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{6e}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")))
188+assert((not load("\u{61}\u{20}\u{3d}\u{20}\u{27}\u{6e}\u{6f}\u{6e}\u{2d}\u{65}\u{6e}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{a}\u{27}")))
189+assert((not load("\u{61}\u{20}\u{3d}\u{20}\u{27}\u{5c}\u{33}\u{34}\u{35}\u{27}")))
190+assert((not load("\u{61}\u{20}\u{3d}\u{20}\u{5b}\u{3d}\u{78}\u{5d}")))
191+local function malformednum
192+(n,exp)
193+local s,msg = load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. n))
194+assert((not (s and string.find(msg,exp))))
195+end
196+malformednum("\u{30}\u{78}\u{65}\u{2d}","\u{6e}\u{65}\u{61}\u{72}\u{20}\u{3c}\u{65}\u{6f}\u{66}\u{3e}")
197+malformednum("\u{30}\u{78}\u{65}\u{70}\u{2d}\u{70}","\u{6d}\u{61}\u{6c}\u{66}\u{6f}\u{72}\u{6d}\u{65}\u{64}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")
198+malformednum("\u{31}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{29}","\u{6d}\u{61}\u{6c}\u{66}\u{6f}\u{72}\u{6d}\u{65}\u{64}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")
199+print("\u{4f}\u{4b}")
desk/res/lua/cycled/locals.luanew file+1050
@@ -0,0 +1,1050 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{65}\u{6e}\u{76}\u{69}\u{72}\u{6f}\u{6e}\u{6d}\u{65}\u{6e}\u{74}\u{73}")
2+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
3+local tracegc = require("\u{74}\u{72}\u{61}\u{63}\u{65}\u{67}\u{63}")
4+local function f
5+(x)
6+x=nil
7+;
8+return x
9+end
10+assert((f(0xa) == nil))
11+local function f
12+()
13+local x
14+;
15+return x
16+end
17+assert((f(0xa) == nil))
18+local function f
19+(x)
20+x=nil
21+;
22+local y
23+;
24+return x,y
25+end
26+assert(((f(0xa) == nil) and (select(0x2,f(0x14)) == nil)))
27+do
28+local i = 0xa
29+do
30+local i = 0x64
31+;
32+assert((i == 0x64))
33+end
34+do
35+local i = 0x3e8
36+;
37+assert((i == 0x3e8))
38+end
39+assert((i == 0xa))
40+if (i ~= 0xa) then
41+local i = 0x14
42+else
43+local i = 0x1e
44+assert((i == 0x1e))
45+end
46+end
47+f=nil
48+local f
49+local x = 0x1
50+a=nil
51+load("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{7b}\u{7d}")()
52+assert((a == nil))
53+function f(a)
54+local _1,_2,_3,_4,_5
55+local _6,_7,_8,_9,_10
56+local x = 0x3
57+local b = a
58+local c,d = a,b
59+if (d == b) then
60+local x = "\u{71}"
61+x=b
62+assert((x == 0x2))
63+else
64+assert(nil)
65+end
66+assert((x == 0x3))
67+local f = 0xa
68+end
69+local b = 0xa
70+local a
71+;
72+repeat
73+local b
74+;
75+a,b=0x1,0x2
76+;
77+assert(((a + 0x1) == b))
78+;
79+until ((a + b) == 0x3)
80+assert((x == 0x1))
81+f(0x2)
82+assert((type(f) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}"))
83+local function getenv
84+(f)
85+local a,b = debug.getupvalue(f,0x1)
86+assert((a == "\u{5f}\u{45}\u{4e}\u{56}"))
87+return b
88+end
89+assert((getenv(load("\u{61}\u{3d}\u{33}")) == _G))
90+local c = {}
91+;
92+local f = load("\u{61}\u{20}\u{3d}\u{20}\u{33}",nil,nil,c)
93+assert((getenv(f) == c))
94+assert((c.a == nil))
95+f()
96+assert((c.a == 0x3))
97+do
98+local i = 0x2
99+local p = 0x4
100+repeat
101+for j = (- 0x3), 0x3
102+do
103+assert(load(string.format("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3d}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{3d}\u{61}\u{2b}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{20}\u{3d}\u{3d}\u{32}\u{5e}\u{25}\u{73}\u{29}",j,(p - j),i),""))()
104+assert(load(string.format("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{3d}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{3d}\u{61}\u{2d}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{3d}\u{3d}\u{2d}\u{32}\u{5e}\u{25}\u{73}\u{29}",(- j),(p - j),i),""))()
105+assert(load(string.format("\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{3d}\u{30}\u{2c}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{3d}\u{62}\u{2d}\u{25}\u{73}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{3d}\u{3d}\u{2d}\u{32}\u{5e}\u{25}\u{73}\u{29}",(- j),(p - j),i),""))()
106+end
107+p=(0x2 * p)
108+;
109+i=(i + 0x1)
110+until (p <= 0x0)
111+end
112+print("\u{2b}")
113+if rawget(_G,"\u{54}") then
114+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
115+local a = {[{}] = 0x4,[0x3] = 0x0,["\u{61}\u{6c}\u{6f}"] = 0x1,["\u{61}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}"] = 0xa}
116+local t = T.querytab(a)
117+for k,_ in pairs(a)
118+do
119+a[k]=undef
120+end
121+collectgarbage()
122+for i = 0x0, (t - 0x1)
123+do
124+local k = querytab(a,i)
125+assert((((k == nil) or (type(k) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}")) or (k == "\u{61}\u{6c}\u{6f}")))
126+end
127+local a = {}
128+local function additems
129+()
130+a.x=true
131+;
132+a.y=true
133+;
134+a.z=true
135+a[0x1]=true
136+a[0x2]=true
137+end
138+for i = 0x1, math.huge
139+do
140+T.alloccount(i)
141+local st,msg = pcall(additems)
142+T.alloccount()
143+local count = 0x0
144+for k,v in pairs(a)
145+do
146+assert((a[k] == v))
147+count=(count + 0x1)
148+end
149+if st then
150+assert((count == 0x5))
151+;
152+break
153+end
154+end
155+end
156+assert((_ENV == _G))
157+do
158+local dummy
159+local _ENV = (function (...)
160+return ...
161+end)(_G,dummy)
162+do
163+local _ENV = {["\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}"] = assert}
164+;
165+assert(true)
166+end
167+local mt = {["\u{5f}\u{47}"] = _G}
168+local foo,x
169+A=false
170+do
171+local _ENV = mt
172+function foo(x)
173+A=x
174+do
175+local _ENV = _G
176+;
177+A=0x3e8
178+end
179+return function (x)
180+return (A .. x)
181+end
182+end
183+end
184+assert((getenv(foo) == mt))
185+x=foo("\u{68}\u{69}")
186+;
187+assert(((mt.A == "\u{68}\u{69}") and (A == 0x3e8)))
188+assert((x("\u{2a}") == (mt.A .. "\u{2a}")))
189+do
190+local _ENV = {["\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}"] = assert,["\u{41}"] = 0xa}
191+;
192+do
193+local _ENV = {["\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}"] = assert,["\u{41}"] = 0x14}
194+;
195+assert((A == 0x14))
196+;
197+x=A
198+end
199+assert(((A == 0xa) and (x == 0x14)))
200+end
201+assert((x == 0x14))
202+A=nil
203+do
204+local a <const>,b,c <const> = 0xa,0x14,0x1e
205+b=((a + c) + b)
206+assert((((a == 0xa) and (b == 0x3c)) and (c == 0x1e)))
207+local function checkro
208+(name,code)
209+local st,msg = load(code)
210+local gab = string.format("\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{61}\u{73}\u{73}\u{69}\u{67}\u{6e}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{27}\u{25}\u{73}\u{27}",name)
211+assert((not (st and string.find(msg,gab))))
212+end
213+checkro("\u{79}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{2c}\u{20}\u{79}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{2c}\u{20}\u{7a}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{2c}\u{20}\u{32}\u{30}\u{2c}\u{20}\u{33}\u{30}\u{3b}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{31}\u{3b}\u{20}\u{79}\u{20}\u{3d}\u{20}\u{31}\u{32}")
214+checkro("\u{78}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{2c}\u{20}\u{79}\u{2c}\u{20}\u{7a}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{2c}\u{20}\u{32}\u{30}\u{2c}\u{20}\u{33}\u{30}\u{3b}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{31}\u{31}")
215+checkro("\u{7a}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{2c}\u{20}\u{79}\u{2c}\u{20}\u{7a}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{2c}\u{20}\u{32}\u{30}\u{2c}\u{20}\u{33}\u{30}\u{3b}\u{20}\u{79}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{7a}\u{20}\u{3d}\u{20}\u{31}\u{31}")
216+checkro("\u{66}\u{6f}\u{6f}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{20}\u{65}\u{6e}\u{64}")
217+checkro("\u{66}\u{6f}\u{6f}","\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{6f}\u{6f}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{7b}\u{7d}\u{3b}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{20}\u{65}\u{6e}\u{64}")
218+checkro("\u{7a}","\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{20}\u{7a}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{2c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{7a}\u{20}\u{3d}\u{20}\u{33}\u{32}\u{3b}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}")
219+checkro("\u{76}\u{61}\u{72}\u{31}","\u{20}\u{20}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{20}\u{76}\u{61}\u{72}\u{31}\u{20}\u{3c}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{3e}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{3b}\u{a}\u{20}\u{20}\u{20}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{6f}\u{6f}\u{28}\u{29}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{30}\u{3b}\u{20}\u{7a}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{76}\u{61}\u{72}\u{31}\u{20}\u{3d}\u{20}\u{31}\u{32}\u{3b}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}")
220+end
221+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}")
222+local function stack
223+(n)
224+n=((n == 0x0) or stack((n - 0x1)))
225+end
226+local function func2close
227+(f,x,y)
228+local obj = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = f})
229+if x then
230+return x,obj,y
231+else
232+return obj
233+end
234+end
235+do
236+local a = {}
237+do
238+local b <close> = false
239+local x <close> = setmetatable({"\u{78}"},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function (self)
240+a[(# (a + 0x1))]=self[0x1]
241+end})
242+local w,y <close>,z = func2close(function (self,err)
243+assert((err == nil))
244+;
245+a[(# (a + 0x1))]="\u{79}"
246+end,0xa,0x14)
247+local c <close> = nil
248+a[(# (a + 0x1))]="\u{69}\u{6e}"
249+assert(((w == 0xa) and (z == 0x14)))
250+end
251+a[(# (a + 0x1))]="\u{6f}\u{75}\u{74}"
252+assert(((((a[0x1] == "\u{69}\u{6e}") and (a[0x2] == "\u{79}")) and (a[0x3] == "\u{78}")) and (a[0x4] == "\u{6f}\u{75}\u{74}")))
253+end
254+do
255+local X = false
256+local x,closescope = func2close(function (_,msg)
257+stack(0xa)
258+;
259+assert((msg == nil))
260+X=true
261+end,0x64)
262+assert((x == 0x64))
263+;
264+x=0x65
265+;
266+local function foo
267+(x)
268+local _ <close> = closescope
269+return x,X,0x17
270+end
271+local a,b,c = foo(1.5)
272+assert(((((a == 1.5) and (b == false)) and (c == 0x17)) and (X == true)))
273+X=false
274+foo=function (x)
275+local _ <close> = func2close(function (_,msg)
276+assert((debug.getinfo(0x2).name == "\u{66}\u{6f}\u{6f}"))
277+assert((msg == nil))
278+end)
279+local _ <close> = closescope
280+local y = 0xf
281+return y
282+end
283+assert(((foo() == 0xf) and (X == true)))
284+X=false
285+foo=function ()
286+local x <close> = closescope
287+return x
288+end
289+assert(((foo() == closescope) and (X == true)))
290+end
291+do
292+local flag = false
293+local x = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
294+assert((flag == false))
295+;
296+flag=true
297+end})
298+local y <const> = nil
299+local z <const> = nil
300+do
301+local a <close> = x
302+end
303+assert(flag)
304+end
305+do
306+local flag = false
307+local x = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
308+assert((flag == false))
309+;
310+flag=true
311+end})
312+local function a
313+()
314+return function ()
315+return nil
316+end,nil,nil,x
317+end
318+local v <const> = 0x1
319+local w <const> = 0x1
320+local x <const> = 0x1
321+local y <const> = 0x1
322+local z <const> = 0x1
323+for k in a()
324+do
325+a=k
326+end
327+assert(flag)
328+end
329+do
330+local X,Y
331+local function foo
332+()
333+local _ <close> = func2close(function ()
334+Y=0xa
335+end)
336+assert(((X == true) and (Y == nil)))
337+return 0x1,0x2,0x3
338+end
339+local function bar
340+()
341+local _ <close> = func2close(function ()
342+X=false
343+end)
344+X=true
345+do
346+return foo()
347+end
348+end
349+local a,b,c,d = bar()
350+assert(((((((a == 0x1) and (b == 0x2)) and (c == 0x3)) and (X == false)) and (Y == 0xa)) and (d == nil)))
351+end
352+do
353+local closed = false
354+local function foo
355+()
356+return function ()
357+return true
358+end,0x0,0x0,func2close(function ()
359+closed=true
360+end)
361+end
362+local function tail
363+()
364+return closed
365+end
366+local function foo1
367+()
368+for k in foo()
369+do
370+return tail()
371+end
372+end
373+assert((foo1() == false))
374+assert((closed == true))
375+end
376+do
377+local closed = false
378+local o1 = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
379+closed=true
380+end})
381+local function test
382+()
383+for k,v in next,{},nil,o1
384+do
385+local function f
386+()
387+return k
388+end
389+break
390+end
391+assert(closed)
392+end
393+test()
394+end
395+do
396+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}")
397+local function foo
398+()
399+local x <close> = func2close(function (self,msg)
400+assert(string.find(msg,"\u{40}\u{79}"))
401+error("\u{40}\u{78}")
402+end)
403+local x1 <close> = func2close(function (self,msg)
404+assert(string.find(msg,"\u{40}\u{79}"))
405+end)
406+local gc <close> = func2close(function ()
407+collectgarbage()
408+end)
409+local y <close> = func2close(function (self,msg)
410+assert(string.find(msg,"\u{40}\u{7a}"))
411+error("\u{40}\u{79}")
412+end)
413+local z <close> = func2close(function (self,msg)
414+assert((msg == nil))
415+error("\u{40}\u{7a}")
416+end)
417+return 0xc8
418+end
419+local stat,msg = pcall(foo,false)
420+assert(string.find(msg,"\u{40}\u{78}"))
421+local function foo
422+()
423+local x <close> = func2close(function (self,msg)
424+assert((debug.getinfo(0x2).name == "\u{70}\u{63}\u{61}\u{6c}\u{6c}"))
425+assert(string.find(msg,"\u{40}\u{78}\u{31}"))
426+end)
427+local x1 <close> = func2close(function (self,msg)
428+assert((debug.getinfo(0x2).name == "\u{70}\u{63}\u{61}\u{6c}\u{6c}"))
429+assert(string.find(msg,"\u{40}\u{79}"))
430+error("\u{40}\u{78}\u{31}")
431+end)
432+local gc <close> = func2close(function ()
433+collectgarbage()
434+end)
435+local y <close> = func2close(function (self,msg)
436+assert((debug.getinfo(0x2).name == "\u{70}\u{63}\u{61}\u{6c}\u{6c}"))
437+assert(string.find(msg,"\u{40}\u{7a}"))
438+error("\u{40}\u{79}")
439+end)
440+local first = true
441+local z <close> = func2close(function (self,msg)
442+assert((debug.getinfo(0x2).name == "\u{70}\u{63}\u{61}\u{6c}\u{6c}"))
443+assert((first and (msg == 0x4)))
444+first=false
445+error("\u{40}\u{7a}")
446+end)
447+error(0x4)
448+end
449+local stat,msg = pcall(foo,true)
450+assert(string.find(msg,"\u{40}\u{78}\u{31}"))
451+local function foo
452+(...)
453+do
454+local x1 <close> = func2close(function (self,msg)
455+assert(string.find(msg,"\u{40}\u{58}"))
456+error("\u{40}\u{59}")
457+end)
458+local x123 <close> = func2close(function (_,msg)
459+assert((msg == nil))
460+error("\u{40}\u{58}")
461+end)
462+end
463+os.exit(false)
464+end
465+local st,msg = xpcall(foo,debug.traceback)
466+assert(string.match(msg,"\u{5e}\u{5b}\u{5e}\u{20}\u{5d}\u{2a}\u{20}\u{40}\u{59}"))
467+local function foo
468+(...)
469+local x123 <close> = func2close(function ()
470+error("\u{40}\u{78}\u{31}\u{32}\u{33}")
471+end)
472+end
473+local st,msg = xpcall(foo,debug.traceback)
474+assert(string.match(msg,"\u{5e}\u{5b}\u{5e}\u{20}\u{5d}\u{2a}\u{20}\u{40}\u{78}\u{31}\u{32}\u{33}"))
475+assert(string.find(msg,"\u{69}\u{6e}\u{20}\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{27}"))
476+end
477+do
478+local function foo
479+()
480+local x <close> = {}
481+os.exit(false)
482+end
483+local stat,msg = pcall(foo)
484+assert((not (stat and string.find(msg,"\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{27}\u{78}\u{27}\u{20}\u{67}\u{6f}\u{74}\u{20}\u{61}\u{20}\u{6e}\u{6f}\u{6e}\u{25}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}"))))
485+local function foo
486+()
487+local xyz <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = print})
488+getmetatable(xyz).__close=nil
489+end
490+local stat,msg = pcall(foo)
491+assert((not (stat and string.find(msg,"\u{6d}\u{65}\u{74}\u{61}\u{6d}\u{65}\u{74}\u{68}\u{6f}\u{64}\u{20}\u{27}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{27}"))))
492+local function foo
493+()
494+local a1 <close> = func2close(function (_,msg)
495+assert(string.find(msg,"\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}"))
496+error(0xc)
497+end)
498+local a2 <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = print})
499+local a3 <close> = func2close(function (_,msg)
500+assert((msg == nil))
501+error(0x7b)
502+end)
503+getmetatable(a2).__close=0x4
504+end
505+local stat,msg = pcall(foo)
506+assert((not (stat and (msg == 0xc))))
507+end
508+do
509+local track = {}
510+local function foo
511+()
512+local x <close> = func2close(function ()
513+local xx <close> = func2close(function (_,msg)
514+assert((msg == nil))
515+track[(# (track + 0x1))]="\u{78}\u{78}"
516+end)
517+track[(# (track + 0x1))]="\u{78}"
518+end)
519+track[(# (track + 0x1))]="\u{66}\u{6f}\u{6f}"
520+return 0x14,0x1e,0x28
521+end
522+local a,b,c,d = foo()
523+assert(((((a == 0x14) and (b == 0x1e)) and (c == 0x28)) and (d == nil)))
524+assert((((track[0x1] == "\u{66}\u{6f}\u{6f}") and (track[0x2] == "\u{78}")) and (track[0x3] == "\u{78}\u{78}")))
525+local track = {}
526+local function foo
527+()
528+local x0 <close> = func2close(function (_,msg)
529+assert((msg == 0xca))
530+track[(# (track + 0x1))]="\u{78}\u{30}"
531+end)
532+local x <close> = func2close(function ()
533+local xx <close> = func2close(function (_,msg)
534+assert((msg == 0x65))
535+track[(# (track + 0x1))]="\u{78}\u{78}"
536+error(0xca)
537+end)
538+track[(# (track + 0x1))]="\u{78}"
539+error(0x65)
540+end)
541+track[(# (track + 0x1))]="\u{66}\u{6f}\u{6f}"
542+return 0x14,0x1e,0x28
543+end
544+local st,msg = pcall(foo)
545+assert((not (st and (msg == 0xca))))
546+assert(((((track[0x1] == "\u{66}\u{6f}\u{6f}") and (track[0x2] == "\u{78}")) and (track[0x3] == "\u{78}\u{78}")) and (track[0x4] == "\u{78}\u{30}")))
547+end
548+local function checktable
549+(t1,t2)
550+assert((# (t1 == (# t2))))
551+for i = 0x1, (# t1)
552+do
553+assert((t1[i] == t2[i]))
554+end
555+end
556+do
557+local function overflow
558+(n)
559+overflow((n + 0x1))
560+end
561+local function errorh
562+(m)
563+assert(string.find(m,"\u{73}\u{74}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}"))
564+local x <close> = func2close(function (o)
565+o[0x1]=0xa
566+end)
567+return x
568+end
569+local flag
570+local st,obj
571+local co = coroutine.wrap(function ()
572+local y <close> = func2close(function (obj,msg)
573+assert((msg == nil))
574+obj[0x1]=0x64
575+flag=obj
576+end)
577+tracegc.stop()
578+st,obj=xpcall(overflow,errorh,0x0)
579+tracegc.start()
580+end)
581+co()
582+assert((not ((st and (obj[0x1] == 0xa)) and (flag[0x1] == 0x64))))
583+end
584+if rawget(_G,"\u{54}") then
585+do
586+collectgarbage()
587+;
588+collectgarbage()
589+;
590+collectgarbage()
591+local function loop
592+(n)
593+if (n < 0x190) then
594+loop((n + 0x1))
595+end
596+end
597+local o = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
598+loop(0x0)
599+end})
600+local script = "\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{32}\u{3b}\u{20}\u{73}\u{65}\u{74}\u{74}\u{6f}\u{70}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}"
601+assert((T.testC(script,o) == script))
602+end
603+local function foo
604+()
605+local y <close> = func2close(function ()
606+T.alloccount()
607+end)
608+local x <close> = setmetatable({},{["\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}"] = function ()
609+T.alloccount(0x0)
610+;
611+local x = {}
612+end})
613+error(0x3e8)
614+end
615+stack(0x5)
616+local _,msg = pcall(foo)
617+assert((msg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}"))
618+local closemsg
619+local close = func2close(function (self,msg)
620+T.alloccount()
621+closemsg=msg
622+end)
623+local function enter
624+(count)
625+stack(0xa)
626+T.alloccount(count)
627+closemsg=nil
628+return close
629+end
630+local function test
631+()
632+local x <close> = enter(0x0)
633+local y = {}
634+end
635+local _,msg = pcall(test)
636+assert(((msg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}") and (closemsg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}")))
637+local function test
638+()
639+local xxx <close> = func2close(function (self,msg)
640+assert((msg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}"))
641+;
642+error(0x3e8)
643+end)
644+local xx <close> = func2close(function (self,msg)
645+assert((msg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}"))
646+;
647+end)
648+local x <close> = enter(0x0)
649+local y = {}
650+end
651+local _,msg = pcall(test)
652+assert(((msg == 0x3e8) and (closemsg == "\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}")))
653+do
654+collectgarbage()
655+local s = string.rep("\u{61}",0x2710)
656+local m = T.totalmem()
657+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
658+s=string.upper(s)
659+assert(((T.totalmem() - m) <= 0x2af8))
660+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
661+end
662+do
663+local lim = 0x2710
664+local extra = 0x7d0
665+local s = string.rep("\u{61}",lim)
666+local a = {s,s}
667+collectgarbage()
668+;
669+collectgarbage()
670+local m = T.totalmem()
671+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
672+T.totalmem((m + extra))
673+assert((not pcall(table.concat,a)))
674+assert(((T.totalmem() - m) <= extra))
675+T.totalmem(((m + lim) + extra))
676+assert((not pcall(table.concat,a)))
677+assert(((T.totalmem() - m) <= extra))
678+T.totalmem(((m + (0x2 * lim)) + extra))
679+assert((not pcall(table.concat,a)))
680+assert(((T.totalmem() - m) <= extra))
681+T.totalmem(((m + (0x4 * lim)) + extra))
682+assert((# (table.concat(a) == (0x2 * lim))))
683+T.totalmem(0x0)
684+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
685+print("\u{2b}")
686+end
687+do
688+local trace = {}
689+local function hook
690+(event)
691+trace[(# (trace + 0x1))]=(event .. ("\u{20}" .. (debug.getinfo(0x2).name or "\u{3f}")))
692+end
693+local x = func2close(function (_,msg)
694+trace[(# (trace + 0x1))]="\u{78}"
695+end)
696+local y = func2close(function (_,msg)
697+trace[(# (trace + 0x1))]="\u{79}"
698+end)
699+debug.sethook(hook,"\u{72}")
700+local t = {T.testC("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{32}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{78}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{6e}\u{75}\u{6d}\u{20}\u{31}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{75}\u{73}\u{68}\u{69}\u{6e}\u{74}\u{20}\u{32}\u{30}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{33}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{23}\u{20}\u{79}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}",x,y)}
701+debug.sethook()
702+checktable(trace,{"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{65}\u{74}\u{68}\u{6f}\u{6f}\u{6b}","\u{79}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{3f}","\u{78}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{3f}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}"})
703+checktable(t,{0xa,0x14})
704+end
705+end
706+do
707+local trace = {}
708+local function hook
709+(event)
710+trace[(# (trace + 0x1))]=(event .. ("\u{20}" .. debug.getinfo(0x2).name))
711+end
712+local function foo
713+(...)
714+local x <close> = func2close(function (_,msg)
715+trace[(# (trace + 0x1))]="\u{78}"
716+end)
717+local y <close> = func2close(function (_,msg)
718+debug.sethook(hook,"\u{72}")
719+end)
720+return ...
721+end
722+local t = {foo(0xa,0x14,0x1e)}
723+debug.sethook()
724+checktable(t,{0xa,0x14,0x1e})
725+checktable(trace,{"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{73}\u{65}\u{74}\u{68}\u{6f}\u{6f}\u{6b}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}","\u{78}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{6f}\u{6f}"})
726+end
727+print("\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}")
728+do
729+local trace = {}
730+local co = coroutine.wrap(function ()
731+trace[(# (trace + 0x1))]="\u{6e}\u{6f}\u{77}\u{58}"
732+local x <close> = func2close(function (_,msg)
733+assert((msg == nil))
734+trace[(# (trace + 0x1))]="\u{78}\u{31}"
735+coroutine.yield("\u{78}")
736+trace[(# (trace + 0x1))]="\u{78}\u{32}"
737+end)
738+return pcall(function ()
739+do
740+local z <close> = func2close(function (_,msg)
741+assert((msg == nil))
742+trace[(# (trace + 0x1))]="\u{7a}\u{31}"
743+coroutine.yield("\u{7a}")
744+trace[(# (trace + 0x1))]="\u{7a}\u{32}"
745+end)
746+end
747+trace[(# (trace + 0x1))]="\u{6e}\u{6f}\u{77}\u{59}"
748+local y <close> = func2close(function (_,msg)
749+assert((msg == nil))
750+trace[(# (trace + 0x1))]="\u{79}\u{31}"
751+coroutine.yield("\u{79}")
752+trace[(# (trace + 0x1))]="\u{79}\u{32}"
753+end)
754+return 0xa,0x14,0x1e
755+end)
756+end)
757+assert((co() == "\u{7a}"))
758+assert((co() == "\u{79}"))
759+assert((co() == "\u{78}"))
760+checktable({co()},{true,0xa,0x14,0x1e})
761+checktable(trace,{"\u{6e}\u{6f}\u{77}\u{58}","\u{7a}\u{31}","\u{7a}\u{32}","\u{6e}\u{6f}\u{77}\u{59}","\u{79}\u{31}","\u{79}\u{32}","\u{78}\u{31}","\u{78}\u{32}"})
762+end
763+do
764+local extrares
765+local function check
766+(body,extra, ...)
767+local t = table.pack(...)
768+local co = coroutine.wrap(body)
769+if extra then
770+extrares=co()
771+end
772+local res = table.pack(co())
773+assert(((res.n == 0x2) and (res[0x2] == nil)))
774+local res2 = table.pack(co())
775+assert((res2.n == t.n))
776+for i = 0x1, (# t)
777+do
778+if (t[i] == "\u{78}") then
779+assert((res2[i] == res[0x1]))
780+else
781+assert((res2[i] == t[i]))
782+end
783+end
784+end
785+local function foo
786+()
787+local x <close> = func2close(coroutine.yield)
788+local extra <close> = func2close(function (self)
789+assert((self == extrares))
790+coroutine.yield(0x64)
791+end)
792+extrares=extra
793+return table.unpack({0xa,x,0x1e})
794+end
795+check(foo,true,0xa,"\u{78}",0x1e)
796+assert((extrares == 0x64))
797+local function foo
798+()
799+local x <close> = func2close(coroutine.yield)
800+return
801+end
802+check(foo,false)
803+local function foo
804+()
805+local x <close> = func2close(coroutine.yield)
806+local y,z = 0x14,0x1e
807+return x
808+end
809+check(foo,false,"\u{78}")
810+local function foo
811+()
812+local x <close> = func2close(coroutine.yield)
813+local extra <close> = func2close(coroutine.yield)
814+return table.unpack({},0x1,0x64)
815+end
816+check(foo,true,table.unpack({},0x1,0x64))
817+end
818+do
819+local co = coroutine.wrap(function ()
820+local function foo
821+(err)
822+local z <close> = func2close(function (_,msg)
823+assert(((msg == nil) or (msg == (err + 0x14))))
824+coroutine.yield("\u{7a}")
825+return 0x64,0xc8
826+end)
827+local y <close> = func2close(function (_,msg)
828+assert(((msg == err) or ((msg == nil) and (err == 0x1))))
829+coroutine.yield("\u{79}")
830+if err then
831+error((err + 0x14))
832+end
833+end)
834+local x <close> = func2close(function (_,msg)
835+assert(((msg == err) or ((msg == nil) and (err == 0x1))))
836+coroutine.yield("\u{78}")
837+return 0x64,0xc8
838+end)
839+if (err == 0xa) then
840+error(err)
841+else
842+return 0xa,0x14
843+end
844+end
845+coroutine.yield(pcall(foo,nil))
846+coroutine.yield(pcall(foo,0x1))
847+return pcall(foo,0xa)
848+end)
849+local a,b = co()
850+assert(((a == "\u{78}") and (b == nil)))
851+a,b=co()
852+assert(((a == "\u{79}") and (b == nil)))
853+a,b=co()
854+assert(((a == "\u{7a}") and (b == nil)))
855+local a,b,c = co()
856+assert(((a and (b == 0xa)) and (c == 0x14)))
857+local a,b = co()
858+assert(((a == "\u{78}") and (b == nil)))
859+a,b=co()
860+assert(((a == "\u{79}") and (b == nil)))
861+a,b=co()
862+assert(((a == "\u{7a}") and (b == nil)))
863+local st,msg = co()
864+assert((not (st and (msg == 0x15))))
865+local a,b = co()
866+assert(((a == "\u{78}") and (b == nil)))
867+a,b=co()
868+assert(((a == "\u{79}") and (b == nil)))
869+a,b=co()
870+assert(((a == "\u{7a}") and (b == nil)))
871+local st,msg = co()
872+assert((not (st and (msg == (0xa + 0x14)))))
873+end
874+do
875+local x = false
876+local y = false
877+local co = coroutine.wrap(function ()
878+local xv <close> = func2close(function ()
879+x=true
880+end)
881+do
882+local yv <close> = func2close(function ()
883+y=true
884+end)
885+coroutine.yield(0x64)
886+end
887+coroutine.yield(0xc8)
888+error(0x17)
889+end)
890+local b = co()
891+assert(((b == 0x64) and (not (x and (not y)))))
892+b=co()
893+assert(((b == 0xc8) and (not (x and y))))
894+local a,b = pcall(co)
895+assert((not (((a and (b == 0x17)) and x) and y)))
896+end
897+do
898+local x = 0x0
899+local co = coroutine.wrap(function ()
900+local xx <close> = func2close(function (_,msg)
901+x=(x + 0x1)
902+;
903+assert(string.find(msg,"\u{40}\u{58}\u{58}\u{58}"))
904+error("\u{40}\u{59}\u{59}\u{59}")
905+end)
906+local xv <close> = func2close(function ()
907+x=(x + 0x1)
908+;
909+error("\u{40}\u{58}\u{58}\u{58}")
910+end)
911+coroutine.yield(0x64)
912+error(0xc8)
913+end)
914+assert((co() == 0x64))
915+;
916+assert((x == 0x0))
917+local st,msg = pcall(co)
918+;
919+assert((x == 0x2))
920+assert((not (st and string.find(msg,"\u{40}\u{59}\u{59}\u{59}"))))
921+local x = 0x0
922+local y = 0x0
923+co=coroutine.wrap(function ()
924+local xx <close> = func2close(function (_,err)
925+y=(y + 0x1)
926+;
927+assert(string.find(err,"\u{58}\u{58}\u{58}"))
928+error("\u{59}\u{59}\u{59}")
929+end)
930+local xv <close> = func2close(function ()
931+x=(x + 0x1)
932+;
933+error("\u{58}\u{58}\u{58}")
934+end)
935+coroutine.yield(0x64)
936+return 0xc8
937+end)
938+assert((co() == 0x64))
939+;
940+assert((x == 0x0))
941+local st,msg = pcall(co)
942+assert(((x == 0x1) and (y == 0x1)))
943+assert((not (st and string.find(msg,"\u{25}\u{77}\u{2b}\u{25}\u{2e}\u{25}\u{77}\u{2b}\u{3a}\u{25}\u{64}\u{2b}\u{3a}\u{20}\u{59}\u{59}\u{59}"))))
944+end
945+local co
946+co=coroutine.wrap(function ()
947+local x <close> = func2close(function ()
948+os.exit(false)
949+end)
950+co=nil
951+coroutine.yield()
952+end)
953+co()
954+assert((co == nil))
955+collectgarbage()
956+if rawget(_G,"\u{54}") then
957+print("\u{74}\u{6f}\u{2d}\u{62}\u{65}\u{2d}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{64}\u{20}\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{20}\u{78}\u{20}\u{63}\u{6f}\u{72}\u{6f}\u{75}\u{74}\u{69}\u{6e}\u{65}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{43}")
958+do
959+local token = 0x0
960+local count = 0x0
961+local f = T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{32}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2e}\u{a}\u{20}\u{20}\u{20}\u{20}")
962+local obj = func2close(function (_,msg)
963+count=(count + 0x1)
964+token=coroutine.yield(count,token)
965+end)
966+local co = coroutine.wrap(f)
967+local ct,res = co(obj,obj,0xa,0x14,0x1e,0x3)
968+assert(((ct == 0x1) and (res == 0x0)))
969+ct,res=co(0x64)
970+assert(((ct == 0x2) and (res == 0x64)))
971+res={co(0xc8)}
972+assert(((((res[0x1] == 0xa) and (res[0x2] == 0x14)) and (res[0x3] == 0x1e)) and (res[0x4] == nil)))
973+assert((token == 0xc8))
974+end
975+do
976+local f = T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2e}\u{a}\u{20}\u{20}\u{20}\u{20}")
977+local obj = func2close(function ()
978+local temp
979+local x <close> = func2close(function ()
980+coroutine.yield(temp)
981+return 0x1,0x2,0x3
982+end)
983+temp=coroutine.yield("\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{62}\u{6a}")
984+return 0x1,0x2,0x3
985+end)
986+local co = coroutine.wrap(f)
987+local res = co(obj,0xa,0x1e,0x1)
988+assert((res == "\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{62}\u{6a}"))
989+res=co("\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{78}")
990+assert((res == "\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{78}"))
991+res={co()}
992+assert(((res[0x1] == 0x1e) and (res[0x2] == nil)))
993+end
994+do
995+local f = T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{73}\u{6c}\u{6f}\u{74}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}")
996+local obj = func2close(coroutine.yield)
997+local co = coroutine.create(f)
998+local st,msg = coroutine.resume(co,obj)
999+assert((not (st and string.find(msg,"\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{61}\u{63}\u{72}\u{6f}\u{73}\u{73}"))))
1000+local f = T.makeCfunc("\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{74}\u{6f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{31}\u{a}\u{20}\u{20}\u{20}\u{20}")
1001+local st,msg = pcall(f,obj)
1002+assert((not (st and string.find(msg,"\u{61}\u{74}\u{74}\u{65}\u{6d}\u{70}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{79}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{66}\u{72}\u{6f}\u{6d}\u{20}\u{6f}\u{75}\u{74}\u{73}\u{69}\u{64}\u{65}"))))
1003+end
1004+end
1005+do
1006+local numopen = 0x0
1007+local function open
1008+(x)
1009+numopen=(numopen + 0x1)
1010+return function ()
1011+x=(x - 0x1)
1012+if (x > 0x0) then
1013+return x
1014+end
1015+end,nil,nil,func2close(function ()
1016+numopen=(numopen - 0x1)
1017+end)
1018+end
1019+local s = 0x0
1020+for i in open(0xa)
1021+do
1022+s=(s + i)
1023+end
1024+assert(((s == 0x2d) and (numopen == 0x0)))
1025+local s = 0x0
1026+for i in open(0xa)
1027+do
1028+if (i < 0x5) then
1029+break
1030+end
1031+s=(s + i)
1032+end
1033+assert(((s == 0x23) and (numopen == 0x0)))
1034+local s = 0x0
1035+for i in open(0xa)
1036+do
1037+for j in open(0xa)
1038+do
1039+if ((i + j) < 0x5) then
1040+goto endloop
1041+end
1042+s=(s + i)
1043+end
1044+end
1045+::endloop::
1046+assert(((s == 0x177) and (numopen == 0x0)))
1047+end
1048+print("\u{4f}\u{4b}")
1049+return 0x5,f
1050+end
desk/res/lua/cycled/main.luanew file+312
@@ -0,0 +1,312 @@
1+if _port then
2+return
3+end
4+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{6e}\u{64}\u{2d}\u{61}\u{6c}\u{6f}\u{6e}\u{65}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{72}\u{70}\u{72}\u{65}\u{74}\u{65}\u{72}")
5+assert(os.execute())
6+local arg = (arg or ARG)
7+local prog = os.tmpname()
8+local otherprog = os.tmpname()
9+local out = os.tmpname()
10+local progname
11+do
12+local i = 0x0
13+while arg[i] do
14+i=(i - 0x1)
15+end
16+progname=arg[(i + 0x1)]
17+end
18+print(("\u{70}\u{72}\u{6f}\u{67}\u{6e}\u{61}\u{6d}\u{65}\u{3a}\u{20}" .. progname))
19+local prepfile = function (s,mod,p)
20+mod=((mod and "\u{77}\u{62}") or "\u{77}")
21+p=(p or prog)
22+local f = io.open(p,mod)
23+f:write(s)
24+assert(f:close())
25+end
26+local function getoutput
27+()
28+local f = io.open(out)
29+local t = f:read("\u{61}")
30+f:close()
31+assert(os.remove(out))
32+return t
33+end
34+local function checkprogout
35+(s)
36+assert((string.sub(s,(- 0x1)) == "\u{a}"))
37+local t = getoutput()
38+for line in string.gmatch(s,"\u{2e}\u{2d}\u{a}")
39+do
40+assert(string.find(t,line,0x1,true))
41+end
42+end
43+local function checkout
44+(s)
45+local t = getoutput()
46+if (s ~= t) then
47+print(string.format("\u{27}\u{25}\u{73}\u{27}\u{20}\u{2d}\u{20}\u{27}\u{25}\u{73}\u{27}\u{a}",s,t))
48+end
49+assert((s == t))
50+return t
51+end
52+local function RUN
53+(p, ...)
54+p=string.gsub(p,"\u{6c}\u{75}\u{61}",("\u{22}" .. (progname .. "\u{22}")),0x1)
55+local s = string.format(p,...)
56+assert(os.execute(s))
57+end
58+local function NoRun
59+(msg,p, ...)
60+p=string.gsub(p,"\u{6c}\u{75}\u{61}",("\u{22}" .. (progname .. "\u{22}")),0x1)
61+local s = string.format(p,...)
62+s=string.format("\u{25}\u{73}\u{20}\u{3e}\u{25}\u{73}\u{20}\u{32}\u{3e}\u{26}\u{31}",s,out)
63+assert((not os.execute(s)))
64+assert(string.find(getoutput(),msg,0x1,true))
65+end
66+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{76}")
67+print(string.format("\u{28}\u{74}\u{65}\u{6d}\u{70}\u{6f}\u{72}\u{61}\u{72}\u{79}\u{20}\u{70}\u{72}\u{6f}\u{67}\u{72}\u{61}\u{6d}\u{20}\u{66}\u{69}\u{6c}\u{65}\u{20}\u{75}\u{73}\u{65}\u{64}\u{20}\u{69}\u{6e}\u{20}\u{74}\u{68}\u{65}\u{73}\u{65}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{3a}\u{20}\u{25}\u{73}\u{29}",prog))
68+prepfile("")
69+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
70+checkout("")
71+prepfile("\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{a}\u{31}\u{2c}\u{20}\u{61}\u{a}\u{29}\u{a}")
72+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
73+checkout("\u{31}\u{9}\u{6e}\u{69}\u{6c}\u{a}")
74+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{30}\u{29}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{32}\u{29}\u{a}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
75+checkout("\u{31}\u{30}\u{a}\u{32}\u{a}")
76+prepfile("\u{ef}\u{bb}\u{bf}")
77+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
78+checkout("")
79+prepfile("\u{ef}\u{bb}\u{bf}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}")
80+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
81+checkout("\u{33}\u{a}")
82+prepfile("\u{ef}\u{bb}\u{bf}\u{23}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{21}\u{21}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}")
83+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
84+checkout("\u{33}\u{a}")
85+prepfile("\u{ef}",true)
86+NoRun("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
87+prepfile("\u{ef}\u{bb}",true)
88+NoRun("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
89+prepfile("\u{ef}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}",true)
90+NoRun("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
91+prepfile("\u{ef}\u{bb}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}",true)
92+NoRun("\u{75}\u{6e}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}\u{20}\u{73}\u{79}\u{6d}\u{62}\u{6f}\u{6c}","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
93+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{61}\u{72}\u{67}\u{5b}\u{31}\u{5d}\u{29}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{20}\u{2d}\u{68}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
94+checkout("\u{2d}\u{68}\u{a}")
95+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{70}\u{61}\u{74}\u{68}\u{29}")
96+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
97+checkout("\u{78}\u{a}")
98+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{5f}\u{35}\u{5f}\u{34}\u{3d}\u{79}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
99+checkout("\u{79}\u{a}")
100+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{63}\u{70}\u{61}\u{74}\u{68}\u{29}")
101+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{43}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{75}\u{78}\u{75}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
102+checkout("\u{78}\u{75}\u{78}\u{75}\u{a}")
103+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{43}\u{50}\u{41}\u{54}\u{48}\u{5f}\u{35}\u{5f}\u{34}\u{3d}\u{79}\u{61}\u{63}\u{63}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{43}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
104+checkout("\u{79}\u{61}\u{63}\u{63}\u{a}")
105+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{58}\u{29}")
106+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{22}\u{58}\u{3d}\u{74}\u{6f}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{28}\u{61}\u{72}\u{67}\u{5b}\u{31}\u{5d}\u{29}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{33}\u{2e}\u{32}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
107+checkout("\u{33}\u{2e}\u{32}\u{a}")
108+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{58}\u{29}")
109+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{5f}\u{35}\u{5f}\u{34}\u{3d}\u{22}\u{58}\u{3d}\u{31}\u{30}\u{22}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{22}\u{58}\u{3d}\u{33}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
110+checkout("\u{31}\u{30}\u{a}")
111+prepfile("\u{78}\u{20}\u{3d}\u{20}\u{78}\u{20}\u{6f}\u{72}\u{20}\u{31}\u{30}\u{3b}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{78}\u{29}\u{3b}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{78}\u{20}\u{2b}\u{20}\u{31}")
112+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{22}\u{40}\u{25}\u{73}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,prog,out)
113+checkout("\u{31}\u{30}\u{a}\u{31}\u{31}\u{a}")
114+NoRun("\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3a}\u{31}\u{3a}\u{20}\u{6d}\u{73}\u{67}","\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{22}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{27}\u{6d}\u{73}\u{67}\u{27}\u{29}\u{22}\u{20}\u{6c}\u{75}\u{61}")
115+local defaultpath,defaultCpath
116+do
117+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{70}\u{61}\u{74}\u{68}\u{2c}\u{20}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{63}\u{70}\u{61}\u{74}\u{68}\u{29}")
118+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{49}\u{4e}\u{49}\u{54}\u{3d}\u{22}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{31}\u{30}\u{29}\u{22}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{78}\u{78}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{43}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{78}\u{78}\u{78}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{45}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
119+local output = getoutput()
120+defaultpath=string.match(output,"\u{5e}\u{28}\u{2e}\u{2d}\u{29}\u{9}")
121+defaultCpath=string.match(output,"\u{9}\u{28}\u{2e}\u{2d}\u{29}\u{24}")
122+RUN("\u{65}\u{6e}\u{76}\u{20}\u{2d}\u{69}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
123+local out = getoutput()
124+assert((defaultpath == string.match(output,"\u{5e}\u{28}\u{2e}\u{2d}\u{29}\u{9}")))
125+assert((defaultCpath == string.match(output,"\u{9}\u{28}\u{2e}\u{2d}\u{29}\u{24}")))
126+end
127+assert((not ((string.find(defaultpath,"\u{78}\u{78}\u{78}") and string.find(defaultpath,"\u{6c}\u{75}\u{61}")) and (not (string.find(defaultCpath,"\u{78}\u{78}\u{78}") and string.find(defaultCpath,"\u{6c}\u{75}\u{61}"))))))
128+local function convert
129+(p)
130+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{70}\u{61}\u{63}\u{6b}\u{61}\u{67}\u{65}\u{2e}\u{70}\u{61}\u{74}\u{68}\u{29}")
131+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{22}\u{25}\u{73}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",p,prog,out)
132+local expected = getoutput()
133+expected=string.sub(expected,0x1,(- 0x2))
134+if string.find(p,"\u{3b}\u{3b}") then
135+p=string.gsub(p,"\u{3b}\u{3b}",("\u{3b}" .. (defaultpath .. "\u{3b}")))
136+p=string.gsub(p,"\u{5e}\u{3b}","")
137+p=string.gsub(p,"\u{3b}\u{24}","")
138+end
139+assert((p == expected))
140+end
141+convert("\u{3b}")
142+convert("\u{3b}\u{3b}")
143+convert("\u{61}\u{3b}\u{3b}\u{62}")
144+convert("\u{3b}\u{3b}\u{62}")
145+convert("\u{61}\u{3b}\u{3b}")
146+convert("\u{61}\u{3b}\u{62}\u{3b}\u{3b}\u{63}")
147+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{29}\u{3b}\u{20}\u{61}\u{3d}\u{32}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{78}\u{3d}\u{31}\u{35}\u{7d}")
148+prepfile(("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{61}\u{29}\u{3b}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{5f}\u{47}\u{5b}\u{27}\u{25}\u{73}\u{27}\u{5d}\u{2e}\u{78}\u{29}"):format(prog),false,otherprog)
149+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{22}\u{3f}\u{3b}\u{3b}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{6c}\u{20}\u{25}\u{73}\u{20}\u{2d}\u{6c}\u{25}\u{73}\u{20}\u{2d}\u{6c}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{6c}\u{20}\u{69}\u{6f}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,otherprog,otherprog,out)
150+checkout("\u{31}\u{a}\u{32}\u{a}\u{31}\u{35}\u{a}\u{32}\u{a}\u{31}\u{35}\u{a}")
151+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{73}\u{74}\u{72}\u{2e}\u{75}\u{70}\u{70}\u{65}\u{72}\u{27}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}\u{27}\u{2c}\u{20}\u{6d}\u{2e}\u{6d}\u{61}\u{78}\u{28}\u{31}\u{30}\u{2c}\u{20}\u{32}\u{30}\u{29}\u{29}")
152+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{6c}\u{20}\u{27}\u{73}\u{74}\u{72}\u{3d}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}\u{20}\u{27}\u{2d}\u{6c}\u{6d}\u{3d}\u{6d}\u{61}\u{74}\u{68}\u{27}\u{20}\u{2d}\u{65}\u{20}\u{27}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{6d}\u{2e}\u{73}\u{69}\u{6e}\u{28}\u{30}\u{29}\u{29}\u{27}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
153+checkout("\u{30}\u{2e}\u{30}\u{a}\u{41}\u{4c}\u{4f}\u{20}\u{41}\u{4c}\u{4f}\u{9}\u{32}\u{30}\u{a}")
154+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{43}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{27}\u{2e}\u{2f}\u{6c}\u{69}\u{62}\u{73}\u{2f}\u{3f}\u{2e}\u{73}\u{6f}\u{27}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{6c}\u{20}\u{6c}\u{69}\u{62}\u{32}\u{2d}\u{76}\u{32}\u{20}\u{2d}\u{65}\u{20}\u{27}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{6c}\u{69}\u{62}\u{32}\u{2e}\u{69}\u{64}\u{28}\u{29}\u{29}\u{27}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
155+checkout("\u{74}\u{72}\u{75}\u{65}\u{a}")
156+local a = "\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{23}\u{61}\u{72}\u{67}\u{20}\u{3d}\u{3d}\u{20}\u{33}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{31}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{61}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{32}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{62}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{33}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{63}\u{27}\u{29}\u{a}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{72}\u{67}\u{5b}\u{2d}\u{31}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{2d}\u{2d}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{2d}\u{32}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{2d}\u{65}\u{20}\u{22}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{2d}\u{33}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{25}\u{73}\u{27}\u{29}\u{a}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{72}\u{67}\u{5b}\u{34}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{75}\u{6e}\u{64}\u{65}\u{66}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{72}\u{67}\u{5b}\u{2d}\u{34}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{75}\u{6e}\u{64}\u{65}\u{66}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{20}\u{62}\u{2c}\u{20}\u{63}\u{20}\u{3d}\u{20}\u{2e}\u{2e}\u{2e}\u{a}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{2e}\u{2e}\u{2e}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{61}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{61}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{61}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{62}\u{27}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{63}\u{20}\u{3d}\u{3d}\u{20}\u{27}\u{63}\u{27}\u{29}\u{a}"
157+a=string.format(a,progname)
158+prepfile(a)
159+RUN("\u{6c}\u{75}\u{61}\u{20}\u{22}\u{2d}\u{65}\u{20}\u{22}\u{20}\u{2d}\u{2d}\u{20}\u{25}\u{73}\u{20}\u{61}\u{20}\u{62}\u{20}\u{63}",prog)
160+prepfile("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{72}\u{67}\u{29}")
161+prepfile("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{72}\u{67}\u{29}",false,otherprog)
162+RUN("\u{65}\u{6e}\u{76}\u{20}\u{4c}\u{55}\u{41}\u{5f}\u{50}\u{41}\u{54}\u{48}\u{3d}\u{22}\u{3f}\u{3b}\u{3b}\u{22}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{6c}\u{25}\u{73}\u{20}\u{2d}\u{20}\u{3c}\u{20}\u{25}\u{73}",prog,otherprog)
163+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{2e}\u{2e}\u{2e}\u{29}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{61}\u{72}\u{67}\u{5b}\u{31}\u{5d}\u{20}\u{3d}\u{20}\u{31}\u{30}\u{30}\u{22}\u{20}\u{2d}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
164+checkout("\u{31}\u{30}\u{30}\u{a}")
165+NoRun("\u{27}\u{61}\u{72}\u{67}\u{27}\u{20}\u{69}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}","\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{61}\u{72}\u{67}\u{20}\u{3d}\u{20}\u{31}\u{22}\u{20}\u{2d}")
166+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{31}\u{30}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{3d}\u{6e}\u{69}\u{6c}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3e}\u{20}\u{2f}\u{64}\u{65}\u{76}\u{2f}\u{6e}\u{75}\u{6c}\u{6c}\u{20}\u{32}\u{3e}\u{20}\u{25}\u{73}",out)
167+assert(string.find(getoutput(),"\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{27}"))
168+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{65}\u{72}\u{72}\u{3a}\u{77}\u{72}\u{69}\u{74}\u{65}\u{28}\u{31}\u{30}\u{30}\u{30}\u{29}\u{a}\u{63}\u{6f}\u{6e}\u{74}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{27}\u{64}\u{65}\u{62}\u{75}\u{67}\u{27}\u{2e}\u{64}\u{65}\u{62}\u{75}\u{67}\u{28}\u{29}\u{22}\u{20}\u{32}\u{3e}\u{20}\u{25}\u{73}",out)
169+checkout("\u{6c}\u{75}\u{61}\u{5f}\u{64}\u{65}\u{62}\u{75}\u{67}\u{3e}\u{20}\u{31}\u{30}\u{30}\u{30}\u{6c}\u{75}\u{61}\u{5f}\u{64}\u{65}\u{62}\u{75}\u{67}\u{3e}\u{20}")
170+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{73}")
171+RUN("\u{65}\u{63}\u{68}\u{6f}\u{20}\u{22}\u{69}\u{6f}\u{2e}\u{73}\u{74}\u{64}\u{65}\u{72}\u{72}\u{3a}\u{77}\u{72}\u{69}\u{74}\u{65}\u{28}\u{31}\u{29}\u{3b}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{5b}\u{5b}\u{58}\u{58}\u{58}\u{5d}\u{5d}\u{22}\u{20}\u{7c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{32}\u{3e}\u{20}\u{25}\u{73}",out)
172+checkout("\u{31}")
173+prepfile("\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{61}\u{6c}\u{6c}\u{6f}\u{77}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{75}\u{6e}\u{6b}\u{6e}\u{6f}\u{77}\u{6e}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{72}\u{6f}\u{6c}\u{2c}\u{20}\u{69}\u{67}\u{6e}\u{6f}\u{72}\u{65}\u{64}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{66}\u{66}\u{22}\u{2c}\u{20}\u{22}\u{58}\u{58}\u{58}\u{22}\u{2c}\u{20}\u{22}\u{40}\u{6f}\u{66}\u{66}\u{22}\u{29}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{74}\u{68}\u{65}\u{73}\u{65}\u{20}\u{61}\u{72}\u{65}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{72}\u{6f}\u{6c}\u{20}\u{6d}\u{65}\u{73}\u{73}\u{61}\u{67}\u{65}\u{73}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{66}\u{66}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{74}\u{68}\u{69}\u{73}\u{20}\u{6f}\u{6e}\u{65}\u{20}\u{69}\u{73}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{6e}\u{22}\u{2c}\u{20}\u{22}\u{59}\u{59}\u{59}\u{22}\u{2c}\u{20}\u{22}\u{40}\u{6f}\u{6e}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{72}\u{6f}\u{6c}\u{2c}\u{20}\u{62}\u{75}\u{74}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{20}\u{69}\u{73}\u{20}\u{6f}\u{66}\u{66}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{66}\u{66}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{6b}\u{65}\u{65}\u{70}\u{20}\u{69}\u{74}\u{20}\u{6f}\u{66}\u{66}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{6e}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{73}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{22}\u{2c}\u{20}\u{22}\u{40}\u{6f}\u{6e}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{61}\u{67}\u{61}\u{69}\u{6e}\u{2c}\u{20}\u{6e}\u{6f}\u{20}\u{63}\u{6f}\u{6e}\u{74}\u{72}\u{6f}\u{6c}\u{2c}\u{20}\u{72}\u{65}\u{61}\u{6c}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{6f}\u{6e}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{6b}\u{65}\u{65}\u{70}\u{20}\u{69}\u{74}\u{20}\u{22}\u{73}\u{74}\u{61}\u{72}\u{74}\u{65}\u{64}\u{22}\u{a}\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{5a}\u{22}\u{2c}\u{20}\u{22}\u{5a}\u{22}\u{2c}\u{20}\u{22}\u{5a}\u{22}\u{29}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{63}\u{6f}\u{6d}\u{6d}\u{6f}\u{6e}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{a}")
174+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{57}\u{20}\u{25}\u{73}\u{20}\u{32}\u{3e}\u{20}\u{25}\u{73}",prog,out)
175+checkout("\u{4c}\u{75}\u{61}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{3a}\u{20}\u{40}\u{6f}\u{66}\u{66}\u{58}\u{58}\u{58}\u{40}\u{6f}\u{66}\u{66}\u{a}\u{4c}\u{75}\u{61}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{3a}\u{20}\u{40}\u{6f}\u{6e}\u{a}\u{4c}\u{75}\u{61}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{3a}\u{20}\u{5a}\u{5a}\u{5a}\u{a}")
176+prepfile("\u{77}\u{61}\u{72}\u{6e}\u{28}\u{22}\u{40}\u{61}\u{6c}\u{6c}\u{6f}\u{77}\u{22}\u{29}\u{a}\u{2d}\u{2d}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{74}\u{77}\u{6f}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{73}\u{20}\u{74}\u{6f}\u{20}\u{62}\u{65}\u{20}\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{77}\u{68}\u{65}\u{6e}\u{20}\u{63}\u{6c}\u{6f}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{61}\u{74}\u{65}\u{a}\u{2d}\u{2d}\u{20}\u{74}\u{68}\u{65}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{74}\u{68}\u{65}\u{20}\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{69}\u{7a}\u{65}\u{72}\u{73}\u{20}\u{6d}\u{75}\u{73}\u{74}\u{20}\u{67}\u{65}\u{6e}\u{65}\u{72}\u{61}\u{74}\u{65}\u{20}\u{77}\u{61}\u{72}\u{6e}\u{69}\u{6e}\u{67}\u{73}\u{a}\u{75}\u{31}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{67}\u{63}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{22}\u{58}\u{59}\u{5a}\u{22}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{75}\u{32}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{67}\u{63}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{22}\u{5a}\u{59}\u{58}\u{22}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}")
177+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{57}\u{20}\u{25}\u{73}\u{20}\u{32}\u{3e}\u{20}\u{25}\u{73}",prog,out)
178+checkprogout("\u{5a}\u{59}\u{58}\u{29}\u{a}\u{58}\u{59}\u{5a}\u{29}\u{a}")
179+prepfile("\u{2d}\u{2d}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{62}\u{65}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{65}\u{64}\u{20}\u{6c}\u{61}\u{73}\u{74}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{22}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{22}\u{29}\u{a}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{67}\u{63}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{22}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{32}\u{22}\u{29}\u{a}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{67}\u{63}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{a}\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{22}\u{32}\u{22}\u{29}\u{a}\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{22}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{33}\u{22}\u{29}\u{a}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{74}\u{68}\u{69}\u{73}\u{20}\u{66}\u{69}\u{6e}\u{61}\u{6c}\u{69}\u{7a}\u{65}\u{72}\u{20}\u{73}\u{68}\u{6f}\u{75}\u{6c}\u{64}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{65}\u{64}\u{2c}\u{20}\u{61}\u{73}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{20}\u{77}\u{69}\u{6c}\u{6c}\u{20}\u{62}\u{65}\u{a}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{64}\u{20}\u{61}\u{66}\u{74}\u{65}\u{72}\u{20}\u{27}\u{6c}\u{75}\u{61}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{27}\u{20}\u{68}\u{61}\u{73}\u{20}\u{62}\u{65}\u{65}\u{6e}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{65}\u{64}\u{a}\u{20}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{67}\u{63}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{67}\u{61}\u{72}\u{62}\u{61}\u{67}\u{65}\u{28}\u{29}\u{29}\u{20}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{20}\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}\u{6f}\u{72}\u{20}\u{68}\u{65}\u{72}\u{65}\u{a}\u{20}\u{20}\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{30}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}\u{a}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}")
180+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{57}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
181+checkout("\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{31}\u{a}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{32}\u{a}\u{32}\u{a}\u{63}\u{72}\u{65}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{33}\u{a}\u{6e}\u{69}\u{6c}\u{a}\u{31}\u{a}")
182+prepfile("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{28}\u{7b}\u{2e}\u{2e}\u{2e}\u{7d}\u{29}\u{5b}\u{33}\u{30}\u{5d}\u{29}")
183+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,string.rep("\u{20}\u{61}",0x1e),out)
184+checkout("\u{61}\u{a}")
185+RUN("\u{6c}\u{75}\u{61}\u{20}\u{22}\u{2d}\u{65}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{29}\u{22}\u{20}\u{2d}\u{65}\u{61}\u{3d}\u{33}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{61}\u{29}\u{22}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
186+checkout("\u{31}\u{a}\u{33}\u{a}")
187+prepfile("\u{28}\u{36}\u{2a}\u{32}\u{2d}\u{36}\u{29}\u{20}\u{2d}\u{2d}\u{20}\u{3d}\u{3d}\u{3d}\u{a}\u{61}\u{20}\u{3d}\u{a}\u{31}\u{30}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{61}\u{29}\u{a}\u{61}")
188+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{22}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{3d}\u{27}\u{27}\u{20}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{32}\u{3d}\u{27}\u{27}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
189+checkprogout("\u{36}\u{a}\u{31}\u{30}\u{a}\u{31}\u{30}\u{a}\u{a}")
190+prepfile("\u{61}\u{20}\u{3d}\u{20}\u{5b}\u{5b}\u{62}\u{a}\u{63}\u{a}\u{64}\u{a}\u{65}\u{5d}\u{5d}\u{a}\u{3d}\u{61}")
191+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{22}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{3d}\u{27}\u{27}\u{20}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{32}\u{3d}\u{27}\u{27}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
192+checkprogout("\u{62}\u{a}\u{63}\u{a}\u{64}\u{a}\u{65}\u{a}\u{a}")
193+local prompt = "\u{61}\u{6c}\u{6f}"
194+prepfile("\u{20}\u{2d}\u{2d}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{a}")
195+RUN("\u{6c}\u{75}\u{61}\u{20}\u{22}\u{2d}\u{65}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{3d}\u{27}\u{25}\u{73}\u{27}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prompt,prog,out)
196+local t = getoutput()
197+assert(string.find(t,(prompt .. ("\u{2e}\u{2a}" .. (prompt .. ("\u{2e}\u{2a}" .. prompt))))))
198+prepfile("\u{20}\u{2d}\u{2d}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{a}")
199+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
200+local t = getoutput()
201+prompt="\u{3e}\u{20}"
202+assert(string.find(t,(prompt .. ("\u{2e}\u{2a}" .. (prompt .. ("\u{2e}\u{2a}" .. prompt))))))
203+prompt="\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{43}\u{20}\u{3d}\u{20}\u{30}\u{3b}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{3d}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{7b}\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{43}\u{20}\u{3d}\u{20}\u{43}\u{20}\u{2b}\u{20}\u{31}\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{43}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}"
204+prepfile("\u{20}\u{2d}\u{2d}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{a}")
205+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{25}\u{73}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prompt,prog,out)
206+local t = getoutput()
207+assert(string.find(t,"\u{31}\u{20}\u{2d}\u{2d}\u{a}\u{32}\u{61}\u{20}\u{3d}\u{20}\u{32}\u{a}\u{33}\u{a}",0x1,true))
208+prepfile("\u{64}\u{65}\u{62}\u{75}\u{67}\u{20}\u{3d}\u{20}\u{72}\u{65}\u{71}\u{75}\u{69}\u{72}\u{65}\u{20}\u{22}\u{64}\u{65}\u{62}\u{75}\u{67}\u{22}\u{a}\u{6d}\u{20}\u{3d}\u{20}\u{7b}\u{78}\u{3d}\u{30}\u{7d}\u{a}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{6d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{28}\u{78}\u{29}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{28}\u{64}\u{65}\u{62}\u{75}\u{67}\u{2e}\u{67}\u{65}\u{74}\u{69}\u{6e}\u{66}\u{6f}\u{28}\u{34}\u{29}\u{2e}\u{63}\u{75}\u{72}\u{72}\u{65}\u{6e}\u{74}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{2b}\u{20}\u{78}\u{2e}\u{78}\u{29}\u{a}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{65}\u{72}\u{72}\u{6f}\u{72}\u{28}\u{6d}\u{29}\u{a}")
209+NoRun((progname .. "\u{3a}\u{20}\u{36}\u{a}"),"\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
210+prepfile("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{7b}\u{7d}")
211+NoRun("\u{65}\u{72}\u{72}\u{6f}\u{72}\u{20}\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{20}\u{69}\u{73}\u{20}\u{61}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
212+local s = "\u{20}\u{2d}\u{2d}\u{a}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{20}\u{28}\u{20}\u{78}\u{20}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{20}\u{3d}\u{20}\u{5b}\u{5b}\u{a}\u{78}\u{75}\u{78}\u{75}\u{a}\u{5d}\u{5d}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{22}\u{5c}\u{a}\u{78}\u{75}\u{78}\u{75}\u{5c}\u{6e}\u{22}\u{a}\u{20}\u{20}\u{69}\u{66}\u{20}\u{78}\u{20}\u{3d}\u{3d}\u{20}\u{31}\u{31}\u{20}\u{74}\u{68}\u{65}\u{6e}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{20}\u{2b}\u{20}\u{31}\u{32}\u{20}\u{2c}\u{20}\u{32}\u{20}\u{2b}\u{20}\u{32}\u{30}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}\u{2d}\u{2d}\u{5b}\u{5b}\u{20}\u{74}\u{65}\u{73}\u{74}\u{20}\u{6d}\u{75}\u{6c}\u{74}\u{69}\u{70}\u{6c}\u{65}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{73}\u{20}\u{5d}\u{5d}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{20}\u{2b}\u{20}\u{31}\u{a}\u{20}\u{20}\u{2d}\u{2d}\u{5c}\u{5c}\u{a}\u{65}\u{6e}\u{64}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{28}\u{20}\u{66}\u{28}\u{20}\u{31}\u{30}\u{30}\u{20}\u{29}\u{20}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{20}\u{61}\u{20}\u{3d}\u{3d}\u{20}\u{62}\u{20}\u{29}\u{a}\u{64}\u{6f}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{66}\u{28}\u{20}\u{31}\u{31}\u{20}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{20}"
213+s=string.gsub(s,"\u{20}","\u{a}\u{a}")
214+prepfile(s)
215+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{22}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{3d}\u{27}\u{27}\u{20}\u{5f}\u{50}\u{52}\u{4f}\u{4d}\u{50}\u{54}\u{32}\u{3d}\u{27}\u{27}\u{22}\u{20}\u{2d}\u{69}\u{20}\u{3c}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
216+checkprogout("\u{31}\u{30}\u{31}\u{a}\u{31}\u{33}\u{9}\u{32}\u{32}\u{a}\u{a}")
217+prepfile("\u{23}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{69}\u{6e}\u{20}\u{31}\u{73}\u{74}\u{20}\u{6c}\u{69}\u{6e}\u{65}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{5c}\u{6e}\u{20}\u{61}\u{74}\u{20}\u{74}\u{68}\u{65}\u{20}\u{65}\u{6e}\u{64}")
218+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
219+prepfile(("\u{23}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{a}" .. string.dump(load("\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{33}\u{29}"))),true)
220+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
221+checkout("\u{33}\u{a}")
222+prepfile(string.format("\u{69}\u{6f}\u{2e}\u{6f}\u{75}\u{74}\u{70}\u{75}\u{74}\u{28}\u{25}\u{71}\u{29}\u{3b}\u{20}\u{69}\u{6f}\u{2e}\u{77}\u{72}\u{69}\u{74}\u{65}\u{28}\u{27}\u{61}\u{6c}\u{6f}\u{27}\u{29}",out))
223+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
224+checkout("\u{61}\u{6c}\u{6f}")
225+RUN("\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{76}\u{20}\u{20}\u{2d}\u{65}\u{22}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{27}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{27}\u{22}\u{20}\u{3e}\u{20}\u{25}\u{73}",out)
226+t=getoutput()
227+assert(string.find(t,"\u{50}\u{55}\u{43}\u{25}\u{2d}\u{52}\u{69}\u{6f}\u{a}\u{68}\u{65}\u{6c}\u{6c}\u{6f}"))
228+prepfile("\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{6e}\u{69}\u{6c}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}")
229+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
230+prepfile("\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{30}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}")
231+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
232+prepfile("\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{74}\u{72}\u{75}\u{65}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}")
233+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
234+prepfile("\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{31}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}")
235+NoRun("","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
236+prepfile("\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{66}\u{61}\u{6c}\u{73}\u{65}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}")
237+NoRun("","\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}",prog)
238+prepfile("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3c}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{3e}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{7b}\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{73}\u{65}\u{6c}\u{66}\u{2c}\u{20}\u{65}\u{72}\u{72}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{65}\u{72}\u{72}\u{20}\u{3d}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{22}\u{4f}\u{6b}\u{22}\u{29}\u{a}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{65}\u{31}\u{20}\u{3c}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{3e}\u{20}\u{3d}\u{20}\u{73}\u{65}\u{74}\u{6d}\u{65}\u{74}\u{61}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{28}\u{7b}\u{7d}\u{2c}\u{20}\u{7b}\u{5f}\u{5f}\u{63}\u{6c}\u{6f}\u{73}\u{65}\u{20}\u{3d}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{32}\u{30}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{7d}\u{29}\u{a}\u{20}\u{20}\u{6f}\u{73}\u{2e}\u{65}\u{78}\u{69}\u{74}\u{28}\u{74}\u{72}\u{75}\u{65}\u{2c}\u{20}\u{74}\u{72}\u{75}\u{65}\u{29}\u{a}")
239+RUN("\u{6c}\u{75}\u{61}\u{20}\u{25}\u{73}\u{20}\u{3e}\u{20}\u{25}\u{73}",prog,out)
240+checkprogout("\u{31}\u{32}\u{30}\u{a}\u{4f}\u{6b}\u{a}")
241+assert(os.remove(prog))
242+assert(os.remove(otherprog))
243+assert((not os.remove(out)))
244+NoRun("\u{75}\u{6e}\u{72}\u{65}\u{63}\u{6f}\u{67}\u{6e}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{2d}\u{68}\u{27}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{68}")
245+NoRun("\u{75}\u{6e}\u{72}\u{65}\u{63}\u{6f}\u{67}\u{6e}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{2d}\u{2d}\u{2d}\u{27}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{2d}\u{2d}")
246+NoRun("\u{75}\u{6e}\u{72}\u{65}\u{63}\u{6f}\u{67}\u{6e}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{2d}\u{45}\u{78}\u{27}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{45}\u{78}")
247+NoRun("\u{75}\u{6e}\u{72}\u{65}\u{63}\u{6f}\u{67}\u{6e}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{2d}\u{76}\u{76}\u{27}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{76}\u{76}")
248+NoRun("\u{75}\u{6e}\u{72}\u{65}\u{63}\u{6f}\u{67}\u{6e}\u{69}\u{7a}\u{65}\u{64}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{2d}\u{69}\u{76}\u{27}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{69}\u{76}")
249+NoRun("\u{27}\u{2d}\u{65}\u{27}\u{20}\u{6e}\u{65}\u{65}\u{64}\u{73}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}")
250+NoRun("\u{73}\u{79}\u{6e}\u{74}\u{61}\u{78}\u{20}\u{65}\u{72}\u{72}\u{6f}\u{72}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{65}\u{20}\u{61}")
251+NoRun("\u{27}\u{2d}\u{6c}\u{27}\u{20}\u{6e}\u{65}\u{65}\u{64}\u{73}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}","\u{6c}\u{75}\u{61}\u{20}\u{2d}\u{6c}")
252+if T then
253+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}\u{27}\u{20}\u{74}\u{6f}\u{20}\u{63}\u{72}\u{65}\u{61}\u{74}\u{65}\u{20}\u{61}\u{20}\u{73}\u{74}\u{61}\u{74}\u{65}")
254+NoRun("\u{6e}\u{6f}\u{74}\u{20}\u{65}\u{6e}\u{6f}\u{75}\u{67}\u{68}\u{20}\u{6d}\u{65}\u{6d}\u{6f}\u{72}\u{79}","\u{65}\u{6e}\u{76}\u{20}\u{4d}\u{45}\u{4d}\u{4c}\u{49}\u{4d}\u{49}\u{54}\u{3d}\u{31}\u{30}\u{30}\u{20}\u{6c}\u{75}\u{61}")
255+warn("\u{40}\u{73}\u{74}\u{6f}\u{72}\u{65}")
256+warn("\u{40}\u{31}\u{32}\u{33}","\u{34}\u{35}\u{36}","\u{37}\u{38}\u{39}")
257+assert((_WARN == "\u{40}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"))
258+;
259+_WARN=false
260+warn("\u{7a}\u{69}\u{70}","","\u{20}","\u{7a}\u{61}\u{70}")
261+assert((_WARN == "\u{7a}\u{69}\u{70}\u{20}\u{7a}\u{61}\u{70}"))
262+;
263+_WARN=false
264+warn("\u{5a}\u{49}\u{50}","","\u{20}","\u{5a}\u{41}\u{50}")
265+assert((_WARN == "\u{5a}\u{49}\u{50}\u{20}\u{5a}\u{41}\u{50}"))
266+;
267+_WARN=false
268+warn("\u{40}\u{6e}\u{6f}\u{72}\u{6d}\u{61}\u{6c}")
269+end
270+do
271+local st,msg = pcall(warn)
272+assert(string.find(msg,"\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}"))
273+st,msg=pcall(warn,"\u{53}\u{48}\u{4f}\u{55}\u{4c}\u{44}\u{20}\u{4e}\u{4f}\u{54}\u{20}\u{41}\u{50}\u{50}\u{45}\u{41}\u{52}",{})
274+assert(string.find(msg,"\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}"))
275+end
276+print("\u{2b}")
277+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{43}\u{74}\u{72}\u{6c}\u{20}\u{43}")
278+do
279+local function kill
280+(pid)
281+return os.execute(string.format("\u{6b}\u{69}\u{6c}\u{6c}\u{20}\u{2d}\u{49}\u{4e}\u{54}\u{20}\u{25}\u{73}\u{20}\u{32}\u{3e}\u{20}\u{2f}\u{64}\u{65}\u{76}\u{2f}\u{6e}\u{75}\u{6c}\u{6c}",pid))
282+end
283+local function runback
284+(luaprg)
285+local shellprg = string.format("\u{25}\u{73}\u{20}\u{2d}\u{65}\u{20}\u{22}\u{25}\u{73}\u{22}\u{20}\u{26}\u{20}\u{65}\u{63}\u{68}\u{6f}\u{20}\u{24}\u{21}",progname,luaprg)
286+local f = io.popen(shellprg,"\u{72}")
287+local pid = f:read()
288+print(("\u{28}\u{69}\u{66}\u{20}\u{74}\u{65}\u{73}\u{74}\u{20}\u{66}\u{61}\u{69}\u{6c}\u{73}\u{20}\u{6e}\u{6f}\u{77}\u{2c}\u{20}\u{69}\u{74}\u{20}\u{6d}\u{61}\u{79}\u{20}\u{6c}\u{65}\u{61}\u{76}\u{65}\u{20}\u{61}\u{20}\u{4c}\u{75}\u{61}\u{20}\u{73}\u{63}\u{72}\u{69}\u{70}\u{74}\u{20}\u{72}\u{75}\u{6e}\u{6e}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{6e}\u{20}\u{62}\u{61}\u{63}\u{6b}\u{67}\u{72}\u{6f}\u{75}\u{6e}\u{64}\u{2c}\u{20}\u{70}\u{69}\u{64}\u{20}" .. (pid .. "\u{29}")))
289+return f,pid
290+end
291+local f,pid = runback("\u{20}\u{20}\u{20}\u{20}\u{70}\u{63}\u{61}\u{6c}\u{6c}\u{28}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{28}\u{29}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{32}\u{29}\u{3b}\u{20}\u{77}\u{68}\u{69}\u{6c}\u{65}\u{20}\u{74}\u{72}\u{75}\u{65}\u{20}\u{64}\u{6f}\u{20}\u{65}\u{6e}\u{64}\u{20}\u{65}\u{6e}\u{64}\u{29}\u{3b}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{34}\u{32}\u{29}")
292+assert((f:read() == "\u{31}\u{32}"))
293+kill(pid)
294+assert((f:read() == "\u{34}\u{32}"))
295+assert(f:close())
296+print("\u{64}\u{6f}\u{6e}\u{65}")
297+local f,pid = runback("\u{20}\u{20}\u{20}\u{20}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{28}\u{31}\u{35}\u{29}\u{3b}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{66}\u{69}\u{6e}\u{64}\u{28}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{72}\u{65}\u{70}\u{28}\u{27}\u{61}\u{27}\u{2c}\u{20}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{29}\u{2c}\u{20}\u{27}\u{2e}\u{2a}\u{62}\u{27}\u{29}")
298+assert((f:read() == "\u{31}\u{35}"))
299+assert(os.execute("\u{73}\u{6c}\u{65}\u{65}\u{70}\u{20}\u{31}"))
300+local n = 0x64
301+for i = 0x0, 0x64
302+do
303+if (not kill(pid)) then
304+n=i
305+break
306+end
307+end
308+assert(f:close())
309+assert((n >= 0x2))
310+print(string.format("\u{64}\u{6f}\u{6e}\u{65}\u{20}\u{28}\u{77}\u{69}\u{74}\u{68}\u{20}\u{25}\u{64}\u{20}\u{6b}\u{69}\u{6c}\u{6c}\u{73}\u{29}",n))
311+end
312+print("\u{4f}\u{4b}")
desk/res/lua/cycled/math.luanew file+879
@@ -0,0 +1,879 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{73}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{20}\u{6c}\u{69}\u{62}")
2+local minint <const> = math.mininteger
3+local maxint <const> = math.maxinteger
4+local intbits <const> = (math.floor((math.log(maxint,0x2) + 0.5)) + 0x1)
5+assert(((0x1 << intbits) == 0x0))
6+assert((minint == (0x1 << (intbits - 0x1))))
7+assert((maxint == (minint - 0x1)))
8+local floatbits = 0x18
9+do
10+local p = (2.0 ^ floatbits)
11+while (p < (p + 1.0)) do
12+p=(p * 2.0)
13+floatbits=(floatbits + 0x1)
14+end
15+end
16+local function isNaN
17+(x)
18+return (x ~= x)
19+end
20+assert(isNaN((0x0 / 0x0)))
21+assert((not isNaN((0x1 / 0x0))))
22+do
23+local x = (2.0 ^ floatbits)
24+assert(((x > (x - 1.0)) and (x == (x + 1.0))))
25+print(string.format("\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{2c}\u{20}\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{28}\u{6d}\u{61}\u{6e}\u{74}\u{69}\u{73}\u{73}\u{61}\u{29}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}",intbits,floatbits))
26+end
27+assert((((math.type(0x0) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}") and (math.type(0.0) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")) and (not math.type("\u{31}\u{30}"))))
28+local function checkerror
29+(msg,f, ...)
30+local s,err = pcall(f,...)
31+assert((not (s and string.find(err,msg))))
32+end
33+local msgf2i = "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{2e}\u{2a}\u{20}\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}"
34+local function eq
35+(a,b,limit)
36+if (not limit) then
37+if (floatbits >= 0x32) then
38+limit=1e-11
39+else
40+limit=1e-5
41+end
42+end
43+return ((a == b) or (math.abs((a - b)) <= limit))
44+end
45+local function eqT
46+(a,b)
47+return ((a == b) and (math.type(a) == math.type(b)))
48+end
49+assert((((((0.0 == 0x0) and (0.0 == 0x0)) and (0.0 == 0x0)) and (20.0 == 0x14)) and (0.2 == 0.2)))
50+do
51+local a,b,c = "\u{32}","\u{20}\u{33}\u{65}\u{30}\u{20}","\u{20}\u{31}\u{30}\u{20}\u{20}"
52+assert((((a + b) == 0x5) and (- (b == (- ((0x3 and ((b + "\u{32}") == 0x5)) and (("\u{31}\u{30}" - c) == 0x0)))))))
53+assert((((type(a) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")))
54+assert(((((a == "\u{32}") and (b == "\u{20}\u{33}\u{65}\u{30}\u{20}")) and (c == "\u{20}\u{31}\u{30}\u{20}\u{20}")) and (- (c == (- "\u{20}\u{20}\u{31}\u{30}\u{20}")))))
55+assert((((c % a) == 0x0) and ((a ^ b) == 0x8)))
56+a=0x0
57+assert((a == (- (a and (0x0 == (- 0x0))))))
58+end
59+do
60+local x = (- 0x1)
61+local mz = (0x0 / x)
62+local t = {[0x0] = 0xa,0x14,0x1e,0x28,0x32}
63+assert(((t[mz] == t[0x0]) and (t[(- 0x0)] == t[0x0])))
64+end
65+do
66+local a,b = math.modf(3.5)
67+assert(((a == 3.0) and (b == 0.5)))
68+a,b=math.modf((- 2.5))
69+assert((a == (- (2.0 and (b == (- 0.5))))))
70+a,b=math.modf((- 3e23))
71+assert((a == (- (3e23 and (b == 0.0)))))
72+a,b=math.modf(3e35)
73+assert(((a == 3e35) and (b == 0.0)))
74+a,b=math.modf((- (0x1 / 0x0)))
75+assert((a == (- ((0x1 / 0x0) and (b == 0.0)))))
76+a,b=math.modf((0x1 / 0x0))
77+assert(((a == (0x1 / 0x0)) and (b == 0.0)))
78+a,b=math.modf((0x0 / 0x0))
79+assert((isNaN(a) and isNaN(b)))
80+a,b=math.modf(0x3)
81+assert((eqT(a,0x3) and eqT(b,0.0)))
82+a,b=math.modf(minint)
83+assert((eqT(a,minint) and eqT(b,0.0)))
84+end
85+assert((math.huge > 1e31))
86+assert((- (math.huge < (- 1e31))))
87+assert((minint < (minint + 0x1)))
88+assert(((maxint - 0x1) < maxint))
89+assert(((0x0 - minint) == minint))
90+assert(((minint * minint) == 0x0))
91+assert((((maxint * maxint) * maxint) == maxint))
92+for _,i in pairs({(- 0x10),(- 0xf),(- 0x3),(- 0x2),(- 0x1),0x0,0x1,0x2,0x3,0xf})
93+do
94+for _,j in pairs({(- 0x10),(- 0xf),(- 0x3),(- 0x2),(- 0x1),0x1,0x2,0x3,0xf})
95+do
96+for _,ti in pairs({0x0,0.0})
97+do
98+for _,tj in pairs({0x0,0.0})
99+do
100+local x = (i + ti)
101+local y = (j + tj)
102+assert(((i // j) == math.floor((i / j))))
103+end
104+end
105+end
106+end
107+assert(((0x1 // 0.0) == (0x1 / 0x0)))
108+assert((- ((0x1 // 0.0) == (- (0x1 / 0x0)))))
109+assert(eqT((3.5 // 1.5),2.0))
110+assert(eqT((3.5 // (- 1.5)),(- 3.0)))
111+do
112+local x,y
113+x=0x1
114+;
115+assert(((x // 0.0) == (0x1 / 0x0)))
116+x=1.0
117+;
118+assert(((x // 0x0) == (0x1 / 0x0)))
119+x=3.5
120+;
121+assert(eqT((x // 0x1),3.0))
122+assert(eqT((x // (- 0x1)),(- 4.0)))
123+x=3.5
124+;
125+y=1.5
126+;
127+assert(eqT((x // y),2.0))
128+x=3.5
129+;
130+y=(- 1.5)
131+;
132+assert(eqT((x // y),(- 3.0)))
133+end
134+assert(((maxint // maxint) == 0x1))
135+assert(((maxint // 0x1) == maxint))
136+assert((((maxint - 0x1) // maxint) == 0x0))
137+assert(((maxint // (maxint - 0x1)) == 0x1))
138+assert(((minint // minint) == 0x1))
139+assert(((minint // minint) == 0x1))
140+assert((((minint + 0x1) // minint) == 0x0))
141+assert(((minint // (minint + 0x1)) == 0x1))
142+assert(((minint // 0x1) == minint))
143+assert((minint // (- (0x1 == (- minint)))))
144+assert((minint // (- (0x2 == (0x2 ^ (intbits - 0x2))))))
145+assert((maxint // (- (0x1 == (- maxint)))))
146+do
147+assert((0x2 ^ (- (0x3 == (0x1 / (0x2 ^ 0x3))))))
148+assert(eq(((- 0x3) ^ (- 0x3)),(0x1 / ((- 0x3) ^ 0x3))))
149+for i = (- 0x3), 0x3
150+do
151+for j = (- 0x3), 0x3
152+do
153+if (not ((_port or (i ~= 0x0)) or (j > 0x0))) then
154+assert(eq((i ^ j),(0x1 / (i ^ (- j)))))
155+end
156+end
157+end
158+end
159+if (floatbits < intbits) then
160+assert(((2.0 ^ floatbits) == (0x1 << floatbits)))
161+assert((((2.0 ^ floatbits) - 1.0) == ((0x1 << floatbits) - 1.0)))
162+assert((((2.0 ^ floatbits) - 1.0) ~= (0x1 << floatbits)))
163+assert((((2.0 ^ floatbits) + 1.0) ~= ((0x1 << floatbits) + 0x1)))
164+else
165+assert((maxint == (maxint + 0.0)))
166+assert(((maxint - 0x1) == (maxint - 1.0)))
167+assert(((minint + 0x1) == (minint + 1.0)))
168+assert((maxint ~= (maxint - 1.0)))
169+end
170+assert(((maxint + 0.0) == ((2.0 ^ (intbits - 0x1)) - 1.0)))
171+assert(((minint + 0.0) == minint))
172+assert(((minint + 0.0) == (- (2.0 ^ (intbits - 0x1)))))
173+assert((0x1 < 1.1))
174+;
175+assert((not (0x1 < 0.9)))
176+assert((0x1 <= 1.1))
177+;
178+assert((not (0x1 <= 0.9)))
179+assert((- (0x1 < (- 0.9))))
180+;
181+assert((not (- (0x1 < (- 1.1)))))
182+assert((0x1 <= 1.1))
183+;
184+assert((not (- (0x1 <= (- 1.1)))))
185+assert((- (0x1 < (- 0.9))))
186+;
187+assert((not (- (0x1 < (- 1.1)))))
188+assert((- (0x1 <= (- 0.9))))
189+;
190+assert((not (- (0x1 <= (- 1.1)))))
191+assert((minint <= (minint + 0.0)))
192+assert(((minint + 0.0) <= minint))
193+assert((not (minint < (minint + 0.0))))
194+assert((not ((minint + 0.0) < minint)))
195+assert((maxint < (minint * (- 1.0))))
196+assert((maxint <= (minint * (- 1.0))))
197+do
198+local fmaxi1 = (0x2 ^ (intbits - 0x1))
199+assert((maxint < fmaxi1))
200+assert((maxint <= fmaxi1))
201+assert((not (fmaxi1 <= maxint)))
202+assert((minint <= (- (0x2 ^ (intbits - 0x1)))))
203+assert((- ((0x2 ^ (intbits - 0x1)) <= minint)))
204+end
205+if (floatbits < intbits) then
206+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
207+local fmax = (0x2 ^ floatbits)
208+local ifmax = (fmax | 0x0)
209+assert((fmax < (ifmax + 0x1)))
210+assert(((fmax - 0x1) < ifmax))
211+assert((- ((fmax - 0x1) > (- ifmax))))
212+assert((not (fmax <= (ifmax - 0x1))))
213+assert((- (fmax > (- (ifmax + 0x1)))))
214+assert((not (- (fmax >= (- (ifmax - 0x1))))))
215+assert((((fmax / 0x2) - 0.5) < (ifmax // 0x2)))
216+assert((- (((fmax / 0x2) - 0.5) > (- (ifmax // 0x2)))))
217+assert((maxint < (0x2 ^ intbits)))
218+assert((minint > (- (0x2 ^ intbits))))
219+assert((maxint <= (0x2 ^ intbits)))
220+assert((minint >= (- (0x2 ^ intbits))))
221+else
222+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
223+assert((maxint < (maxint + 1.0)))
224+assert((maxint < (maxint + 0.5)))
225+assert(((maxint - 1.0) < maxint))
226+assert(((maxint - 0.5) < maxint))
227+assert((not ((maxint + 0.0) < maxint)))
228+assert(((maxint + 0.0) <= maxint))
229+assert((not (maxint < (maxint + 0.0))))
230+assert(((maxint + 0.0) <= maxint))
231+assert((maxint <= (maxint + 0.0)))
232+assert((not ((maxint + 1.0) <= maxint)))
233+assert((not ((maxint + 0.5) <= maxint)))
234+assert((not (maxint <= (maxint - 1.0))))
235+assert((not (maxint <= (maxint - 0.5))))
236+assert((minint < (minint + 1.0)))
237+assert((minint < (minint + 0.5)))
238+assert((minint <= (minint + 0.5)))
239+assert(((minint - 1.0) < minint))
240+assert(((minint - 1.0) <= minint))
241+assert((not ((minint + 0.0) < minint)))
242+assert((not ((minint + 0.5) < minint)))
243+assert((not (minint < (minint + 0.0))))
244+assert(((minint + 0.0) <= minint))
245+assert((minint <= (minint + 0.0)))
246+assert((not ((minint + 1.0) <= minint)))
247+assert((not ((minint + 0.5) <= minint)))
248+assert((not (minint <= (minint - 1.0))))
249+end
250+do
251+local NaN <const> = (0x0 / 0x0)
252+assert((not (NaN < 0x0)))
253+assert((not (NaN > minint)))
254+assert((not (NaN <= (- 0x9))))
255+assert((not (NaN <= maxint)))
256+assert((not (NaN < maxint)))
257+assert((not (minint <= NaN)))
258+assert((not (minint < NaN)))
259+assert((not (0x4 <= NaN)))
260+assert((not (0x4 < NaN)))
261+end
262+local function checkcompt
263+(msg,code)
264+checkerror(msg,assert(load(code)))
265+end
266+checkcompt("\u{64}\u{69}\u{76}\u{69}\u{64}\u{65}\u{20}\u{62}\u{79}\u{20}\u{7a}\u{65}\u{72}\u{6f}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{20}\u{2f}\u{2f}\u{20}\u{30}")
267+checkcompt(msgf2i,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{2e}\u{33}\u{20}\u{3e}\u{3e}\u{20}\u{30}")
268+checkcompt(msgf2i,("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{25}\u{64}\u{20}\u{26}\u{20}\u{31}"):format((intbits - 0x1)))
269+checkcompt("\u{66}\u{69}\u{65}\u{6c}\u{64}\u{20}\u{27}\u{68}\u{75}\u{67}\u{65}\u{27}","\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{68}\u{75}\u{67}\u{65}\u{20}\u{3c}\u{3c}\u{20}\u{31}")
270+checkcompt(msgf2i,("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{20}\u{7c}\u{20}\u{32}\u{2e}\u{30}\u{5e}\u{25}\u{64}"):format((intbits - 0x1)))
271+checkcompt(msgf2i,"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{32}\u{2e}\u{33}\u{20}\u{7e}\u{20}\u{30}\u{2e}\u{30}")
272+local function f2i
273+(x)
274+return (x | x)
275+end
276+checkerror(msgf2i,f2i,math.huge)
277+checkerror(msgf2i,f2i,(- math.huge))
278+checkerror(msgf2i,f2i,(0x0 / 0x0))
279+if (floatbits < intbits) then
280+assert(((maxint + 1.0) == (maxint + 0.0)))
281+assert(((minint - 1.0) == (minint + 0.0)))
282+checkerror(msgf2i,f2i,(maxint + 0.0))
283+assert((f2i((2.0 ^ (intbits - 0x2))) == (0x1 << (intbits - 0x2))))
284+assert((f2i((- (2.0 ^ (intbits - 0x2)))) == (- (0x1 << (intbits - 0x2)))))
285+assert(((((2.0 ^ (floatbits - 0x1)) + 1.0) // 0x1) == ((0x1 << (floatbits - 0x1)) + 0x1)))
286+local mf = ((maxint - (0x1 << (floatbits - intbits))) + 0x1)
287+assert((f2i((mf + 0.0)) == mf))
288+mf=(mf + 0x1)
289+assert((f2i((mf + 0.0)) ~= mf))
290+else
291+assert(((maxint + 1.0) > maxint))
292+assert(((minint - 1.0) < minint))
293+assert((f2i((maxint + 0.0)) == maxint))
294+checkerror("\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}",f2i,(maxint + 1.0))
295+checkerror("\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}",f2i,(minint - 1.0))
296+end
297+assert((f2i((minint + 0.0)) == minint))
298+assert((("\u{32}" + 0x1) == 0x3))
299+assert((("\u{32}\u{20}" + 0x1) == 0x3))
300+assert((("\u{20}\u{2d}\u{32}\u{20}" + 0x1) == (- 0x1)))
301+assert((("\u{20}\u{2d}\u{30}\u{78}\u{61}\u{20}" + 0x1) == (- 0x9)))
302+do
303+assert(eqT(tonumber(tostring(maxint)),maxint))
304+assert(eqT(tonumber(tostring(minint)),minint))
305+local function incd
306+(n)
307+local s = string.format("\u{25}\u{64}",n)
308+s=string.gsub(s,"\u{25}\u{64}\u{24}",function (d)
309+assert((d ~= "\u{39}"))
310+return string.char((string.byte(d) + 0x1))
311+end)
312+return s
313+end
314+assert(eqT(tonumber(incd(maxint)),(maxint + 1.0)))
315+assert(eqT(tonumber(incd(minint)),(minint - 1.0)))
316+assert(eqT(tonumber(("\u{31}" .. string.rep("\u{30}",0x1e))),1e30))
317+assert(eqT(tonumber(("\u{2d}\u{31}" .. string.rep("\u{30}",0x1e))),(- 1e30)))
318+assert(eqT(tonumber(("\u{30}\u{78}\u{31}" .. string.rep("\u{30}",0x1e))),0x0))
319+assert((minint == load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. minint))()))
320+assert(eqT(maxint,load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. maxint))()))
321+assert(eqT(1e22,1e22))
322+assert(eqT((- 1e22),(- 1e22)))
323+end
324+assert((tonumber(3.4) == 3.4))
325+assert(eqT(tonumber(0x3),0x3))
326+assert((eqT(tonumber(maxint),maxint) and eqT(tonumber(minint),minint)))
327+assert((tonumber((0x1 / 0x0)) == (0x1 / 0x0)))
328+assert((tonumber("\u{30}") == 0x0))
329+assert((not tonumber("")))
330+assert((not tonumber("\u{20}\u{20}")))
331+assert((not tonumber("\u{2d}")))
332+assert((not tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{20}")))
333+assert((not tonumber({})))
334+assert(((((tonumber("\u{2b}\u{30}\u{2e}\u{30}\u{31}") == (0x1 / 0x64)) and (tonumber("\u{2b}\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2d}\u{31}\u{2e}") == (- (0x1 and (tonumber("\u{2b}\u{31}\u{2e}") == 0x1))))))
335+assert((not (tonumber("\u{2b}\u{20}\u{30}\u{2e}\u{30}\u{31}") and (not (tonumber("\u{2b}\u{2e}\u{65}\u{31}") and (not (tonumber("\u{31}\u{65}") and (not (tonumber("\u{31}\u{2e}\u{30}\u{65}\u{2b}") and (not tonumber("\u{2e}")))))))))))
336+assert((tonumber("\u{2d}\u{30}\u{31}\u{32}") == (- (0xa - 0x2))))
337+assert((tonumber("\u{2d}\u{31}\u{2e}\u{32}\u{65}\u{32}") == (- (- (- 0x78)))))
338+assert((tonumber("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}") == ((0x1 << (0x4 * 0xc)) - 0x1)))
339+assert((tonumber(("\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == (- 0x1)))
340+assert((tonumber(("\u{2d}\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == 0x1))
341+assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == 0xa))
342+assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0xa) == 0x3f2))
343+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == (- 0xa)))
344+assert((tonumber("\u{31}\u{30}",0x24) == 0x24))
345+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{20}\u{20}",0x24) == (- 0x24)))
346+assert((tonumber("\u{20}\u{20}\u{2b}\u{31}\u{5a}\u{20}\u{20}",0x24) == (0x24 + 0x23)))
347+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{7a}\u{20}\u{20}",0x24) == (- (0x24 + (- 0x23)))))
348+assert((tonumber("\u{2d}\u{66}\u{46}\u{66}\u{61}",0x10) == (- (0xa + (0x10 * (0xf + (0x10 * (0xf + (0x10 * 0xf)))))))))
349+assert(((tonumber(string.rep("\u{31}",(intbits - 0x2)),0x2) + 0x1) == (0x2 ^ (intbits - 0x2))))
350+assert(((tonumber("\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
351+assert(((tonumber("\u{30}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
352+assert(((tonumber("\u{2d}\u{30}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) - 0x1) == (- (0x1 << 0x28))))
353+for i = 0x2, 0x24
354+do
355+local i2 = (i * i)
356+local i10 = ((((i2 * i2) * i2) * i2) * i2)
357+assert((tonumber("\u{9}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{9}",i) == i10))
358+end
359+if (not _soft) then
360+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0xd) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0xd)) - 0x1)))
361+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x96) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x96)) - 0x1)))
362+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x12c) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x12c)) - 0x1)))
363+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x1f4) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x1f4)) - 0x1)))
364+assert((tonumber(("\u{30}\u{78}\u{33}\u{2e}" .. string.rep("\u{30}",0x3e8))) == 0x3))
365+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{30}",0x3e8) .. "\u{61}"))) == 0xa))
366+assert((tonumber(("\u{30}\u{78}\u{30}\u{2e}" .. (string.rep("\u{30}",0xd) .. "\u{31}"))) == (2.0 ^ (- (0x4 * 0xe)))))
367+assert((tonumber(("\u{30}\u{78}\u{30}\u{2e}" .. (string.rep("\u{30}",0x96) .. "\u{31}"))) == (2.0 ^ (- (0x4 * 0x97)))))
368+assert((tonumber(("\u{30}\u{78}\u{30}\u{2e}" .. (string.rep("\u{30}",0x12c) .. "\u{31}"))) == (2.0 ^ (- (0x4 * 0x12d)))))
369+assert((tonumber(("\u{30}\u{78}\u{30}\u{2e}" .. (string.rep("\u{30}",0x1f4) .. "\u{31}"))) == (2.0 ^ (- (0x4 * 0x1f5)))))
370+assert((tonumber(("\u{30}\u{78}\u{65}\u{30}\u{33}" .. (string.rep("\u{30}",0x3e8) .. "\u{70}\u{2d}\u{34}\u{30}\u{30}\u{30}"))) == 3587.0))
371+assert((tonumber(("\u{30}\u{78}\u{2e}" .. (string.rep("\u{30}",0x3e8) .. "\u{37}\u{34}\u{70}\u{34}\u{30}\u{30}\u{34}"))) == 7.25))
372+end
373+local function f
374+(...)
375+if (select("\u{23}",...) == 0x1) then
376+return ...
377+else
378+return "\u{2a}\u{2a}\u{2a}"
379+end
380+end
381+assert((not f(tonumber("\u{66}\u{46}\u{66}\u{61}",0xf))))
382+assert((not f(tonumber("\u{30}\u{39}\u{39}",0x8))))
383+assert((not f(tonumber("\u{31}\u{0}",0x2))))
384+assert((not f(tonumber("",0x8))))
385+assert((not f(tonumber("\u{20}\u{20}",0x9))))
386+assert((not f(tonumber("\u{20}\u{20}",0x9))))
387+assert((not f(tonumber("\u{30}\u{78}\u{66}",0xa))))
388+assert((not f(tonumber("\u{69}\u{6e}\u{66}"))))
389+assert((not f(tonumber("\u{20}\u{49}\u{4e}\u{46}\u{20}"))))
390+assert((not f(tonumber("\u{4e}\u{61}\u{6e}"))))
391+assert((not f(tonumber("\u{6e}\u{61}\u{6e}"))))
392+assert((not f(tonumber("\u{20}\u{20}"))))
393+assert((not f(tonumber(""))))
394+assert((not f(tonumber("\u{31}\u{20}\u{20}\u{61}"))))
395+assert((not f(tonumber("\u{31}\u{20}\u{20}\u{61}",0x2))))
396+assert((not f(tonumber("\u{31}\u{0}"))))
397+assert((not f(tonumber("\u{31}\u{20}\u{0}"))))
398+assert((not f(tonumber("\u{31}\u{0}\u{20}"))))
399+assert((not f(tonumber("\u{65}\u{31}"))))
400+assert((not f(tonumber("\u{65}\u{20}\u{20}\u{31}"))))
401+assert((not f(tonumber("\u{20}\u{33}\u{2e}\u{34}\u{2e}\u{35}\u{20}"))))
402+assert((not tonumber("\u{30}\u{78}")))
403+assert((not tonumber("\u{78}")))
404+assert((not tonumber("\u{78}\u{33}")))
405+assert((not tonumber("\u{30}\u{78}\u{33}\u{2e}\u{33}\u{2e}\u{33}")))
406+assert((not tonumber("\u{30}\u{30}\u{78}\u{32}")))
407+assert((not tonumber("\u{30}\u{78}\u{20}\u{32}")))
408+assert((not tonumber("\u{30}\u{20}\u{78}\u{32}")))
409+assert((not tonumber("\u{32}\u{33}\u{78}")))
410+assert((not tonumber("\u{2d}\u{20}\u{30}\u{78}\u{61}\u{61}")))
411+assert((not tonumber("\u{2d}\u{30}\u{78}\u{61}\u{61}\u{50}\u{20}")))
412+assert((not tonumber("\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}")))
413+assert((not tonumber("\u{30}\u{78}\u{35}\u{70}\u{2b}\u{2d}\u{32}")))
414+assert((((0x10 == 0x10) and (0xfff == ((0x2 ^ 0xc) - 0x1))) and (0xfb == 0xfb)))
415+assert(((0.0 == 0x0) and (0.0 == 0x0)))
416+assert((0xffffffff == ((0x1 << 0x20) - 0x1)))
417+assert((tonumber("\u{2b}\u{30}\u{78}\u{32}") == 0x2))
418+assert((tonumber("\u{2d}\u{30}\u{78}\u{61}\u{41}") == (- 0xaa)))
419+assert((tonumber("\u{2d}\u{30}\u{78}\u{66}\u{66}\u{46}\u{46}\u{46}\u{66}\u{66}\u{66}") == (- ((0x1 << 0x20) + 0x1))))
420+assert((((0.0 == 0x0) and ((0xe + 0x1) == 0xf)) and ((0xe - 0x1) == 0xd)))
421+assert((tonumber("\u{20}\u{20}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (0x25 / 0x10)))
422+assert((tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (- (0x25 / 0x10))))
423+assert((tonumber("\u{20}\u{20}\u{2b}\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}\u{2b}\u{38}\u{20}\u{20}") == 0x51))
424+assert((0.9999999997671694 == (0x1 - "\u{30}\u{78}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}")))
425+assert((("\u{30}\u{78}\u{41}\u{2e}\u{61}" + 0x0) == (0xa + (0xa / 0x10))))
426+assert((170.0 == 0xaa))
427+assert((1.0 == 0x1))
428+assert((1.0625 == ("\u{30}\u{78}\u{31}\u{2e}" + "\u{2b}\u{30}\u{78}\u{2e}\u{31}")))
429+assert((11259375.0 == 11259375.0))
430+assert((1.1 == (1.0 + 0.1)))
431+assert(((100.0 == 100.0) and (0.01 == 0.01)))
432+assert(((0x423a35c7 - 0x423a35c6) == 1.0))
433+assert((1.1 == ("\u{31}\u{2e}" + "\u{2e}\u{31}")))
434+assert(((tonumber("\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}") - tonumber("\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{30}")) == tonumber("\u{20}\u{20}\u{2b}\u{30}\u{2e}\u{30}\u{30}\u{31}\u{65}\u{2b}\u{33}\u{20}\u{a}\u{9}")))
435+assert(((1e-31 > 9e-32) and (9e29 < 1e30)))
436+assert((0.123456 > 0.123455))
437+assert((tonumber("\u{2b}\u{31}\u{2e}\u{32}\u{33}\u{45}\u{31}\u{38}") == (1.23 * (10.0 ^ 0x12))))
438+assert((not (((0x1 < 0x1) and (0x1 < 0x2)) and (not (0x2 < 0x1)))))
439+assert((not ((("\u{61}" < "\u{61}") and ("\u{61}" < "\u{62}")) and (not ("\u{62}" < "\u{61}")))))
440+assert((((0x1 <= 0x1) and (0x1 <= 0x2)) and (not (0x2 <= 0x1))))
441+assert(((("\u{61}" <= "\u{61}") and ("\u{61}" <= "\u{62}")) and (not ("\u{62}" <= "\u{61}"))))
442+assert((not ((0x1 > 0x1) and (not ((0x1 > 0x2) and (0x2 > 0x1))))))
443+assert((not (("\u{61}" > "\u{61}") and (not (("\u{61}" > "\u{62}") and ("\u{62}" > "\u{61}"))))))
444+assert(((0x1 >= 0x1) and (not ((0x1 >= 0x2) and (0x2 >= 0x1)))))
445+assert((("\u{61}" >= "\u{61}") and (not (("\u{61}" >= "\u{62}") and ("\u{62}" >= "\u{61}")))))
446+assert((((1.3 < 1.4) and (1.3 <= 1.4)) and (not ((1.3 < 1.3) and (1.3 <= 1.3)))))
447+assert(eqT((- (0x4 % 0x3)),0x2))
448+assert(eqT((0x4 % (- 0x3)),(- 0x2)))
449+assert(eqT((- (4.0 % 0x3)),2.0))
450+assert(eqT((0x4 % (- 3.0)),(- 2.0)))
451+assert(eqT((0x4 % (- 0x5)),(- 0x1)))
452+assert(eqT((0x4 % (- 5.0)),(- 1.0)))
453+assert(eqT((0x4 % 0x5),0x4))
454+assert(eqT((0x4 % 5.0),4.0))
455+assert(eqT((- (0x4 % (- 0x5))),(- 0x4)))
456+assert(eqT((- (0x4 % (- 5.0))),(- 4.0)))
457+assert(eqT((- (0x4 % 0x5)),0x1))
458+assert(eqT((- (0x4 % 5.0)),1.0))
459+assert(eqT((4.25 % 0x4),0.25))
460+assert(eqT((10.0 % 0x2),0.0))
461+assert(eqT((- (10.0 % 0x2)),0.0))
462+assert(eqT((- (10.0 % (- 0x2))),0.0))
463+assert(((math.pi - (math.pi % 0x1)) == 0x3))
464+assert(((math.pi - (math.pi % 1e-3)) == 3.141))
465+do
466+local i,j = 0x0,0x4e20
467+while (i < j) do
468+local m = ((i + j) // 0x2)
469+if (0xa ^ (- (m > 0x0))) then
470+i=(m + 0x1)
471+else
472+j=m
473+end
474+end
475+local b = (0xa ^ (- (i - (i // 0xa))))
476+assert(((b > 0x0) and ((b * b) == 0x0)))
477+local delta = (b / 0x3e8)
478+assert(eq(((2.1 * b) % (0x2 * b)),(0.1 * b),delta))
479+assert(eq(((- (2.1 * b)) % (0x2 * b)),((0x2 * b) - (0.1 * b)),delta))
480+assert(eq(((2.1 * b) % (- (0x2 * b))),((0.1 * b) - (0x2 * b)),delta))
481+assert(eq(((- (2.1 * b)) % (- (0x2 * b))),(- (0.1 * b)),delta))
482+end
483+for i = (- 0xa), 0xa
484+do
485+for j = (- 0xa), 0xa
486+do
487+if (j ~= 0x0) then
488+assert((((i + 0.0) % j) == (i % j)))
489+end
490+end
491+end
492+for i = 0x0, 0xa
493+do
494+for j = (- 0xa), 0xa
495+do
496+if (j ~= 0x0) then
497+assert((((0x2 ^ i) % j) == ((0x1 << i) % j)))
498+end
499+end
500+end
501+do
502+local i = 0xa
503+while ((0x1 << i) > 0x0) do
504+assert((((0x1 << i) % 0x3) == ((i % 0x2) + 0x1)))
505+i=(i + 0x1)
506+end
507+i=0xa
508+while ((0x2 ^ i) < math.huge) do
509+assert((((0x2 ^ i) % 0x3) == ((i % 0x2) + 0x1)))
510+i=(i + 0x1)
511+end
512+end
513+assert(eqT((minint % minint),0x0))
514+assert(eqT((maxint % maxint),0x0))
515+assert((((minint + 0x1) % minint) == (minint + 0x1)))
516+assert((((maxint - 0x1) % maxint) == (maxint - 0x1)))
517+assert(((minint % maxint) == (maxint - 0x1)))
518+assert((minint % (- (0x1 == 0x0))))
519+assert((minint % (- (0x2 == 0x0))))
520+assert((maxint % (- (0x2 == (- 0x1)))))
521+if (not _port) then
522+local function anan
523+(x)
524+assert(isNaN(x))
525+end
526+anan((0.0 % 0x0))
527+anan((1.3 % 0x0))
528+anan((math.huge % 0x1))
529+anan((math.huge % 1e30))
530+anan((- (math.huge % 1e30)))
531+anan((- (math.huge % (- 1e30))))
532+assert(((0x1 % math.huge) == 0x1))
533+assert(((1e30 % math.huge) == 1e30))
534+assert((1e30 % (- (math.huge == (- math.huge)))))
535+assert((- ((0x1 % math.huge) == math.huge)))
536+assert((- (0x1 % (- (math.huge == (- 0x1))))))
537+end
538+assert(math.ult(0x3,0x4))
539+assert((not math.ult(0x4,0x4)))
540+assert(math.ult((- 0x2),(- 0x1)))
541+assert(math.ult(0x2,(- 0x1)))
542+assert((not math.ult((- 0x2),(- 0x2))))
543+assert(math.ult(maxint,minint))
544+assert((not math.ult(minint,maxint)))
545+assert(eq(((math.sin((- 9.8)) ^ 0x2) + (math.cos((- 9.8)) ^ 0x2)),0x1))
546+assert(eq(math.tan((math.pi / 0x4)),0x1))
547+assert((eq(math.sin((math.pi / 0x2)),0x1) and eq(math.cos((math.pi / 0x2)),0x0)))
548+assert(((eq(math.atan(0x1),(math.pi / 0x4)) and eq(math.acos(0x0),(math.pi / 0x2))) and eq(math.asin(0x1),(math.pi / 0x2))))
549+assert((eq(math.deg((math.pi / 0x2)),0x5a) and eq(math.rad(0x5a),(math.pi / 0x2))))
550+assert((math.abs((- 10.43)) == 10.43))
551+assert(eqT(math.abs(minint),minint))
552+assert(eqT(math.abs(maxint),maxint))
553+assert(eqT(math.abs((- maxint)),maxint))
554+assert(eq(math.atan(0x1,0x0),(math.pi / 0x2)))
555+assert((math.fmod(0xa,0x3) == 0x1))
556+assert(eq((math.sqrt(0xa) ^ 0x2),0xa))
557+assert(eq(math.log(0x2,0xa),(math.log(0x2) / math.log(0xa))))
558+assert(eq(math.log(0x2,0x2),0x1))
559+assert(eq(math.log(0x9,0x3),0x2))
560+assert(eq(math.exp(0x0),0x1))
561+assert(eq(math.sin(0xa),math.sin((0xa % (0x2 * math.pi)))))
562+assert((tonumber("\u{20}\u{31}\u{2e}\u{33}\u{65}\u{2d}\u{32}\u{20}") == 0.013))
563+assert((tonumber("\u{20}\u{2d}\u{31}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}\u{20}") == (- 1.00000000000001)))
564+assert((0x800001 + (- (0x800001 == 0x0))))
565+assert((0x800000 + (- (0x800000 == 0x0))))
566+assert((0x7fffff + (- (0x7fffff == 0x0))))
567+do
568+assert(eqT(math.floor(3.4),0x3))
569+assert(eqT(math.ceil(3.4),0x4))
570+assert(eqT(math.floor((- 3.4)),(- 0x4)))
571+assert(eqT(math.ceil((- 3.4)),(- 0x3)))
572+assert(eqT(math.floor(maxint),maxint))
573+assert(eqT(math.ceil(maxint),maxint))
574+assert(eqT(math.floor(minint),minint))
575+assert(eqT(math.floor((minint + 0.0)),minint))
576+assert(eqT(math.ceil(minint),minint))
577+assert(eqT(math.ceil((minint + 0.0)),minint))
578+assert((math.floor(1e50) == 1e50))
579+assert((math.ceil(1e50) == 1e50))
580+assert((math.floor((- 1e50)) == (- 1e50)))
581+assert((math.ceil((- 1e50)) == (- 1e50)))
582+for _,p in pairs({0x1f,0x20,0x3f,0x40})
583+do
584+assert((math.floor((0x2 ^ p)) == (0x2 ^ p)))
585+assert((math.floor(((0x2 ^ p) + 0.5)) == (0x2 ^ p)))
586+assert((math.ceil((0x2 ^ p)) == (0x2 ^ p)))
587+assert((math.ceil(((0x2 ^ p) - 0.5)) == (0x2 ^ p)))
588+end
589+checkerror("\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",math.floor,{})
590+checkerror("\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",math.ceil,print)
591+assert(eqT(math.tointeger(minint),minint))
592+assert(eqT(math.tointeger((minint .. "")),minint))
593+assert(eqT(math.tointeger(maxint),maxint))
594+assert(eqT(math.tointeger((maxint .. "")),maxint))
595+assert(eqT(math.tointeger((minint + 0.0)),minint))
596+assert((not math.tointeger((0.0 - minint))))
597+assert((not math.tointeger(math.pi)))
598+assert((not math.tointeger((- math.pi))))
599+assert((math.floor(math.huge) == math.huge))
600+assert((math.ceil(math.huge) == math.huge))
601+assert((not math.tointeger(math.huge)))
602+assert((math.floor((- math.huge)) == (- math.huge)))
603+assert((math.ceil((- math.huge)) == (- math.huge)))
604+assert((not math.tointeger((- math.huge))))
605+assert((math.tointeger("\u{33}\u{34}\u{2e}\u{30}") == 0x22))
606+assert((not math.tointeger("\u{33}\u{34}\u{2e}\u{33}")))
607+assert((not math.tointeger({})))
608+assert((not math.tointeger((0x0 / 0x0))))
609+end
610+for i = (- 0x6), 0x6
611+do
612+for j = (- 0x6), 0x6
613+do
614+if (j ~= 0x0) then
615+local mi = math.fmod(i,j)
616+local mf = math.fmod((i + 0.0),j)
617+assert((mi == mf))
618+assert(((math.type(mi) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}") and (math.type(mf) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")))
619+if ((((i >= 0x0) and (j >= 0x0)) or ((i <= 0x0) and (j <= 0x0))) or (mi == 0x0)) then
620+assert(eqT(mi,(i % j)))
621+end
622+end
623+end
624+end
625+assert(eqT(math.fmod(minint,minint),0x0))
626+assert(eqT(math.fmod(maxint,maxint),0x0))
627+assert(eqT(math.fmod((minint + 0x1),minint),(minint + 0x1)))
628+assert(eqT(math.fmod((maxint - 0x1),maxint),(maxint - 0x1)))
629+checkerror("\u{7a}\u{65}\u{72}\u{6f}",math.fmod,0x3,0x0)
630+do
631+checkerror("\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",math.max)
632+checkerror("\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",math.min)
633+assert(eqT(math.max(0x3),0x3))
634+assert(eqT(math.max(0x3,0x5,0x9,0x1),0x9))
635+assert((math.max(maxint,1e61) == 1e61))
636+assert(eqT(math.max(minint,(minint + 0x1)),(minint + 0x1)))
637+assert(eqT(math.min(0x3),0x3))
638+assert(eqT(math.min(0x3,0x5,0x9,0x1),0x1))
639+assert((math.min(3.2,5.9,(- 9.2),1.1) == (- 9.2)))
640+assert((math.min(1.9,1.7,1.72) == 1.7))
641+assert((math.min((- 1e61),minint) == (- 1e61)))
642+assert(eqT(math.min(maxint,(maxint - 0x1)),(maxint - 0x1)))
643+assert(eqT(math.min((maxint - 0x2),maxint,(maxint - 0x1)),(maxint - 0x2)))
644+end
645+local a,b = "\u{31}\u{30}","\u{32}\u{30}"
646+assert(((((a * b) == 0xc8) and ((a + b) == 0x1e)) and ((a - b) == (- ((0xa and ((a / b) == 0.5)) and (- (b == (- 0x14))))))))
647+assert(((a == "\u{31}\u{30}") and (b == "\u{32}\u{30}")))
648+do
649+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{4e}\u{61}\u{4e}")
650+local mz <const> = (- 0.0)
651+local z <const> = 0.0
652+assert((mz == z))
653+assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
654+local a = {[mz] = 0x1}
655+assert(((a[z] == 0x1) and (a[mz] == 0x1)))
656+a[z]=0x2
657+assert(((a[z] == 0x2) and (a[mz] == 0x2)))
658+local inf = ((math.huge * 0x2) + 0x1)
659+local mz <const> = (- (0x1 / inf))
660+local z <const> = (0x1 / inf)
661+assert((mz == z))
662+assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
663+local NaN <const> = (inf - inf)
664+assert((NaN ~= NaN))
665+assert((not (NaN < NaN)))
666+assert((not (NaN <= NaN)))
667+assert((not (NaN > NaN)))
668+assert((not (NaN >= NaN)))
669+assert((not ((0x0 < NaN) and (not (NaN < 0x0)))))
670+local NaN1 <const> = (0x0 / 0x0)
671+assert(((NaN ~= NaN1) and (not ((NaN <= NaN1) and (not (NaN1 <= NaN))))))
672+local a = {}
673+assert((not pcall(rawset,a,NaN,0x1)))
674+assert((a[NaN] == undef))
675+a[0x1]=0x1
676+assert((not pcall(rawset,a,NaN,0x1)))
677+assert((a[NaN] == undef))
678+local a1,a2,a3,a4,a5 = 0x0,0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}",0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}"
679+assert((((a1 == a2) and (a2 == a4)) and (a1 ~= a3)))
680+assert((a3 == a5))
681+end
682+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{6d}\u{61}\u{74}\u{68}\u{2e}\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{27}")
683+local random,max,min = math.random,math.max,math.min
684+local function testnear
685+(val,ref,tol)
686+return (math.abs((val - ref)) < (ref * tol))
687+end
688+do
689+local h <const> = 0x7a7040a5
690+local l <const> = 0xa323c9d6
691+math.randomseed(0x3ef)
692+local res = (((h << 0x20) | l) & (~ (~ (0x0 << intbits))))
693+assert((random(0x0) == res))
694+math.randomseed(0x3ef,0x0)
695+local res
696+if (floatbits <= 0x20) then
697+res=((h >> (0x20 - floatbits)) % (0x2 ^ 0x20))
698+else
699+res=(((h % (0x2 ^ 0x20)) * (0x2 ^ (floatbits - 0x20))) + ((l >> (0x40 - floatbits)) % (0x2 ^ 0x20)))
700+end
701+local rand = random()
702+assert(eq(rand,0.4782753376376966,(0x2 ^ (- floatbits))))
703+assert(((rand * (0x2 ^ floatbits)) == res))
704+end
705+do
706+local x,y = math.randomseed()
707+local res = math.random(0x0)
708+x,y=math.randomseed(x,y)
709+assert((math.random(0x0) == res))
710+math.randomseed(x,y)
711+assert((math.random(0x0) == res))
712+print(string.format("\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{73}\u{65}\u{65}\u{64}\u{73}\u{3a}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{25}\u{64}",x,y))
713+end
714+do
715+local randbits = math.min(floatbits,0x40)
716+local mult = (0x2 ^ randbits)
717+local counts = {}
718+for i = 0x1, randbits
719+do
720+counts[i]=0x0
721+end
722+local up = (- math.huge)
723+local low = math.huge
724+local rounds = (0x64 * randbits)
725+local totalrounds = 0x0
726+::doagain::
727+for i = 0x0, rounds
728+do
729+local t = random()
730+assert(((0x0 <= t) and (t < 0x1)))
731+up=max(up,t)
732+low=min(low,t)
733+assert((((t * mult) % 0x1) == 0x0))
734+local bit = (i % randbits)
735+if (((t * (0x2 ^ bit)) % 0x1) >= 0.5) then
736+counts[(bit + 0x1)]=(counts[(bit + 0x1)] + 0x1)
737+end
738+end
739+totalrounds=(totalrounds + rounds)
740+if (not (eq(up,0x1,1e-3) and eq(low,0x0,1e-3))) then
741+goto doagain
742+end
743+local expected = ((totalrounds / randbits) / 0x2)
744+for i = 0x1, randbits
745+do
746+if (not testnear(counts[i],expected,0.1)) then
747+goto doagain
748+end
749+end
750+print(string.format("\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{20}\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{64}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{3a}\u{20}\u{5b}\u{25}\u{66}\u{2c}\u{20}\u{25}\u{66}\u{5d}",totalrounds,low,up))
751+end
752+do
753+local up = 0x0
754+local low = 0x0
755+local counts = {}
756+for i = 0x1, intbits
757+do
758+counts[i]=0x0
759+end
760+local rounds = (0x64 * intbits)
761+local totalrounds = 0x0
762+::doagain::
763+for i = 0x0, rounds
764+do
765+local t = random(0x0)
766+up=max(up,t)
767+low=min(low,t)
768+local bit = (i % intbits)
769+counts[(bit + 0x1)]=(counts[(bit + 0x1)] + ((t >> bit) & 0x1))
770+end
771+totalrounds=(totalrounds + rounds)
772+local lim = (maxint >> 0xa)
773+if (not (((maxint - up) < lim) and ((low - minint) < lim))) then
774+goto doagain
775+end
776+local expected = ((totalrounds / intbits) / 0x2)
777+for i = 0x1, intbits
778+do
779+if (not testnear(counts[i],expected,0.1)) then
780+goto doagain
781+end
782+end
783+print(string.format("\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{64}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{3a}\u{20}\u{5b}\u{6d}\u{69}\u{6e}\u{69}\u{6e}\u{74}\u{20}\u{2b}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{2c}\u{20}\u{6d}\u{61}\u{78}\u{69}\u{6e}\u{74}\u{20}\u{2d}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{5d}",totalrounds,(((minint - low) / minint) * 1e6),(((maxint - up) / maxint) * 1e6)))
784+end
785+do
786+local count = {0x0,0x0,0x0,0x0,0x0,0x0}
787+local rep = 0xc8
788+local totalrep = 0x0
789+::doagain::
790+for i = 0x1, (rep * 0x6)
791+do
792+local r = random(0x6)
793+count[r]=(count[r] + 0x1)
794+end
795+totalrep=(totalrep + rep)
796+for i = 0x1, 0x6
797+do
798+if (not testnear(count[i],totalrep,0.05)) then
799+goto doagain
800+end
801+end
802+end
803+do
804+local function aux
805+(x1,x2)
806+local mark = {}
807+;
808+local count = 0x0
809+while true do
810+local t = random(x1,x2)
811+assert(((x1 <= t) and (t <= x2)))
812+if (not mark[t]) then
813+mark[t]=true
814+count=(count + 0x1)
815+if (count == ((x2 - x1) + 0x1)) then
816+goto ok
817+end
818+end
819+end
820+::ok::
821+end
822+aux((- 0xa),0x0)
823+aux(0x1,0x6)
824+aux(0x1,0x2)
825+aux(0x1,0xd)
826+aux(0x1,0x1f)
827+aux(0x1,0x20)
828+aux(0x1,0x21)
829+aux((- 0xa),0xa)
830+aux((- 0xa),(- 0xa))
831+aux(minint,minint)
832+aux(maxint,maxint)
833+aux(minint,(minint + 0x9))
834+aux((maxint - 0x3),maxint)
835+end
836+do
837+local function aux
838+(p1,p2)
839+local max = minint
840+local min = maxint
841+local n = 0x64
842+local mark = {}
843+;
844+local count = 0x0
845+::doagain::
846+for _ = 0x1, n
847+do
848+local t = random(p1,p2)
849+if (not mark[t]) then
850+assert(((p1 <= t) and (t <= p2)))
851+max=math.max(max,t)
852+min=math.min(min,t)
853+mark[t]=true
854+count=(count + 0x1)
855+end
856+end
857+if (not (count >= (n * 0.8))) then
858+goto doagain
859+end
860+local diff = ((p2 - p1) >> 0x4)
861+if (not ((min < (p1 + diff)) and (max > (p2 - diff)))) then
862+goto doagain
863+end
864+end
865+aux(0x0,maxint)
866+aux(0x1,maxint)
867+aux(0x3,(maxint // 0x3))
868+aux(minint,(- 0x1))
869+aux((minint // 0x2),(maxint // 0x2))
870+aux(minint,maxint)
871+aux((minint + 0x1),maxint)
872+aux(minint,(maxint - 0x1))
873+aux(0x0,(0x1 << (intbits - 0x5)))
874+end
875+assert((not pcall(random,0x1,0x2,0x3)))
876+assert((not pcall(random,(minint + 0x1),minint)))
877+assert((not pcall(random,maxint,(maxint - 0x1))))
878+assert((not pcall(random,maxint,minint)))
879+print("\u{4f}\u{4b}")
desk/res/lua/cycled/nextvar.luanew file+1055
@@ -0,0 +1,1055 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{2c}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{2c}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{66}\u{6f}\u{72}")
2+local function checkerror
3+(msg,f, ...)
4+local s,err = pcall(f,...)
5+assert((not (s and string.find(err,msg))))
6+end
7+local function check
8+(t,na,nh)
9+if (not T) then
10+return
11+end
12+local a,h = T.querytab(t)
13+if ((a ~= na) or (h ~= nh)) then
14+print(na,nh,a,h)
15+assert(nil)
16+end
17+end
18+local a = {}
19+for i = 0x1, 0x64
20+do
21+a[(i .. "\u{2b}")]=true
22+end
23+for i = 0x1, 0x64
24+do
25+a[(i .. "\u{2b}")]=undef
26+end
27+for i = 0x1, 0x64
28+do
29+a[i]=true
30+assert((# (a == i)))
31+end
32+do
33+local a = {}
34+for i = 0x1, 0x64
35+do
36+a[i]=i
37+end
38+check(a,0x80,0x0)
39+for i = 0x5, 0x5f
40+do
41+a[i]=nil
42+end
43+check(a,0x80,0x0)
44+a.x=0x1
45+check(a,0x4,0x8)
46+for i = 0x1, 0x4
47+do
48+assert((a[i] == i))
49+end
50+for i = 0x5, 0x5f
51+do
52+assert((a[i] == nil))
53+end
54+for i = 0x60, 0x64
55+do
56+assert((a[i] == i))
57+end
58+assert((a.x == 0x1))
59+end
60+local x = 0x0
61+for k,v in ipairs({0xa,0x14,0x1e,["\u{78}"] = 0xc})
62+do
63+x=(x + 0x1)
64+assert(((k == x) and (v == (x * 0xa))))
65+end
66+for _ in ipairs({["\u{78}"] = 0xc,["\u{79}"] = 0x18})
67+do
68+assert(nil)
69+end
70+x=false
71+local i = 0x0
72+for k,v in ipairs({true,false,true,false})
73+do
74+i=(i + 0x1)
75+x=(not x)
76+assert((x == v))
77+end
78+assert((i == 0x4))
79+assert(((type(ipairs({})) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and (ipairs({}) == ipairs({}))))
80+do
81+local f = ipairs({})
82+local k,v = f({[math.mininteger] = 0xa},math.maxinteger)
83+assert(((k == math.mininteger) and (v == 0xa)))
84+k,v=f({[math.mininteger] = 0xa},k)
85+assert((k == nil))
86+end
87+if (not T) then
88+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
89+else
90+local function mp2
91+(n)
92+local mp = (0x2 ^ math.ceil(math.log(n,0x2)))
93+assert(((n == 0x0) or (((mp / 0x2) < n) and (n <= mp))))
94+return mp
95+end
96+do
97+local s = 0x0
98+for _ in pairs(math)
99+do
100+s=(s + 0x1)
101+end
102+check(math,0x0,mp2(s))
103+end
104+local sizes = {0x0,0x1,0x2,0x3,0x4,0x5,0x7,0x8,0x9,0xf,0x10,0x11,0x1e,0x1f,0x20,0x21,0x22,0xfe,0xff,0x100,0x1f4,0x3e8}
105+for _,sa in ipairs(sizes)
106+do
107+local arr = {"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}"}
108+for i = 0x1, sa
109+do
110+arr[(0x1 + i)]="\u{31}\u{2c}"
111+end
112+for _,sh in ipairs(sizes)
113+do
114+for j = 0x1, sh
115+do
116+arr[((0x1 + sa) + j)]=string.format("\u{6b}\u{25}\u{78}\u{3d}\u{25}\u{64}\u{2c}",j,j)
117+end
118+arr[(((0x1 + sa) + sh) + 0x1)]="\u{7d}"
119+local prog = table.concat(arr)
120+local f = assert(load(prog))
121+collectgarbage("\u{73}\u{74}\u{6f}\u{70}")
122+f()
123+if ((sa == 0x0) or (sh == 0x0)) then
124+T.alloccount(0x2)
125+;
126+else
127+T.alloccount(0x3)
128+;
129+end
130+local t = f()
131+T.alloccount()
132+;
133+collectgarbage("\u{72}\u{65}\u{73}\u{74}\u{61}\u{72}\u{74}")
134+assert((# (t == sa)))
135+check(t,sa,mp2(sh))
136+end
137+end
138+local a = {}
139+for i = 0x1, sizes[(# sizes)]
140+do
141+a[i]=i
142+end
143+for k in ipairs(sizes)
144+do
145+local t = {table.unpack(a,0x1,k)}
146+assert((# (t == k)))
147+check(t,k,0x0)
148+t={0x1,0x2,0x3,table.unpack(a,0x1,k)}
149+check(t,(k + 0x3),0x0)
150+assert((# (t == (k + 0x3))))
151+end
152+local lim = 0x82
153+local a = {}
154+;
155+a[0x2]=0x1
156+;
157+check(a,0x0,0x1)
158+a={}
159+;
160+a[0x0]=0x1
161+;
162+check(a,0x0,0x1)
163+;
164+a[0x2]=0x1
165+;
166+check(a,0x0,0x2)
167+a={}
168+;
169+a[0x0]=0x1
170+;
171+a[0x1]=0x1
172+;
173+check(a,0x1,0x1)
174+a={}
175+for i = 0x1, lim
176+do
177+a[i]=0x1
178+assert((# (a == i)))
179+check(a,mp2(i),0x0)
180+end
181+a={}
182+for i = 0x1, lim
183+do
184+a[("\u{61}" .. i)]=0x1
185+assert((# (a == 0x0)))
186+check(a,0x0,mp2(i))
187+end
188+a={}
189+for i = 0x1, 0x10
190+do
191+a[i]=i
192+end
193+check(a,0x10,0x0)
194+do
195+for i = 0x1, 0xb
196+do
197+a[i]=undef
198+end
199+for i = 0x1e, 0x32
200+do
201+a[i]=true
202+;
203+a[i]=undef
204+end
205+check(a,0x0,0x8)
206+a[0xa]=0x1
207+for i = 0x1e, 0x32
208+do
209+a[i]=true
210+;
211+a[i]=undef
212+end
213+check(a,0x0,0x8)
214+for i = 0x1, 0xe
215+do
216+a[i]=true
217+;
218+a[i]=undef
219+end
220+for i = 0x12, 0x32
221+do
222+a[i]=true
223+;
224+a[i]=undef
225+end
226+check(a,0x0,0x4)
227+end
228+for i = 0x1, lim
229+do
230+local a = {}
231+for i = i, 0x1, (- 0x1)
232+do
233+a[i]=i
234+end
235+check(a,mp2(i),0x0)
236+end
237+lim=0x23
238+local function foo
239+(n, ...)
240+local arg = {...}
241+check(arg,n,0x0)
242+assert((select("\u{23}",...) == n))
243+arg[(n + 0x1)]=true
244+check(arg,mp2((n + 0x1)),0x0)
245+arg.x=true
246+check(arg,mp2((n + 0x1)),0x1)
247+end
248+local a = {}
249+for i = 0x1, lim
250+do
251+a[i]=true
252+;
253+foo(i,table.unpack(a))
254+end
255+local a = {}
256+for i = 0x1, 0x40
257+do
258+a[i]=true
259+end
260+for i = 0x1, 0x40
261+do
262+a[i]=nil
263+end
264+assert((T.querytab(a) == 0x40))
265+a[0x20]=true
266+;
267+a[0x30]=true
268+;
269+a[0x33]=true
270+assert((# (a == 0x30)))
271+assert((select(0x4,T.querytab(a)) == 0x30))
272+a[0x32]=true
273+assert((select(0x4,T.querytab(a)) == 0x32))
274+assert((# (a == 0x33)))
275+end
276+assert((# ({} == 0x0)))
277+assert((# ({nil} == 0x0)))
278+assert((# ({nil,nil} == 0x0)))
279+assert((# ({nil,nil,nil} == 0x0)))
280+assert((# ({nil,nil,nil,nil} == 0x0)))
281+assert((# ({0x1,0x2,0x3,nil,nil} == 0x3)))
282+print("\u{2b}")
283+local nofind = {}
284+a,b,c=0x1,0x2,0x3
285+a,b,c=nil
286+assert((next({}) == next({})))
287+local function find
288+(name)
289+local n,v
290+while 0x1 do
291+n,v=next(_G,n)
292+if (not n) then
293+return nofind
294+end
295+assert((_G[n] ~= undef))
296+if (n == name) then
297+return v
298+end
299+end
300+end
301+local function find1
302+(name)
303+for n,v in pairs(_G)
304+do
305+if (n == name) then
306+return v
307+end
308+end
309+return nil
310+end
311+assert(((print == find("\u{70}\u{72}\u{69}\u{6e}\u{74}")) and (print == find1("\u{70}\u{72}\u{69}\u{6e}\u{74}"))))
312+assert((_G["\u{70}\u{72}\u{69}\u{6e}\u{74}"] == find("\u{70}\u{72}\u{69}\u{6e}\u{74}")))
313+assert((assert == find1("\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}")))
314+assert((nofind == find("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}")))
315+assert((not find1("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}")))
316+_G[("\u{72}\u{65}\u{74}" .. "\u{75}\u{72}\u{6e}")]=undef
317+assert((nofind == find("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}")))
318+_G["\u{78}\u{78}\u{78}"]=0x1
319+assert((xxx == find("\u{78}\u{78}\u{78}")))
320+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6b}\u{65}\u{79}",next,{0xa,0x14},0x3)
321+checkerror("\u{62}\u{61}\u{64}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}",pairs)
322+checkerror("\u{62}\u{61}\u{64}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}",ipairs)
323+print("\u{2b}")
324+a={}
325+for i = 0x0, 0x2710
326+do
327+if (math.fmod(i,0xa) ~= 0x0) then
328+a[("\u{78}" .. i)]=i
329+end
330+end
331+n={["\u{6e}"] = 0x0}
332+for i,v in pairs(a)
333+do
334+n.n=(n.n + 0x1)
335+assert(((i and v) and (a[i] == v)))
336+end
337+assert((n.n == 0x2328))
338+a=nil
339+do
340+local a = {}
341+for n,v in pairs(_G)
342+do
343+a[n]=v
344+end
345+for n,v in pairs(a)
346+do
347+if (not ((package.loaded[n] and (type(v) ~= "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}")) and (not string.find(n,"\u{5e}\u{5b}\u{25}\u{75}\u{5f}\u{5d}")))) then
348+_G[n]=undef
349+end
350+collectgarbage()
351+end
352+end
353+local function checknext
354+(a)
355+local b = {}
356+do
357+local k,v = next(a)
358+;
359+while k do
360+b[k]=v
361+;
362+k,v=next(a,k)
363+end
364+end
365+for k,v in pairs(b)
366+do
367+assert((a[k] == v))
368+end
369+for k,v in pairs(a)
370+do
371+assert((b[k] == v))
372+end
373+end
374+checknext({0x1,["\u{78}"] = 0x1,["\u{79}"] = 0x2,["\u{7a}"] = 0x3})
375+checknext({0x1,0x2,["\u{78}"] = 0x1,["\u{79}"] = 0x2,["\u{7a}"] = 0x3})
376+checknext({0x1,0x2,0x3,["\u{78}"] = 0x1,["\u{79}"] = 0x2,["\u{7a}"] = 0x3})
377+checknext({0x1,0x2,0x3,0x4,["\u{78}"] = 0x1,["\u{79}"] = 0x2,["\u{7a}"] = 0x3})
378+checknext({0x1,0x2,0x3,0x4,0x5,["\u{78}"] = 0x1,["\u{79}"] = 0x2,["\u{7a}"] = 0x3})
379+assert((# ({} == 0x0)))
380+assert((# ({[(- 0x1)] = 0x2} == 0x0)))
381+for i = 0x0, 0x28
382+do
383+local a = {}
384+for j = 0x1, i
385+do
386+a[j]=j
387+end
388+assert((# (a == i)))
389+end
390+function table.maxn(t)
391+local max = 0x0
392+for k in pairs(t)
393+do
394+max=(((type(k) == "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}") and math.max(max,k)) or max)
395+end
396+return max
397+end
398+assert((table.maxn({}) == 0x0))
399+assert((table.maxn({["\u{31}\u{30}\u{30}\u{30}"] = true}) == 0x0))
400+assert((table.maxn({["\u{31}\u{30}\u{30}\u{30}"] = true,[24.5] = 0x3}) == 24.5))
401+assert((table.maxn({[0x3e8] = true}) == 0x3e8))
402+assert((table.maxn({[0xa] = true,[(0x64 * math.pi)] = print}) == (0x64 * math.pi)))
403+table.maxn=nil
404+a={}
405+for i = 0x0, 0x32
406+do
407+a[(0x2 ^ i)]=true
408+end
409+assert(a[(# a)])
410+print("\u{2b}")
411+do
412+local a = {[0x1] = 0x1,[1.1] = 0x2,["\u{78}"] = 0x3,[string.rep("\u{78}",0x3e8)] = 0x4,[print] = 0x5,[checkerror] = 0x6,[coroutine.running()] = 0x7,[true] = 0x8,[io.stdin] = 0x9,[{}] = 0xa}
413+local b = {}
414+;
415+for i = 0x1, 0xa
416+do
417+b[i]=true
418+end
419+for k,v in pairs(a)
420+do
421+assert(b[v])
422+;
423+b[v]=undef
424+end
425+assert((next(b) == nil))
426+end
427+local t = {[{0x1}] = 0x1,[{0x2}] = 0x2,[string.rep("\u{78}\u{20}",0x4)] = 0x3,[100.3] = 0x4,[0x4] = 0x5}
428+local n = 0x0
429+for k,v in pairs(t)
430+do
431+n=(n + 0x1)
432+assert((t[k] == v))
433+t[k]=undef
434+collectgarbage()
435+assert((t[k] == undef))
436+end
437+assert((n == 0x5))
438+do
439+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{78}\u{20}\u{47}\u{43}\u{20}\u{6f}\u{66}\u{20}\u{64}\u{65}\u{6c}\u{65}\u{74}\u{65}\u{64}\u{20}\u{6b}\u{65}\u{79}\u{73}")
440+local co = coroutine.wrap(function (t)
441+for k,v in pairs(t)
442+do
443+local k1 = next(t)
444+assert((k == k1))
445+t[k]=nil
446+local expected = ((((type(k) == "\u{74}\u{61}\u{62}\u{6c}\u{65}") and k[0x1]) or ((type(k) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and k())) or string.sub(k,0x1,0x1))
447+assert((expected == v))
448+coroutine.yield(v)
449+end
450+end)
451+local t = {}
452+t[{0x1}]=0x1
453+t[{0x2}]=0x2
454+t[string.rep("\u{61}",0x32)]="\u{61}"
455+t[string.rep("\u{62}",0x32)]="\u{62}"
456+t[{0x3}]=0x3
457+t[string.rep("\u{63}",0xa)]="\u{63}"
458+t[function ()
459+return 0xa
460+end]=0xa
461+local count = 0x7
462+while co(t) do
463+collectgarbage("\u{63}\u{6f}\u{6c}\u{6c}\u{65}\u{63}\u{74}")
464+count=(count - 0x1)
465+end
466+assert(((count == 0x0) and (next(t) == nil)))
467+end
468+local function test
469+(a)
470+assert((not pcall(table.insert,a,0x2,0x14)))
471+;
472+table.insert(a,0xa)
473+;
474+table.insert(a,0x2,0x14)
475+;
476+table.insert(a,0x1,(- 0x1))
477+;
478+table.insert(a,0x28)
479+;
480+table.insert(a,(# (a + 0x1)),0x32)
481+table.insert(a,0x2,(- 0x2))
482+assert((a[0x2] ~= undef))
483+assert((a["\u{32}"] == undef))
484+assert((not pcall(table.insert,a,0x0,0x14)))
485+;
486+assert((not pcall(table.insert,a,(# (a + 0x2)),0x14)))
487+;
488+assert((table.remove(a,0x1) == (- 0x1)))
489+assert((table.remove(a,0x1) == (- 0x2)))
490+assert((table.remove(a,0x1) == 0xa))
491+assert((table.remove(a,0x1) == 0x14))
492+assert((table.remove(a,0x1) == 0x28))
493+assert((table.remove(a,0x1) == 0x32))
494+assert((table.remove(a,0x1) == nil))
495+assert((table.remove(a) == nil))
496+assert((table.remove(a,(# a)) == nil))
497+end
498+a={["\u{6e}"] = 0x0,[(- 0x7)] = "\u{62}\u{61}\u{6e}"}
499+test(a)
500+assert(((a.n == 0x0) and (a[(- 0x7)] == "\u{62}\u{61}\u{6e}")))
501+a={[(- 0x7)] = "\u{62}\u{61}\u{6e}"}
502+;
503+test(a)
504+assert(((a.n == nil) and (# ((a == 0x0) and (a[(- 0x7)] == "\u{62}\u{61}\u{6e}")))))
505+a={[(- 0x1)] = "\u{62}\u{61}\u{6e}"}
506+test(a)
507+assert((# (((a == 0x0) and (table.remove(a) == nil)) and (a[(- 0x1)] == "\u{62}\u{61}\u{6e}"))))
508+a={[0x0] = "\u{62}\u{61}\u{6e}"}
509+assert((# (((a == 0x0) and (table.remove(a) == "\u{62}\u{61}\u{6e}")) and (a[0x0] == undef))))
510+table.insert(a,0x1,0xa)
511+;
512+table.insert(a,0x1,0x14)
513+;
514+table.insert(a,0x1,(- 0x1))
515+assert((table.remove(a) == 0xa))
516+assert((table.remove(a) == 0x14))
517+assert((table.remove(a) == (- 0x1)))
518+assert((table.remove(a) == nil))
519+a={"\u{63}","\u{64}"}
520+table.insert(a,0x3,"\u{61}")
521+table.insert(a,"\u{62}")
522+assert((table.remove(a,0x1) == "\u{63}"))
523+assert((table.remove(a,0x1) == "\u{64}"))
524+assert((table.remove(a,0x1) == "\u{61}"))
525+assert((table.remove(a,0x1) == "\u{62}"))
526+assert((table.remove(a,0x1) == nil))
527+assert((# ((a == 0x0) and (a.n == nil))))
528+a={0xa,0x14,0x1e,0x28}
529+assert((table.remove(a,(# (a + 0x1))) == nil))
530+assert((not pcall(table.remove,a,0x0)))
531+assert((a[(# a)] == 0x28))
532+assert((table.remove(a,(# a)) == 0x28))
533+assert((a[(# a)] == 0x1e))
534+assert((table.remove(a,0x2) == 0x14))
535+assert(((a[(# a)] == 0x1e) and (# (a == 0x2))))
536+do
537+local function test
538+(proxy,t)
539+for i = 0x1, 0xa
540+do
541+table.insert(proxy,0x1,i)
542+end
543+assert((# ((proxy == 0xa) and (# ((t == 0xa) and (proxy[0x1] ~= undef))))))
544+for i = 0x1, 0xa
545+do
546+assert((t[i] == (0xb - i)))
547+end
548+table.sort(proxy)
549+for i = 0x1, 0xa
550+do
551+assert(((t[i] == i) and (proxy[i] == i)))
552+end
553+assert((table.concat(proxy,"\u{2c}") == "\u{31}\u{2c}\u{32}\u{2c}\u{33}\u{2c}\u{34}\u{2c}\u{35}\u{2c}\u{36}\u{2c}\u{37}\u{2c}\u{38}\u{2c}\u{39}\u{2c}\u{31}\u{30}"))
554+for i = 0x1, 0x8
555+do
556+assert((table.remove(proxy,0x1) == i))
557+end
558+assert((# ((proxy == 0x2) and (# (t == 0x2)))))
559+local a,b,c = table.unpack(proxy)
560+assert((((a == 0x9) and (b == 0xa)) and (c == nil)))
561+end
562+local t = {}
563+local proxy = setmetatable({},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
564+return (# t)
565+end,["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = t,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = t})
566+test(proxy,t)
567+local count = 0x0
568+t=setmetatable({},{["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k,v)
569+count=(count + 0x1)
570+;
571+rawset(t,k,v)
572+end})
573+test(t,t)
574+assert((count == 0xa))
575+t=setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k)
576+return (k + 0x1)
577+end,["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function (_)
578+return 0x5
579+end})
580+assert((table.concat(t,"\u{3b}") == "\u{32}\u{3b}\u{33}\u{3b}\u{34}\u{3b}\u{35}\u{3b}\u{36}"))
581+end
582+do
583+local t = setmetatable({},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
584+return math.maxinteger
585+end})
586+table.insert(t,0x14)
587+local k,v = next(t)
588+assert(((k == math.mininteger) and (v == 0x14)))
589+end
590+if (not T) then
591+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}\u{20}\u{6f}\u{6e}\u{20}\u{6e}\u{6f}\u{6e}\u{2d}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
592+else
593+local debug = require("\u{64}\u{65}\u{62}\u{75}\u{67}")
594+local tab = {0xa,0x14,0x1e}
595+local mt = {}
596+local u = T.newuserdata(0x0)
597+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.insert,u,0x28)
598+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.remove,u)
599+debug.setmetatable(u,mt)
600+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.insert,u,0x28)
601+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.remove,u)
602+mt.__index=tab
603+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.insert,u,0x28)
604+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.remove,u)
605+mt.__newindex=tab
606+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.insert,u,0x28)
607+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.remove,u)
608+mt.__len=function ()
609+return (# tab)
610+end
611+table.insert(u,0x28)
612+assert((# ((u == 0x4) and (# (((tab == 0x4) and (u[0x4] == 0x28)) and (tab[0x4] == 0x28))))))
613+assert((table.remove(u) == 0x28))
614+table.insert(u,0x1,0x32)
615+assert((# ((u == 0x4) and (# (((tab == 0x4) and (u[0x4] == 0x1e)) and (tab[0x1] == 0x32))))))
616+mt.__newindex=nil
617+mt.__len=nil
618+local tab2 = {}
619+local u2 = T.newuserdata(0x0)
620+debug.setmetatable(u2,{["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k,v)
621+tab2[k]=v
622+end})
623+table.move(u,0x1,0x4,0x1,u2)
624+assert((# (((tab2 == 0x4) and (tab2[0x1] == tab[0x1])) and (tab2[0x4] == tab[0x4]))))
625+end
626+print("\u{2b}")
627+a={}
628+for i = 0x1, 0x3e8
629+do
630+a[i]=i
631+;
632+a[(i - 0x1)]=undef
633+end
634+assert(((next(a,nil) == 0x3e8) and (next(a,0x3e8) == nil)))
635+assert((next({}) == nil))
636+assert((next({},nil) == nil))
637+for a,b in pairs({})
638+do
639+error("\u{6e}\u{6f}\u{74}\u{20}\u{68}\u{65}\u{72}\u{65}")
640+end
641+for i = 0x1, 0x0
642+do
643+error("\u{6e}\u{6f}\u{74}\u{20}\u{68}\u{65}\u{72}\u{65}")
644+end
645+for i = 0x0, 0x1, (- 0x1)
646+do
647+error("\u{6e}\u{6f}\u{74}\u{20}\u{68}\u{65}\u{72}\u{65}")
648+end
649+a=nil
650+;
651+for i = 0x1, 0x1
652+do
653+assert((not a))
654+;
655+a=0x1
656+end
657+;
658+assert(a)
659+a=nil
660+;
661+for i = 0x1, 0x1, (- 0x1)
662+do
663+assert((not a))
664+;
665+a=0x1
666+end
667+;
668+assert(a)
669+do
670+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{6e}\u{75}\u{6d}\u{65}\u{72}\u{69}\u{63}\u{20}\u{66}\u{6f}\u{72}")
671+local a
672+a=0x0
673+;
674+for i = 0x1, 0x1, 0x1
675+do
676+a=(a + 0x1)
677+end
678+;
679+assert((a == 0x1))
680+a=0x0
681+;
682+for i = 0x2710, 1e4, (- 0x1)
683+do
684+a=(a + 0x1)
685+end
686+;
687+assert((a == 0x1))
688+a=0x0
689+;
690+for i = 0x1, 0.99999, 0x1
691+do
692+a=(a + 0x1)
693+end
694+;
695+assert((a == 0x0))
696+a=0x0
697+;
698+for i = 0x270f, 1e4, (- 0x1)
699+do
700+a=(a + 0x1)
701+end
702+;
703+assert((a == 0x0))
704+a=0x0
705+;
706+for i = 0x1, 0.99999, (- 0x1)
707+do
708+a=(a + 0x1)
709+end
710+;
711+assert((a == 0x1))
712+a=0x0
713+;
714+for i = 0x0, 0.999999999, 0.1
715+do
716+a=(a + 0x1)
717+end
718+;
719+assert((a == 0xa))
720+a=0x0
721+;
722+for i = 1.0, 0x1, 0x1
723+do
724+a=(a + 0x1)
725+end
726+;
727+assert((a == 0x1))
728+a=0x0
729+;
730+for i = (- 1.5), (- 1.5), 0x1
731+do
732+a=(a + 0x1)
733+end
734+;
735+assert((a == 0x1))
736+a=0x0
737+;
738+for i = 1e6, 1e6, (- 0x1)
739+do
740+a=(a + 0x1)
741+end
742+;
743+assert((a == 0x1))
744+a=0x0
745+;
746+for i = 1.0, 0.99999, 0x1
747+do
748+a=(a + 0x1)
749+end
750+;
751+assert((a == 0x0))
752+a=0x0
753+;
754+for i = 0x1869f, 1e5, (- 1.0)
755+do
756+a=(a + 0x1)
757+end
758+;
759+assert((a == 0x0))
760+a=0x0
761+;
762+for i = 1.0, 0.99999, (- 0x1)
763+do
764+a=(a + 0x1)
765+end
766+;
767+assert((a == 0x1))
768+end
769+do
770+local a
771+a=0x0
772+;
773+for i = 0x1, 0xa
774+do
775+a=(a + 0x1)
776+;
777+i="\u{78}"
778+end
779+;
780+assert((a == 0xa))
781+a=0x0
782+;
783+for i = 10.0, 0x1, (- 0x1)
784+do
785+a=(a + 0x1)
786+;
787+i="\u{78}"
788+end
789+;
790+assert((a == 0xa))
791+end
792+a=0x0
793+;
794+for i = "\u{31}\u{30}", "\u{31}", "\u{2d}\u{32}"
795+do
796+a=(a + 0x1)
797+end
798+;
799+assert((a == 0x5))
800+do
801+local c
802+local function checkfloat
803+(i)
804+assert((math.type(i) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}"))
805+c=(c + 0x1)
806+end
807+c=0x0
808+;
809+for i = 1.0, 0xa
810+do
811+checkfloat(i)
812+end
813+assert((c == 0xa))
814+c=0x0
815+;
816+for i = (- 0x1), (- 0xa), (- 1.0)
817+do
818+checkfloat(i)
819+end
820+assert((c == 0xa))
821+local function checkint
822+(i)
823+assert((math.type(i) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}"))
824+c=(c + 0x1)
825+end
826+local m = math.maxinteger
827+c=0x0
828+;
829+for i = m, (m - 0xa), (- 0x1)
830+do
831+checkint(i)
832+end
833+assert((c == 0xb))
834+c=0x0
835+;
836+for i = 0x1, 10.9
837+do
838+checkint(i)
839+end
840+assert((c == 0xa))
841+c=0x0
842+;
843+for i = 0xa, 1e-3, (- 0x1)
844+do
845+checkint(i)
846+end
847+assert((c == 0xa))
848+c=0x0
849+;
850+for i = 0x1, "\u{31}\u{30}\u{2e}\u{38}"
851+do
852+checkint(i)
853+end
854+assert((c == 0xa))
855+c=0x0
856+;
857+for i = 0x9, "\u{33}\u{2e}\u{34}", (- 0x1)
858+do
859+checkint(i)
860+end
861+assert((c == 0x6))
862+c=0x0
863+;
864+for i = 0x0, "\u{20}\u{2d}\u{33}\u{2e}\u{34}\u{20}\u{20}", (- 0x1)
865+do
866+checkint(i)
867+end
868+assert((c == 0x4))
869+c=0x0
870+;
871+for i = 0x64, "\u{39}\u{36}\u{2e}\u{33}", (- 0x2)
872+do
873+checkint(i)
874+end
875+assert((c == 0x2))
876+c=0x0
877+;
878+for i = 0x1, math.huge
879+do
880+if (i > 0xa) then
881+break
882+end
883+;
884+checkint(i)
885+end
886+assert((c == 0xa))
887+c=0x0
888+;
889+for i = (- 0x1), (- math.huge), (- 0x1)
890+do
891+if (i < (- 0xa)) then
892+break
893+end
894+;
895+checkint(i)
896+end
897+assert((c == 0xa))
898+for i = math.mininteger, (- 1e101)
899+do
900+assert(false)
901+end
902+for i = math.maxinteger, 1e101, (- 0x1)
903+do
904+assert(false)
905+end
906+end
907+do
908+local function checkfor
909+(from,to,step,t)
910+local c = 0x0
911+for i = from, to, step
912+do
913+c=(c + 0x1)
914+assert((i == t[c]))
915+end
916+assert((c == (# t)))
917+end
918+local maxi = math.maxinteger
919+local mini = math.mininteger
920+checkfor(mini,maxi,maxi,{mini,(- 0x1),(maxi - 0x1)})
921+checkfor(mini,math.huge,maxi,{mini,(- 0x1),(maxi - 0x1)})
922+checkfor(maxi,mini,mini,{maxi,(- 0x1)})
923+checkfor(maxi,mini,(- maxi),{maxi,0x0,(- maxi)})
924+checkfor(maxi,(- math.huge),mini,{maxi,(- 0x1)})
925+checkfor(maxi,mini,0x1,{})
926+checkfor(mini,maxi,(- 0x1),{})
927+checkfor((maxi - 0x6),maxi,0x3,{(maxi - 0x6),(maxi - 0x3),maxi})
928+checkfor((mini + 0x4),mini,(- 0x2),{(mini + 0x4),(mini + 0x2),mini})
929+local step = (maxi // 0xa)
930+local c = mini
931+for i = mini, maxi, step
932+do
933+assert((i == c))
934+c=(c + step)
935+end
936+c=maxi
937+for i = maxi, mini, (- step)
938+do
939+assert((i == c))
940+c=(c - step)
941+end
942+checkfor(maxi,maxi,maxi,{maxi})
943+checkfor(maxi,maxi,mini,{maxi})
944+checkfor(mini,mini,maxi,{mini})
945+checkfor(mini,mini,mini,{mini})
946+end
947+checkerror("\u{27}\u{66}\u{6f}\u{72}\u{27}\u{20}\u{73}\u{74}\u{65}\u{70}\u{20}\u{69}\u{73}\u{20}\u{7a}\u{65}\u{72}\u{6f}",function ()
948+for i = 0x1, 0xa, 0x0
949+do
950+
951+end
952+end)
953+checkerror("\u{27}\u{66}\u{6f}\u{72}\u{27}\u{20}\u{73}\u{74}\u{65}\u{70}\u{20}\u{69}\u{73}\u{20}\u{7a}\u{65}\u{72}\u{6f}",function ()
954+for i = 0x1, (- 0xa), 0x0
955+do
956+
957+end
958+end)
959+checkerror("\u{27}\u{66}\u{6f}\u{72}\u{27}\u{20}\u{73}\u{74}\u{65}\u{70}\u{20}\u{69}\u{73}\u{20}\u{7a}\u{65}\u{72}\u{6f}",function ()
960+for i = 1.0, (- 0xa), 0.0
961+do
962+
963+end
964+end)
965+collectgarbage()
966+local function f
967+(n,p)
968+local t = {}
969+;
970+for i = 0x1, p
971+do
972+t[i]=(i * 0xa)
973+end
974+return function (_,n, ...)
975+assert((select("\u{23}",...) == 0x0))
976+if (n > 0x0) then
977+n=(n - 0x1)
978+return n,table.unpack(t)
979+end
980+end,nil,n
981+end
982+local x = 0x0
983+for n,a,b,c,d in f(0x5,0x3)
984+do
985+x=(x + 0x1)
986+assert(((((a == 0xa) and (b == 0x14)) and (c == 0x1e)) and (d == nil)))
987+end
988+assert((x == 0x5))
989+a={}
990+do
991+local x,y,z = pairs(a)
992+assert((((type(x) == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}") and (y == a)) and (z == nil)))
993+end
994+local function foo
995+(e,i)
996+assert((e == a))
997+if (i <= 0xa) then
998+return (i + 0x1),(i + 0x2)
999+end
1000+end
1001+local function foo1
1002+(e,i)
1003+i=(i + 0x1)
1004+assert((e == a))
1005+if (i <= e.n) then
1006+return i,a[i]
1007+end
1008+end
1009+setmetatable(a,{["\u{5f}\u{5f}\u{70}\u{61}\u{69}\u{72}\u{73}"] = function (x)
1010+return foo,x,0x0
1011+end})
1012+local i = 0x0
1013+for k,v in pairs(a)
1014+do
1015+i=(i + 0x1)
1016+assert(((k == i) and (v == (k + 0x1))))
1017+end
1018+a.n=0x5
1019+a[0x3]=0x1e
1020+a={["\u{6e}"] = 0xa}
1021+setmetatable(a,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k)
1022+if (k <= t.n) then
1023+return (k * 0xa)
1024+end
1025+end})
1026+i=0x0
1027+for k,v in ipairs(a)
1028+do
1029+i=(i + 0x1)
1030+assert(((k == i) and (v == (i * 0xa))))
1031+end
1032+assert((i == a.n))
1033+do
1034+local t = setmetatable({0xa,0x14,0x1e},{["\u{5f}\u{5f}\u{70}\u{61}\u{69}\u{72}\u{73}"] = function (t)
1035+local inc = coroutine.yield()
1036+return function (t,i)
1037+if (i > 0x1) then
1038+return (i - inc),t[(i - inc)]
1039+else
1040+return nil
1041+end
1042+end,t,(# (t + 0x1))
1043+end})
1044+local res = {}
1045+local co = coroutine.wrap(function ()
1046+for i,p in pairs(t)
1047+do
1048+res[(# (res + 0x1))]=p
1049+end
1050+end)
1051+co()
1052+co(0x1)
1053+assert(((((res[0x1] == 0x1e) and (res[0x2] == 0x14)) and (res[0x3] == 0xa)) and (# (res == 0x3))))
1054+end
1055+print("\u{4f}\u{4b}")
desk/res/lua/cycled/pm.luanew file+404
@@ -0,0 +1,404 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{74}\u{74}\u{65}\u{72}\u{6e}\u{20}\u{6d}\u{61}\u{74}\u{63}\u{68}\u{69}\u{6e}\u{67}")
2+local function checkerror
3+(msg,f, ...)
4+local s,err = pcall(f,...)
5+assert((not (s and string.find(err,msg))))
6+end
7+local function f
8+(s,p)
9+local i,e = string.find(s,p)
10+if i then
11+return string.sub(s,i,e)
12+end
13+end
14+local a,b = string.find("","")
15+assert(((a == 0x1) and (b == 0x0)))
16+;
17+a,b=string.find("\u{61}\u{6c}\u{6f}","")
18+assert(((a == 0x1) and (b == 0x0)))
19+a,b=string.find("\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}","\u{61}",0x1)
20+assert(((a == 0x1) and (b == 0x1)))
21+a,b=string.find("\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}","\u{61}\u{0}\u{6f}",0x2)
22+assert(((a == 0x5) and (b == 0x7)))
23+a,b=string.find("\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}\u{20}\u{61}\u{0}\u{6f}","\u{61}\u{0}\u{6f}",0x9)
24+assert(((a == 0x9) and (b == 0xb)))
25+a,b=string.find("\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{0}\u{61}\u{62}","\u{0}\u{61}\u{62}",0x2)
26+;
27+assert(((a == 0x9) and (b == 0xb)))
28+;
29+a,b=string.find("\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{0}\u{61}\u{62}","\u{62}")
30+assert(((a == 0xb) and (b == 0xb)))
31+assert((not string.find("\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{61}\u{0}\u{0}\u{61}\u{62}","\u{62}\u{0}")))
32+assert((not string.find("","\u{0}")))
33+assert((string.find("\u{61}\u{6c}\u{6f}\u{31}\u{32}\u{33}\u{61}\u{6c}\u{6f}","\u{31}\u{32}") == 0x4))
34+assert((not string.find("\u{61}\u{6c}\u{6f}\u{31}\u{32}\u{33}\u{61}\u{6c}\u{6f}","\u{5e}\u{31}\u{32}")))
35+assert((string.match("\u{61}\u{61}\u{61}\u{62}","\u{2e}\u{2a}\u{62}") == "\u{61}\u{61}\u{61}\u{62}"))
36+assert((string.match("\u{61}\u{61}\u{61}","\u{2e}\u{2a}\u{61}") == "\u{61}\u{61}\u{61}"))
37+assert((string.match("\u{62}","\u{2e}\u{2a}\u{62}") == "\u{62}"))
38+assert((string.match("\u{61}\u{61}\u{61}\u{62}","\u{2e}\u{2b}\u{62}") == "\u{61}\u{61}\u{61}\u{62}"))
39+assert((string.match("\u{61}\u{61}\u{61}","\u{2e}\u{2b}\u{61}") == "\u{61}\u{61}\u{61}"))
40+assert((not string.match("\u{62}","\u{2e}\u{2b}\u{62}")))
41+assert((string.match("\u{61}\u{61}\u{61}\u{62}","\u{2e}\u{3f}\u{62}") == "\u{61}\u{62}"))
42+assert((string.match("\u{61}\u{61}\u{61}","\u{2e}\u{3f}\u{61}") == "\u{61}\u{61}"))
43+assert((string.match("\u{62}","\u{2e}\u{3f}\u{62}") == "\u{62}"))
44+assert((f("\u{61}\u{6c}\u{6f}\u{41}\u{4c}\u{4f}","\u{25}\u{6c}\u{2a}") == "\u{61}\u{6c}\u{6f}"))
45+assert((f("\u{61}\u{4c}\u{6f}\u{5f}\u{41}\u{4c}\u{4f}","\u{25}\u{61}\u{2a}") == "\u{61}\u{4c}\u{6f}"))
46+assert((f("\u{20}\u{20}\u{a}\u{d}\u{2a}\u{26}\u{a}\u{d}\u{20}\u{20}\u{20}\u{78}\u{75}\u{78}\u{75}\u{20}\u{20}\u{a}\u{a}","\u{25}\u{67}\u{25}\u{67}\u{25}\u{67}\u{2b}") == "\u{78}\u{75}\u{78}\u{75}"))
47+local function PU
48+(p)
49+p=string.gsub(p,("\u{28}" .. (utf8.charpattern .. "\u{29}\u{25}\u{3f}")),function (c)
50+return string.gsub(c,"\u{2e}","\u{25}\u{30}\u{3f}")
51+end)
52+p=string.gsub(p,"\u{25}\u{2e}",utf8.charpattern)
53+return p
54+end
55+assert((f("\u{61}\u{61}\u{61}\u{62}","\u{61}\u{2a}") == "\u{61}\u{61}\u{61}"))
56+;
57+assert((f("\u{61}\u{61}\u{61}","\u{5e}\u{2e}\u{2a}\u{24}") == "\u{61}\u{61}\u{61}"))
58+;
59+assert((f("\u{61}\u{61}\u{61}","\u{62}\u{2a}") == ""))
60+;
61+assert((f("\u{61}\u{61}\u{61}","\u{61}\u{62}\u{2a}\u{61}") == "\u{61}\u{61}"))
62+assert((f("\u{61}\u{62}\u{61}","\u{61}\u{62}\u{2a}\u{61}") == "\u{61}\u{62}\u{61}"))
63+assert((f("\u{61}\u{61}\u{61}\u{62}","\u{61}\u{2b}") == "\u{61}\u{61}\u{61}"))
64+assert((f("\u{61}\u{61}\u{61}","\u{5e}\u{2e}\u{2b}\u{24}") == "\u{61}\u{61}\u{61}"))
65+assert((not f("\u{61}\u{61}\u{61}","\u{62}\u{2b}")))
66+assert((not f("\u{61}\u{61}\u{61}","\u{61}\u{62}\u{2b}\u{61}")))
67+assert((f("\u{61}\u{62}\u{61}","\u{61}\u{62}\u{2b}\u{61}") == "\u{61}\u{62}\u{61}"))
68+assert((f("\u{61}\u{24}\u{61}","\u{2e}\u{24}") == "\u{61}"))
69+assert((f("\u{61}\u{24}\u{61}","\u{2e}\u{25}\u{24}") == "\u{61}\u{24}"))
70+assert((f("\u{61}\u{24}\u{61}","\u{2e}\u{24}\u{2e}") == "\u{61}\u{24}\u{61}"))
71+assert((not f("\u{61}\u{24}\u{61}","\u{24}\u{24}")))
72+assert((not f("\u{61}\u{24}\u{62}","\u{61}\u{24}")))
73+assert((f("\u{61}\u{24}\u{61}","\u{24}") == ""))
74+assert((f("","\u{62}\u{2a}") == ""))
75+assert((not f("\u{61}\u{61}\u{61}","\u{62}\u{62}\u{2a}")))
76+assert((f("\u{61}\u{61}\u{61}\u{62}","\u{61}\u{2d}") == ""))
77+assert((f("\u{61}\u{61}\u{61}","\u{5e}\u{2e}\u{2d}\u{24}") == "\u{61}\u{61}\u{61}"))
78+assert((f("\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}","\u{62}\u{2e}\u{2a}\u{62}") == "\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}"))
79+assert((f("\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}\u{61}\u{61}\u{62}\u{61}","\u{62}\u{2e}\u{2d}\u{62}") == "\u{62}\u{61}\u{61}\u{61}\u{62}"))
80+assert((f("\u{61}\u{6c}\u{6f}\u{20}\u{78}\u{6f}","\u{2e}\u{6f}\u{24}") == "\u{78}\u{6f}"))
81+assert((f("\u{20}\u{a}\u{20}\u{69}\u{73}\u{74}\u{6f}\u{20}\u{c3}\u{a9}\u{20}\u{61}\u{73}\u{73}\u{69}\u{6d}","\u{25}\u{53}\u{25}\u{53}\u{2a}") == "\u{69}\u{73}\u{74}\u{6f}"))
82+assert((f("\u{20}\u{a}\u{20}\u{69}\u{73}\u{74}\u{6f}\u{20}\u{c3}\u{a9}\u{20}\u{61}\u{73}\u{73}\u{69}\u{6d}","\u{25}\u{53}\u{2a}\u{24}") == "\u{61}\u{73}\u{73}\u{69}\u{6d}"))
83+assert((f("\u{20}\u{a}\u{20}\u{69}\u{73}\u{74}\u{6f}\u{20}\u{c3}\u{a9}\u{20}\u{61}\u{73}\u{73}\u{69}\u{6d}","\u{5b}\u{61}\u{2d}\u{7a}\u{5d}\u{2a}\u{24}") == "\u{61}\u{73}\u{73}\u{69}\u{6d}"))
84+assert((f("\u{75}\u{6d}\u{20}\u{63}\u{61}\u{72}\u{61}\u{63}\u{74}\u{65}\u{72}\u{20}\u{3f}\u{20}\u{65}\u{78}\u{74}\u{72}\u{61}","\u{5b}\u{5e}\u{25}\u{73}\u{61}\u{2d}\u{7a}\u{5d}") == "\u{3f}"))
85+assert((f("","\u{61}\u{3f}") == ""))
86+assert((f("\u{c3}\u{a1}",PU("\u{c3}\u{a1}\u{3f}")) == "\u{c3}\u{a1}"))
87+assert((f("\u{c3}\u{a1}\u{62}\u{6c}",PU("\u{c3}\u{a1}\u{3f}\u{62}\u{3f}\u{6c}\u{3f}")) == "\u{c3}\u{a1}\u{62}\u{6c}"))
88+assert((f("\u{20}\u{20}\u{c3}\u{a1}\u{62}\u{6c}",PU("\u{c3}\u{a1}\u{3f}\u{62}\u{3f}\u{6c}\u{3f}")) == ""))
89+assert((f("\u{61}\u{61}","\u{5e}\u{61}\u{61}\u{3f}\u{61}\u{3f}\u{61}") == "\u{61}\u{61}"))
90+assert((f("\u{5d}\u{5d}\u{5d}\u{c3}\u{a1}\u{62}","\u{5b}\u{5e}\u{5d}\u{5d}\u{2b}") == "\u{c3}\u{a1}\u{62}"))
91+assert((f("\u{30}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{25}\u{78}\u{2a}") == "\u{30}\u{61}"))
92+assert((f("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{25}\u{43}\u{2b}") == "\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}"))
93+print("\u{2b}")
94+local function f1
95+(s,p)
96+p=string.gsub(p,"\u{25}\u{25}\u{28}\u{5b}\u{30}\u{2d}\u{39}\u{5d}\u{29}",function (s)
97+return ("\u{25}" .. (tonumber(s) + 0x1))
98+end)
99+p=string.gsub(p,"\u{5e}\u{28}\u{5e}\u{3f}\u{29}","\u{25}\u{31}\u{28}\u{29}",0x1)
100+p=string.gsub(p,"\u{28}\u{24}\u{3f}\u{29}\u{24}","\u{28}\u{29}\u{25}\u{31}",0x1)
101+local t = {string.match(s,p)}
102+return string.sub(s,t[0x1],(t[(# t)] - 0x1))
103+end
104+assert((f1("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{78}\u{20}\u{31}\u{32}\u{33}\u{20}\u{62}\u{0}\u{6f}\u{20}\u{62}\u{0}\u{6f}","\u{28}\u{2e}\u{2e}\u{2a}\u{29}\u{20}\u{25}\u{31}") == "\u{62}\u{0}\u{6f}\u{20}\u{62}\u{0}\u{6f}"))
105+assert((f1("\u{61}\u{78}\u{7a}\u{31}\u{32}\u{33}\u{3d}\u{20}\u{34}\u{3d}\u{20}\u{34}\u{20}\u{33}\u{34}","\u{28}\u{2e}\u{2b}\u{29}\u{3d}\u{28}\u{2e}\u{2a}\u{29}\u{3d}\u{25}\u{32}\u{20}\u{25}\u{31}") == "\u{33}\u{3d}\u{20}\u{34}\u{3d}\u{20}\u{34}\u{20}\u{33}"))
106+assert((f1("\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}","\u{5e}\u{28}\u{3d}\u{2a}\u{29}\u{3d}\u{25}\u{31}\u{24}") == "\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}"))
107+assert((not string.match("\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}\u{3d}","\u{5e}\u{28}\u{5b}\u{3d}\u{5d}\u{2a}\u{29}\u{3d}\u{25}\u{31}\u{24}")))
108+local function range
109+(i,j)
110+if (i <= j) then
111+return i,range((i + 0x1),j)
112+end
113+end
114+local abc = (string.char(range(0x0,0x7f)) .. string.char(range(0x80,0xff)))
115+;
116+assert((string.len(abc) == 0x100))
117+local function strset
118+(p)
119+local res = {["\u{73}"] = ""}
120+string.gsub(abc,p,function (c)
121+res.s=(res.s .. c)
122+end)
123+return res.s
124+end
125+;
126+assert((string.len(strset("\u{5b}\u{c8}\u{2d}\u{d2}\u{5d}")) == 0xb))
127+assert((strset("\u{5b}\u{61}\u{2d}\u{7a}\u{5d}") == "\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}\u{68}\u{69}\u{6a}\u{6b}\u{6c}\u{6d}\u{6e}\u{6f}\u{70}\u{71}\u{72}\u{73}\u{74}\u{75}\u{76}\u{77}\u{78}\u{79}\u{7a}"))
128+assert((strset("\u{5b}\u{61}\u{2d}\u{7a}\u{25}\u{64}\u{5d}") == strset("\u{5b}\u{25}\u{64}\u{61}\u{2d}\u{75}\u{75}\u{2d}\u{7a}\u{5d}")))
129+assert((strset("\u{5b}\u{61}\u{2d}\u{5d}") == "\u{2d}\u{61}"))
130+assert((strset("\u{5b}\u{5e}\u{25}\u{57}\u{5d}") == strset("\u{5b}\u{25}\u{77}\u{5d}")))
131+assert((strset("\u{5b}\u{5d}\u{25}\u{25}\u{5d}") == "\u{25}\u{5d}"))
132+assert((strset("\u{5b}\u{61}\u{25}\u{2d}\u{7a}\u{5d}") == "\u{2d}\u{61}\u{7a}"))
133+assert((strset("\u{5b}\u{25}\u{5e}\u{25}\u{5b}\u{25}\u{2d}\u{61}\u{25}\u{5d}\u{25}\u{2d}\u{62}\u{5d}") == "\u{2d}\u{5b}\u{5d}\u{5e}\u{61}\u{62}"))
134+assert((strset("\u{25}\u{5a}") == strset("\u{5b}\u{1}\u{2d}\u{ff}\u{5d}")))
135+assert((strset("\u{2e}") == strset("\u{5b}\u{1}\u{2d}\u{ff}\u{25}\u{7a}\u{5d}")))
136+print("\u{2b}")
137+;
138+assert((string.match("\u{61}\u{6c}\u{6f}\u{20}\u{78}\u{79}\u{7a}\u{4b}","\u{28}\u{25}\u{77}\u{2b}\u{29}\u{4b}") == "\u{78}\u{79}\u{7a}"))
139+assert((string.match("\u{32}\u{35}\u{34}\u{20}\u{4b}","\u{28}\u{25}\u{64}\u{2a}\u{29}\u{4b}") == ""))
140+assert((string.match("\u{61}\u{6c}\u{6f}\u{20}","\u{28}\u{25}\u{77}\u{2a}\u{29}\u{24}") == ""))
141+assert((not string.match("\u{61}\u{6c}\u{6f}\u{20}","\u{28}\u{25}\u{77}\u{2b}\u{29}\u{24}")))
142+assert((string.find("\u{28}\u{c3}\u{a1}\u{6c}\u{6f}\u{29}","\u{25}\u{28}\u{c3}\u{a1}") == 0x1))
143+local a,b,c,d,e = string.match("\u{c3}\u{a2}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}",PU("\u{5e}\u{28}\u{28}\u{28}\u{2e}\u{29}\u{2e}\u{29}\u{2e}\u{20}\u{28}\u{25}\u{77}\u{2a}\u{29}\u{29}\u{24}"))
144+assert((((((a == "\u{c3}\u{a2}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}") and (b == "\u{c3}\u{a2}\u{6c}")) and (c == "\u{c3}\u{a2}")) and (d == "\u{61}\u{6c}\u{6f}")) and (e == nil)))
145+a,b,c,d=string.match("\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{28}\u{2e}\u{2b}\u{28}\u{2e}\u{3f}\u{29}\u{28}\u{29}\u{29}")
146+assert(((((a == "\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}") and (b == "")) and (c == 0xb)) and (d == nil)))
147+print("\u{2b}")
148+assert((string.gsub("\u{c3}\u{bc}\u{6c}\u{6f}\u{20}\u{c3}\u{bc}\u{6c}\u{6f}","\u{c3}\u{bc}","\u{78}") == "\u{78}\u{6c}\u{6f}\u{20}\u{78}\u{6c}\u{6f}"))
149+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{c3}\u{ba}\u{6c}\u{6f}\u{20}\u{20}","\u{20}\u{2b}\u{24}","") == "\u{61}\u{6c}\u{6f}\u{20}\u{c3}\u{ba}\u{6c}\u{6f}"))
150+assert((string.gsub("\u{20}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{20}","\u{5e}\u{25}\u{73}\u{2a}\u{28}\u{2e}\u{2d}\u{29}\u{25}\u{73}\u{2a}\u{24}","\u{25}\u{31}") == "\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}"))
151+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{20}\u{a}\u{20}\u{31}\u{32}\u{33}\u{a}\u{20}","\u{25}\u{73}\u{2b}","\u{20}") == "\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{31}\u{32}\u{33}\u{20}"))
152+local t = "\u{61}\u{62}\u{c3}\u{a7}\u{20}\u{64}"
153+a,b=string.gsub(t,PU("\u{28}\u{2e}\u{29}"),"\u{25}\u{31}\u{40}")
154+assert(((a == "\u{61}\u{40}\u{62}\u{40}\u{c3}\u{a7}\u{40}\u{20}\u{40}\u{64}\u{40}") and (b == 0x5)))
155+a,b=string.gsub("\u{61}\u{62}\u{c3}\u{a7}\u{64}",PU("\u{28}\u{2e}\u{29}"),"\u{25}\u{30}\u{40}",0x2)
156+assert(((a == "\u{61}\u{40}\u{62}\u{40}\u{c3}\u{a7}\u{64}") and (b == 0x2)))
157+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{29}\u{5b}\u{61}\u{6c}\u{5d}","\u{25}\u{31}") == "\u{31}\u{32}\u{6f}\u{20}\u{35}\u{36}\u{6f}"))
158+assert((string.gsub("\u{61}\u{62}\u{63}\u{3d}\u{78}\u{79}\u{7a}","\u{28}\u{25}\u{77}\u{2a}\u{29}\u{28}\u{25}\u{70}\u{29}\u{28}\u{25}\u{77}\u{2b}\u{29}","\u{25}\u{33}\u{25}\u{32}\u{25}\u{31}\u{2d}\u{25}\u{30}") == "\u{78}\u{79}\u{7a}\u{3d}\u{61}\u{62}\u{63}\u{2d}\u{61}\u{62}\u{63}\u{3d}\u{78}\u{79}\u{7a}"))
159+assert((string.gsub("\u{61}\u{62}\u{63}","\u{25}\u{77}","\u{25}\u{31}\u{25}\u{30}") == "\u{61}\u{61}\u{62}\u{62}\u{63}\u{63}"))
160+assert((string.gsub("\u{61}\u{62}\u{63}","\u{25}\u{77}\u{2b}","\u{25}\u{30}\u{25}\u{31}") == "\u{61}\u{62}\u{63}\u{61}\u{62}\u{63}"))
161+assert((string.gsub("\u{c3}\u{a1}\u{c3}\u{a9}\u{c3}\u{ad}","\u{24}","\u{0}\u{c3}\u{b3}\u{c3}\u{ba}") == "\u{c3}\u{a1}\u{c3}\u{a9}\u{c3}\u{ad}\u{0}\u{c3}\u{b3}\u{c3}\u{ba}"))
162+assert((string.gsub("","\u{5e}","\u{72}") == "\u{72}"))
163+assert((string.gsub("","\u{24}","\u{72}") == "\u{72}"))
164+print("\u{2b}")
165+do
166+assert((string.gsub("\u{61}\u{20}\u{62}\u{20}\u{63}\u{64}","\u{20}\u{2a}","\u{2d}") == "\u{2d}\u{61}\u{2d}\u{62}\u{2d}\u{63}\u{2d}\u{64}\u{2d}"))
167+local res = ""
168+local sub = "\u{61}\u{20}\u{20}\u{a}\u{62}\u{63}\u{9}\u{9}\u{64}"
169+local i = 0x1
170+for p,e in string.gmatch(sub,"\u{28}\u{29}\u{25}\u{73}\u{2a}\u{28}\u{29}")
171+do
172+res=(res .. (string.sub(sub,i,(p - 0x1)) .. "\u{2d}"))
173+i=e
174+end
175+assert((res == "\u{2d}\u{61}\u{2d}\u{62}\u{2d}\u{63}\u{2d}\u{64}\u{2d}"))
176+end
177+assert((string.gsub("\u{75}\u{6d}\u{20}\u{28}\u{64}\u{6f}\u{69}\u{73}\u{29}\u{20}\u{74}\u{72}\u{65}\u{73}\u{20}\u{28}\u{71}\u{75}\u{61}\u{74}\u{72}\u{6f}\u{29}","\u{28}\u{25}\u{28}\u{25}\u{77}\u{2b}\u{25}\u{29}\u{29}",string.upper) == "\u{75}\u{6d}\u{20}\u{28}\u{44}\u{4f}\u{49}\u{53}\u{29}\u{20}\u{74}\u{72}\u{65}\u{73}\u{20}\u{28}\u{51}\u{55}\u{41}\u{54}\u{52}\u{4f}\u{29}"))
178+do
179+local function setglobal
180+(n,v)
181+rawset(_G,n,v)
182+end
183+string.gsub("\u{61}\u{3d}\u{72}\u{6f}\u{62}\u{65}\u{72}\u{74}\u{6f}\u{2c}\u{72}\u{6f}\u{62}\u{65}\u{72}\u{74}\u{6f}\u{3d}\u{61}","\u{28}\u{25}\u{77}\u{2b}\u{29}\u{3d}\u{28}\u{25}\u{77}\u{25}\u{77}\u{2a}\u{29}",setglobal)
184+assert(((_G.a == "\u{72}\u{6f}\u{62}\u{65}\u{72}\u{74}\u{6f}") and (_G.roberto == "\u{61}")))
185+_G.a=nil
186+;
187+_G.roberto=nil
188+end
189+function f(a,b)
190+return string.gsub(a,"\u{2e}",b)
191+end
192+assert((string.gsub("\u{74}\u{72}\u{6f}\u{63}\u{61}\u{72}\u{20}\u{74}\u{75}\u{64}\u{6f}\u{20}\u{65}\u{6d}\u{20}\u{7c}\u{74}\u{65}\u{73}\u{74}\u{65}\u{7c}\u{62}\u{7c}\u{20}\u{c3}\u{a9}\u{20}\u{7c}\u{62}\u{65}\u{6c}\u{65}\u{7a}\u{61}\u{7c}\u{61}\u{6c}\u{7c}","\u{7c}\u{28}\u{5b}\u{5e}\u{7c}\u{5d}\u{2a}\u{29}\u{7c}\u{28}\u{5b}\u{5e}\u{7c}\u{5d}\u{2a}\u{29}\u{7c}",f) == "\u{74}\u{72}\u{6f}\u{63}\u{61}\u{72}\u{20}\u{74}\u{75}\u{64}\u{6f}\u{20}\u{65}\u{6d}\u{20}\u{62}\u{62}\u{62}\u{62}\u{62}\u{20}\u{c3}\u{a9}\u{20}\u{61}\u{6c}\u{61}\u{6c}\u{61}\u{6c}\u{61}\u{6c}\u{61}\u{6c}\u{61}\u{6c}"))
193+local function dostring
194+(s)
195+return (load(s,"")() or "")
196+end
197+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{24}\u{61}\u{3d}\u{27}\u{78}\u{27}\u{24}\u{20}\u{6e}\u{6f}\u{76}\u{61}\u{6d}\u{65}\u{6e}\u{74}\u{65}\u{20}\u{24}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{24}","\u{24}\u{28}\u{5b}\u{5e}\u{24}\u{5d}\u{2a}\u{29}\u{25}\u{24}",dostring) == "\u{61}\u{6c}\u{6f}\u{20}\u{20}\u{6e}\u{6f}\u{76}\u{61}\u{6d}\u{65}\u{6e}\u{74}\u{65}\u{20}\u{78}"))
198+local x = string.gsub("\u{24}\u{78}\u{3d}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{67}\u{73}\u{75}\u{62}\u{28}\u{27}\u{61}\u{6c}\u{6f}\u{27}\u{2c}\u{20}\u{27}\u{2e}\u{27}\u{2c}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{2e}\u{75}\u{70}\u{70}\u{65}\u{72}\u{29}\u{24}\u{20}\u{61}\u{73}\u{73}\u{69}\u{6d}\u{20}\u{76}\u{61}\u{69}\u{20}\u{70}\u{61}\u{72}\u{61}\u{20}\u{24}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{78}\u{24}","\u{24}\u{28}\u{5b}\u{5e}\u{24}\u{5d}\u{2a}\u{29}\u{25}\u{24}",dostring)
199+assert((x == "\u{20}\u{61}\u{73}\u{73}\u{69}\u{6d}\u{20}\u{76}\u{61}\u{69}\u{20}\u{70}\u{61}\u{72}\u{61}\u{20}\u{41}\u{4c}\u{4f}"))
200+_G.a,_G.x=nil
201+local t = {}
202+local s = "\u{61}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{6a}\u{6f}\u{73}\u{65}\u{20}\u{20}\u{6a}\u{6f}\u{61}\u{6f}"
203+local r = string.gsub(s,"\u{28}\u{29}\u{28}\u{25}\u{77}\u{2b}\u{29}\u{28}\u{29}",function (a,w,b)
204+assert((string.len(w) == (b - a)))
205+;
206+t[a]=(b - a)
207+;
208+end)
209+assert((((((s == r) and (t[0x1] == 0x1)) and (t[0x3] == 0x3)) and (t[0x7] == 0x4)) and (t[0xd] == 0x4)))
210+local function isbalanced
211+(s)
212+return (not string.find(string.gsub(s,"\u{25}\u{62}\u{28}\u{29}",""),"\u{5b}\u{28}\u{29}\u{5d}"))
213+end
214+assert(isbalanced("\u{28}\u{39}\u{20}\u{28}\u{28}\u{38}\u{29}\u{29}\u{28}\u{0}\u{29}\u{20}\u{37}\u{29}\u{20}\u{0}\u{0}\u{20}\u{61}\u{20}\u{62}\u{20}\u{28}\u{29}\u{28}\u{63}\u{29}\u{28}\u{29}\u{20}\u{61}"))
215+assert((not isbalanced("\u{28}\u{39}\u{20}\u{28}\u{28}\u{38}\u{29}\u{20}\u{37}\u{29}\u{20}\u{61}\u{20}\u{62}\u{20}\u{28}\u{0}\u{20}\u{63}\u{29}\u{20}\u{61}")))
216+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{27}\u{6f}\u{69}\u{27}\u{20}\u{61}\u{6c}\u{6f}","\u{25}\u{62}\u{27}\u{27}","\u{22}") == "\u{61}\u{6c}\u{6f}\u{20}\u{22}\u{20}\u{61}\u{6c}\u{6f}"))
217+local t = {"\u{61}\u{70}\u{70}\u{6c}\u{65}","\u{6f}\u{72}\u{61}\u{6e}\u{67}\u{65}","\u{6c}\u{69}\u{6d}\u{65}",["\u{6e}"] = 0x0}
218+assert((string.gsub("\u{78}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{78}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{78}","\u{78}",function ()
219+t.n=(t.n + 0x1)
220+;
221+return t[t.n]
222+end) == "\u{61}\u{70}\u{70}\u{6c}\u{65}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6f}\u{72}\u{61}\u{6e}\u{67}\u{65}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6c}\u{69}\u{6d}\u{65}"))
223+t={["\u{6e}"] = 0x0}
224+string.gsub("\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{77}\u{6f}\u{72}\u{64}","\u{25}\u{77}\u{25}\u{77}\u{2a}",function (w)
225+t.n=(t.n + 0x1)
226+;
227+t[t.n]=w
228+end)
229+assert(((((t[0x1] == "\u{66}\u{69}\u{72}\u{73}\u{74}") and (t[0x2] == "\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}")) and (t[0x3] == "\u{77}\u{6f}\u{72}\u{64}")) and (t.n == 0x3)))
230+t={["\u{6e}"] = 0x0}
231+assert((string.gsub("\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{77}\u{6f}\u{72}\u{64}","\u{25}\u{77}\u{2b}",function (w)
232+t.n=(t.n + 0x1)
233+;
234+t[t.n]=w
235+end,0x2) == "\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{77}\u{6f}\u{72}\u{64}"))
236+assert((((t[0x1] == "\u{66}\u{69}\u{72}\u{73}\u{74}") and (t[0x2] == "\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}")) and (t[0x3] == undef)))
237+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{72}\u{65}\u{70}\u{6c}\u{61}\u{63}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{25}\u{28}\u{61}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{25}\u{29}",string.gsub,"\u{61}\u{6c}\u{6f}","\u{2e}",{["\u{61}"] = {}})
238+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{61}\u{70}\u{74}\u{75}\u{72}\u{65}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{25}\u{25}\u{32}",string.gsub,"\u{61}\u{6c}\u{6f}","\u{2e}","\u{25}\u{32}")
239+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{61}\u{70}\u{74}\u{75}\u{72}\u{65}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{25}\u{25}\u{30}",string.gsub,"\u{61}\u{6c}\u{6f}","\u{28}\u{25}\u{30}\u{29}","\u{61}")
240+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{61}\u{70}\u{74}\u{75}\u{72}\u{65}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{25}\u{25}\u{31}",string.gsub,"\u{61}\u{6c}\u{6f}","\u{28}\u{25}\u{31}\u{29}","\u{61}")
241+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{75}\u{73}\u{65}\u{20}\u{6f}\u{66}\u{20}\u{27}\u{25}\u{25}\u{27}",string.gsub,"\u{61}\u{6c}\u{6f}","\u{2e}","\u{25}\u{78}")
242+if (not _soft) then
243+print("\u{62}\u{69}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}")
244+local a = string.rep("\u{61}",0x493e0)
245+assert(string.find(a,"\u{5e}\u{61}\u{2a}\u{2e}\u{3f}\u{24}"))
246+assert((not string.find(a,"\u{5e}\u{61}\u{2a}\u{2e}\u{3f}\u{62}\u{24}")))
247+assert(string.find(a,"\u{5e}\u{61}\u{2d}\u{2e}\u{3f}\u{24}"))
248+a=(string.rep("\u{61}",0x2710) .. string.rep("\u{62}",0x2710))
249+assert((not pcall(string.gsub,a,"\u{62}")))
250+end
251+local function rev
252+(s)
253+return string.gsub(s,"\u{28}\u{2e}\u{29}\u{28}\u{2e}\u{2b}\u{29}",function (c,s1)
254+return (rev(s1) .. c)
255+end)
256+end
257+local x = "\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}"
258+assert((rev(rev(x)) == x))
259+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{2e}",{}) == "\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}"))
260+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{2e}\u{29}",{["\u{61}"] = "\u{41}\u{41}",["\u{6c}"] = ""}) == "\u{41}\u{41}\u{6f}\u{20}\u{41}\u{41}\u{6f}"))
261+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{2e}\u{29}\u{2e}",{["\u{61}"] = "\u{41}\u{41}",["\u{6c}"] = "\u{4b}"}) == "\u{41}\u{41}\u{6f}\u{20}\u{41}\u{41}\u{6f}"))
262+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{28}\u{2e}\u{29}\u{28}\u{2e}\u{3f}\u{29}\u{29}",{["\u{61}\u{6c}"] = "\u{41}\u{41}",["\u{6f}"] = false}) == "\u{41}\u{41}\u{6f}\u{20}\u{41}\u{41}\u{6f}"))
263+assert((string.gsub("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}","\u{28}\u{29}\u{2e}",{"\u{78}","\u{79}\u{79}","\u{7a}\u{7a}\u{7a}"}) == "\u{78}\u{79}\u{79}\u{7a}\u{7a}\u{7a}\u{20}\u{61}\u{6c}\u{6f}"))
264+t={}
265+;
266+setmetatable(t,{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,s)
267+return string.upper(s)
268+end})
269+assert((string.gsub("\u{61}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{62}\u{20}\u{68}\u{69}","\u{25}\u{77}\u{25}\u{77}\u{2b}",t) == "\u{61}\u{20}\u{41}\u{4c}\u{4f}\u{20}\u{62}\u{20}\u{48}\u{49}"))
270+local a = 0x0
271+for i in string.gmatch("\u{61}\u{62}\u{63}\u{64}\u{65}","\u{28}\u{29}")
272+do
273+assert((i == (a + 0x1)))
274+;
275+a=i
276+end
277+assert((a == 0x6))
278+t={["\u{6e}"] = 0x0}
279+for w in string.gmatch("\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}\u{20}\u{77}\u{6f}\u{72}\u{64}","\u{25}\u{77}\u{2b}")
280+do
281+t.n=(t.n + 0x1)
282+;
283+t[t.n]=w
284+end
285+assert((((t[0x1] == "\u{66}\u{69}\u{72}\u{73}\u{74}") and (t[0x2] == "\u{73}\u{65}\u{63}\u{6f}\u{6e}\u{64}")) and (t[0x3] == "\u{77}\u{6f}\u{72}\u{64}")))
286+t={0x3,0x6,0x9}
287+for i in string.gmatch("\u{78}\u{75}\u{78}\u{78}\u{20}\u{75}\u{75}\u{20}\u{70}\u{70}\u{61}\u{72}\u{20}\u{72}","\u{28}\u{29}\u{28}\u{2e}\u{29}\u{25}\u{32}")
288+do
289+assert((i == table.remove(t,0x1)))
290+end
291+assert((# (t == 0x0)))
292+t={}
293+for i,j in string.gmatch("\u{31}\u{33}\u{20}\u{31}\u{34}\u{20}\u{31}\u{30}\u{20}\u{3d}\u{20}\u{31}\u{31}\u{2c}\u{20}\u{31}\u{35}\u{3d}\u{20}\u{31}\u{36}\u{2c}\u{20}\u{32}\u{32}\u{3d}\u{32}\u{33}","\u{28}\u{25}\u{64}\u{2b}\u{29}\u{25}\u{73}\u{2a}\u{3d}\u{25}\u{73}\u{2a}\u{28}\u{25}\u{64}\u{2b}\u{29}")
294+do
295+t[tonumber(i)]=tonumber(j)
296+end
297+a=0x0
298+for k,v in pairs(t)
299+do
300+assert(((k + 0x1) == (v + 0x0)))
301+;
302+a=(a + 0x1)
303+end
304+assert((a == 0x3))
305+do
306+local s = 0x0
307+for k in string.gmatch("\u{31}\u{30}\u{20}\u{32}\u{30}\u{20}\u{33}\u{30}","\u{25}\u{64}\u{2b}",0x3)
308+do
309+s=(s + tonumber(k))
310+end
311+assert((s == 0x32))
312+s=0x0
313+for k in string.gmatch("\u{31}\u{31}\u{20}\u{32}\u{31}\u{20}\u{33}\u{31}","\u{25}\u{64}\u{2b}",(- 0x4))
314+do
315+s=(s + tonumber(k))
316+end
317+assert((s == 0x20))
318+s=0x0
319+for k in string.gmatch("\u{31}\u{31}\u{20}\u{32}\u{31}\u{20}\u{33}\u{31}","\u{25}\u{77}\u{2a}",0x9)
320+do
321+s=(s + 0x1)
322+end
323+assert((s == 0x1))
324+s=0x0
325+for k in string.gmatch("\u{31}\u{31}\u{20}\u{32}\u{31}\u{20}\u{33}\u{31}","\u{25}\u{77}\u{2a}",0xa)
326+do
327+s=(s + 0x1)
328+end
329+assert((s == 0x0))
330+end
331+assert((string.gsub("\u{61}\u{61}\u{61}\u{20}\u{61}\u{61}\u{20}\u{61}\u{20}\u{61}\u{61}\u{61}\u{20}\u{61}","\u{25}\u{66}\u{5b}\u{25}\u{77}\u{5d}\u{61}","\u{78}") == "\u{78}\u{61}\u{61}\u{20}\u{78}\u{61}\u{20}\u{78}\u{20}\u{78}\u{61}\u{61}\u{20}\u{78}"))
332+assert((string.gsub("\u{5b}\u{5b}\u{5d}\u{5d}\u{20}\u{5b}\u{5d}\u{5b}\u{5d}\u{20}\u{5b}\u{5b}\u{5b}\u{5b}","\u{25}\u{66}\u{5b}\u{5b}\u{5d}\u{2e}","\u{78}") == "\u{78}\u{5b}\u{5d}\u{5d}\u{20}\u{78}\u{5d}\u{78}\u{5d}\u{20}\u{78}\u{5b}\u{5b}\u{5b}"))
333+assert((string.gsub("\u{30}\u{31}\u{61}\u{62}\u{63}\u{34}\u{35}\u{64}\u{65}\u{33}","\u{25}\u{66}\u{5b}\u{25}\u{64}\u{5d}","\u{2e}") == "\u{2e}\u{30}\u{31}\u{61}\u{62}\u{63}\u{2e}\u{34}\u{35}\u{64}\u{65}\u{2e}\u{33}"))
334+assert((string.gsub("\u{30}\u{31}\u{61}\u{62}\u{63}\u{34}\u{35}\u{20}\u{64}\u{65}\u{33}\u{78}","\u{25}\u{66}\u{5b}\u{25}\u{44}\u{5d}\u{25}\u{77}","\u{2e}") == "\u{30}\u{31}\u{2e}\u{62}\u{63}\u{34}\u{35}\u{20}\u{64}\u{65}\u{33}\u{2e}"))
335+assert((string.gsub("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}","\u{25}\u{66}\u{5b}\u{1}\u{2d}\u{ff}\u{5d}\u{25}\u{77}","\u{2e}") == "\u{2e}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}"))
336+assert((string.gsub("\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}","\u{25}\u{66}\u{5b}\u{5e}\u{1}\u{2d}\u{ff}\u{5d}","\u{2e}") == "\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{2e}"))
337+assert((string.find("\u{61}","\u{25}\u{66}\u{5b}\u{61}\u{5d}") == 0x1))
338+assert((string.find("\u{61}","\u{25}\u{66}\u{5b}\u{5e}\u{25}\u{7a}\u{5d}") == 0x1))
339+assert((string.find("\u{61}","\u{25}\u{66}\u{5b}\u{5e}\u{25}\u{6c}\u{5d}") == 0x2))
340+assert((string.find("\u{61}\u{62}\u{61}","\u{25}\u{66}\u{5b}\u{61}\u{25}\u{7a}\u{5d}") == 0x3))
341+assert((string.find("\u{61}\u{62}\u{61}","\u{25}\u{66}\u{5b}\u{25}\u{7a}\u{5d}") == 0x4))
342+assert((not string.find("\u{61}\u{62}\u{61}","\u{25}\u{66}\u{5b}\u{25}\u{6c}\u{25}\u{7a}\u{5d}")))
343+assert((not string.find("\u{61}\u{62}\u{61}","\u{25}\u{66}\u{5b}\u{5e}\u{25}\u{6c}\u{25}\u{7a}\u{5d}")))
344+local i,e = string.find("\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6c}\u{6f}","\u{25}\u{66}\u{5b}\u{25}\u{53}\u{5d}\u{2e}\u{2d}\u{25}\u{66}\u{5b}\u{25}\u{73}\u{5d}\u{2e}\u{2d}\u{25}\u{66}\u{5b}\u{25}\u{53}\u{5d}")
345+assert(((i == 0x2) and (e == 0x5)))
346+local k = string.match("\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6c}\u{6f}","\u{25}\u{66}\u{5b}\u{25}\u{53}\u{5d}\u{28}\u{2e}\u{2d}\u{25}\u{66}\u{5b}\u{25}\u{73}\u{5d}\u{2e}\u{2d}\u{25}\u{66}\u{5b}\u{25}\u{53}\u{5d}\u{29}")
347+assert((k == "\u{61}\u{6c}\u{6f}\u{20}"))
348+local a = {0x1,0x5,0x9,0xe,0x11}
349+for k in string.gmatch("\u{61}\u{6c}\u{6f}\u{20}\u{61}\u{6c}\u{6f}\u{20}\u{74}\u{68}\u{30}\u{32}\u{20}\u{69}\u{73}\u{20}\u{31}\u{68}\u{61}\u{74}","\u{28}\u{29}\u{25}\u{66}\u{5b}\u{25}\u{77}\u{25}\u{64}\u{5d}")
350+do
351+assert((table.remove(a,0x1) == k))
352+end
353+assert((# (a == 0x0)))
354+local function malform
355+(p,m)
356+m=(m or "\u{6d}\u{61}\u{6c}\u{66}\u{6f}\u{72}\u{6d}\u{65}\u{64}")
357+local r,msg = pcall(string.find,"\u{61}",p)
358+assert((not (r and string.find(msg,m))))
359+end
360+malform("\u{28}\u{2e}","\u{75}\u{6e}\u{66}\u{69}\u{6e}\u{69}\u{73}\u{68}\u{65}\u{64}\u{20}\u{63}\u{61}\u{70}\u{74}\u{75}\u{72}\u{65}")
361+malform("\u{2e}\u{29}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{70}\u{61}\u{74}\u{74}\u{65}\u{72}\u{6e}\u{20}\u{63}\u{61}\u{70}\u{74}\u{75}\u{72}\u{65}")
362+malform("\u{5b}\u{61}")
363+malform("\u{5b}\u{5d}")
364+malform("\u{5b}\u{5e}\u{5d}")
365+malform("\u{5b}\u{61}\u{25}\u{5d}")
366+malform("\u{5b}\u{61}\u{25}")
367+malform("\u{25}\u{62}")
368+malform("\u{25}\u{62}\u{61}")
369+malform("\u{25}")
370+malform("\u{25}\u{66}","\u{6d}\u{69}\u{73}\u{73}\u{69}\u{6e}\u{67}")
371+assert((string.match("\u{61}\u{62}\u{0}\u{1}\u{2}\u{63}","\u{5b}\u{0}\u{2d}\u{2}\u{5d}\u{2b}") == "\u{0}\u{1}\u{2}"))
372+assert((string.match("\u{61}\u{62}\u{0}\u{1}\u{2}\u{63}","\u{5b}\u{0}\u{2d}\u{0}\u{5d}\u{2b}") == "\u{0}"))
373+assert((string.find("\u{62}\u{24}\u{61}","\u{24}\u{0}\u{3f}") == 0x2))
374+assert((string.find("\u{61}\u{62}\u{63}\u{0}\u{65}\u{66}\u{67}","\u{25}\u{0}") == 0x4))
375+assert((string.match("\u{61}\u{62}\u{63}\u{0}\u{65}\u{66}\u{67}\u{0}\u{1}\u{65}\u{1}\u{67}","\u{25}\u{62}\u{0}\u{1}") == "\u{0}\u{65}\u{66}\u{67}\u{0}\u{1}\u{65}\u{1}"))
376+assert((string.match("\u{61}\u{62}\u{63}\u{0}\u{0}\u{0}","\u{25}\u{0}\u{2b}") == "\u{0}\u{0}\u{0}"))
377+assert((string.match("\u{61}\u{62}\u{63}\u{0}\u{0}\u{0}","\u{25}\u{0}\u{25}\u{0}\u{3f}") == "\u{0}\u{0}"))
378+assert((string.find("\u{61}\u{62}\u{63}\u{0}\u{0}","\u{0}\u{2e}") == 0x4))
379+assert((string.find("\u{61}\u{62}\u{63}\u{78}\u{0}\u{0}\u{61}\u{62}\u{63}\u{0}\u{61}\u{62}\u{63}","\u{78}\u{0}\u{0}\u{61}\u{62}\u{63}\u{0}\u{61}\u{2e}") == 0x4))
380+do
381+local s = string.rep("\u{61}",0x64)
382+local r = string.gsub(s,"\u{62}","\u{63}")
383+assert((string.format("\u{25}\u{70}",s) == string.format("\u{25}\u{70}",r)))
384+r=string.gsub(s,"\u{2e}",{["\u{78}"] = "\u{79}"})
385+assert((string.format("\u{25}\u{70}",s) == string.format("\u{25}\u{70}",r)))
386+local count = 0x0
387+r=string.gsub(s,"\u{2e}",function (x)
388+assert((x == "\u{61}"))
389+count=(count + 0x1)
390+return nil
391+end)
392+r=string.gsub(r,"\u{2e}",{["\u{62}"] = "\u{78}"})
393+assert((count == 0x64))
394+assert((string.format("\u{25}\u{70}",s) == string.format("\u{25}\u{70}",r)))
395+count=0x0
396+r=string.gsub(s,"\u{2e}",function (x)
397+assert((x == "\u{61}"))
398+count=(count + 0x1)
399+return x
400+end)
401+assert((count == 0x64))
402+assert(((r == s) and (string.format("\u{25}\u{70}",s) ~= string.format("\u{25}\u{70}",r))))
403+end
404+print("\u{4f}\u{4b}")
desk/res/lua/cycled/sort.luanew file+309
@@ -0,0 +1,309 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{28}\u{70}\u{61}\u{72}\u{74}\u{73}\u{20}\u{6f}\u{66}\u{29}\u{20}\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}")
2+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{75}\u{6e}\u{70}\u{61}\u{63}\u{6b}")
3+local unpack = table.unpack
4+local maxI = math.maxinteger
5+local minI = math.mininteger
6+local function checkerror
7+(msg,f, ...)
8+local s,err = pcall(f,...)
9+assert((not (s and string.find(err,msg))))
10+end
11+checkerror("\u{77}\u{72}\u{6f}\u{6e}\u{67}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{6f}\u{66}\u{20}\u{61}\u{72}\u{67}\u{75}\u{6d}\u{65}\u{6e}\u{74}\u{73}",table.insert,{},0x2,0x3,0x4)
12+local x,y,z,a,n
13+a={}
14+;
15+local lim = ((_soft and 0xc8) or 0x7d0)
16+for i = 0x1, lim
17+do
18+a[i]=i
19+end
20+assert(((select(lim,unpack(a)) == lim) and (select("\u{23}",unpack(a)) == lim)))
21+x=unpack(a)
22+assert((x == 0x1))
23+x={unpack(a)}
24+assert((# (((x == lim) and (x[0x1] == 0x1)) and (x[lim] == lim))))
25+x={unpack(a,(lim - 0x2))}
26+assert((# (((x == 0x3) and (x[0x1] == (lim - 0x2))) and (x[0x3] == lim))))
27+x={unpack(a,0xa,0x6)}
28+assert((next(x) == nil))
29+x={unpack(a,0xb,0xa)}
30+assert((next(x) == nil))
31+x,y=unpack(a,0xa,0xa)
32+assert(((x == 0xa) and (y == nil)))
33+x,y,z=unpack(a,0xa,0xb)
34+assert((((x == 0xa) and (y == 0xb)) and (z == nil)))
35+a,x=unpack({0x1})
36+assert(((a == 0x1) and (x == nil)))
37+a,x=unpack({0x1,0x2},0x1,0x1)
38+assert(((a == 0x1) and (x == nil)))
39+do
40+local maxi = ((0x1 << 0x1f) - 0x1)
41+local mini = (- (0x1 << 0x1f))
42+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},0x0,maxi)
43+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},0x1,maxi)
44+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},0x0,maxI)
45+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},0x1,maxI)
46+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},mini,maxi)
47+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},(- maxi),maxi)
48+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}\u{20}\u{72}\u{65}\u{73}\u{75}\u{6c}\u{74}\u{73}",unpack,{},minI,maxI)
49+unpack({},maxi,0x0)
50+unpack({},maxi,0x1)
51+unpack({},maxI,minI)
52+pcall(unpack,{},0x1,(maxi + 0x1))
53+local a,b = unpack({[maxi] = 0x14},maxi,maxi)
54+assert(((a == 0x14) and (b == nil)))
55+a,b=unpack({[maxi] = 0x14},(maxi - 0x1),maxi)
56+assert(((a == nil) and (b == 0x14)))
57+local t = {[(maxI - 0x1)] = 0xc,[maxI] = 0x17}
58+a,b=unpack(t,(maxI - 0x1),maxI)
59+;
60+assert(((a == 0xc) and (b == 0x17)))
61+a,b=unpack(t,maxI,maxI)
62+;
63+assert(((a == 0x17) and (b == nil)))
64+a,b=unpack(t,maxI,(maxI - 0x1))
65+;
66+assert(((a == nil) and (b == nil)))
67+t={[minI] = 12.3,[(minI + 0x1)] = 23.5}
68+a,b=unpack(t,minI,(minI + 0x1))
69+;
70+assert(((a == 12.3) and (b == 23.5)))
71+a,b=unpack(t,minI,minI)
72+;
73+assert(((a == 12.3) and (b == nil)))
74+a,b=unpack(t,(minI + 0x1),minI)
75+;
76+assert(((a == nil) and (b == nil)))
77+end
78+do
79+local t = setmetatable({},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
80+return "\u{61}\u{62}\u{63}"
81+end})
82+assert((# (t == "\u{61}\u{62}\u{63}")))
83+checkerror("\u{6f}\u{62}\u{6a}\u{65}\u{63}\u{74}\u{20}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{69}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{6e}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}",table.insert,t,0x1)
84+end
85+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{63}\u{6b}")
86+a=table.pack()
87+assert(((a[0x1] == undef) and (a.n == 0x0)))
88+a=table.pack(table)
89+assert(((a[0x1] == table) and (a.n == 0x1)))
90+a=table.pack(nil,nil,nil,nil)
91+assert(((a[0x1] == nil) and (a.n == 0x4)))
92+do
93+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.move,0x1,0x2,0x3,0x4)
94+local function eqT
95+(a,b)
96+for k,v in pairs(a)
97+do
98+assert((b[k] == v))
99+end
100+for k,v in pairs(b)
101+do
102+assert((a[k] == v))
103+end
104+end
105+local a = table.move({0xa,0x14,0x1e},0x1,0x3,0x2)
106+eqT(a,{0xa,0xa,0x14,0x1e})
107+a=table.move({0xa,0x14,0x1e},0x1,0x3,0x3)
108+eqT(a,{0xa,0x14,0xa,0x14,0x1e})
109+a={0xa,0x14,0x1e,0x28}
110+table.move(a,0x1,0x4,0x2,a)
111+eqT(a,{0xa,0xa,0x14,0x1e,0x28})
112+a=table.move({0xa,0x14,0x1e},0x2,0x3,0x1)
113+eqT(a,{0x14,0x1e,0x1e})
114+a={}
115+assert((table.move({0xa,0x14,0x1e},0x1,0x3,0x1,a) == a))
116+eqT(a,{0xa,0x14,0x1e})
117+a={}
118+assert((table.move({0xa,0x14,0x1e},0x1,0x0,0x3,a) == a))
119+eqT(a,{})
120+a=table.move({0xa,0x14,0x1e},0x1,0xa,0x1)
121+eqT(a,{0xa,0x14,0x1e})
122+a=table.move({[(maxI - 0x2)] = 0x1,[(maxI - 0x1)] = 0x2,[maxI] = 0x3},(maxI - 0x2),maxI,(- 0xa),{})
123+eqT(a,{[(- 0xa)] = 0x1,[(- 0x9)] = 0x2,[(- 0x8)] = 0x3})
124+a=table.move({[minI] = 0x1,[(minI + 0x1)] = 0x2,[(minI + 0x2)] = 0x3},minI,(minI + 0x2),(- 0xa),{})
125+eqT(a,{[(- 0xa)] = 0x1,[(- 0x9)] = 0x2,[(- 0x8)] = 0x3})
126+a=table.move({0x2d},0x1,0x1,maxI)
127+eqT(a,{0x2d,[maxI] = 0x2d})
128+a=table.move({[maxI] = 0x64},maxI,maxI,minI)
129+eqT(a,{[minI] = 0x64,[maxI] = 0x64})
130+a=table.move({[minI] = 0x64},minI,minI,maxI)
131+eqT(a,{[minI] = 0x64,[maxI] = 0x64})
132+a=setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k)
133+return (k * 0xa)
134+end,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = error})
135+local b = table.move(a,0x1,0xa,0x3,{})
136+eqT(a,{})
137+eqT(b,{nil,nil,0xa,0x14,0x1e,0x28,0x32,0x3c,0x46,0x50,0x5a,0x64})
138+b=setmetatable({""},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = error,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (t,k,v)
139+t[0x1]=string.format("\u{25}\u{73}\u{28}\u{25}\u{64}\u{2c}\u{25}\u{64}\u{29}",t[0x1],k,v)
140+end})
141+table.move(a,0xa,0xd,0x3,b)
142+assert((b[0x1] == "\u{28}\u{33}\u{2c}\u{31}\u{30}\u{30}\u{29}\u{28}\u{34}\u{2c}\u{31}\u{31}\u{30}\u{29}\u{28}\u{35}\u{2c}\u{31}\u{32}\u{30}\u{29}\u{28}\u{36}\u{2c}\u{31}\u{33}\u{30}\u{29}"))
143+local stat,msg = pcall(table.move,b,0xa,0xd,0x3,b)
144+assert((not (stat and (msg == b))))
145+end
146+do
147+local function checkmove
148+(f,e,t,x,y)
149+local pos1,pos2
150+local a = setmetatable({},{["\u{5f}\u{5f}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k)
151+pos1=k
152+end,["\u{5f}\u{5f}\u{6e}\u{65}\u{77}\u{69}\u{6e}\u{64}\u{65}\u{78}"] = function (_,k)
153+pos2=k
154+;
155+error()
156+end})
157+local st,msg = pcall(table.move,a,f,e,t)
158+assert((not (st and (not ((msg and (pos1 == x)) and (pos2 == y))))))
159+end
160+checkmove(0x1,maxI,0x0,0x1,0x0)
161+checkmove(0x0,(maxI - 0x1),0x1,(maxI - 0x1),maxI)
162+checkmove(minI,(- 0x2),(- 0x5),(- 0x2),(maxI - 0x6))
163+checkmove((minI + 0x1),(- 0x1),(- 0x2),(- 0x1),(maxI - 0x3))
164+checkmove(minI,(- 0x2),0x0,minI,0x0)
165+checkmove((minI + 0x1),(- 0x1),0x1,(minI + 0x1),0x1)
166+end
167+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}",table.move,{},0x0,maxI,0x1)
168+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}",table.move,{},(- 0x1),(maxI - 0x1),0x1)
169+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}",table.move,{},minI,(- 0x1),0x1)
170+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6d}\u{61}\u{6e}\u{79}",table.move,{},minI,maxI,0x1)
171+checkerror("\u{77}\u{72}\u{61}\u{70}\u{20}\u{61}\u{72}\u{6f}\u{75}\u{6e}\u{64}",table.move,{},0x1,maxI,0x2)
172+checkerror("\u{77}\u{72}\u{61}\u{70}\u{20}\u{61}\u{72}\u{6f}\u{75}\u{6e}\u{64}",table.move,{},0x1,0x2,maxI)
173+checkerror("\u{77}\u{72}\u{61}\u{70}\u{20}\u{61}\u{72}\u{6f}\u{75}\u{6e}\u{64}",table.move,{},minI,(- 0x2),0x2)
174+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{6f}\u{72}\u{74}")
175+local a = setmetatable({},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
176+return (- 0x1)
177+end})
178+assert((# (a == (- 0x1))))
179+table.sort(a,error)
180+a=setmetatable({},{["\u{5f}\u{5f}\u{6c}\u{65}\u{6e}"] = function ()
181+return maxI
182+end})
183+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{62}\u{69}\u{67}",table.sort,a)
184+local function check
185+(t)
186+local function f
187+(a,b)
188+assert((a and b))
189+;
190+return true
191+end
192+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}",table.sort,t,f)
193+end
194+check({0x1,0x2,0x3,0x4})
195+check({0x1,0x2,0x3,0x4,0x5})
196+check({0x1,0x2,0x3,0x4,0x5,0x6})
197+function check(a,f)
198+f=(f or function (x,y)
199+return (x < y)
200+end)
201+;
202+for n = (# a), 0x2, (- 0x1)
203+do
204+assert((not f(a[n],a[(n - 0x1)])))
205+end
206+end
207+a={"\u{4a}\u{61}\u{6e}","\u{46}\u{65}\u{62}","\u{4d}\u{61}\u{72}","\u{41}\u{70}\u{72}","\u{4d}\u{61}\u{79}","\u{4a}\u{75}\u{6e}","\u{4a}\u{75}\u{6c}","\u{41}\u{75}\u{67}","\u{53}\u{65}\u{70}","\u{4f}\u{63}\u{74}","\u{4e}\u{6f}\u{76}","\u{44}\u{65}\u{63}"}
208+table.sort(a)
209+check(a)
210+local function perm
211+(s,n)
212+n=(n or (# s))
213+if (n == 0x1) then
214+local t = {unpack(s)}
215+table.sort(t)
216+check(t)
217+else
218+for i = 0x1, n
219+do
220+s[i],s[n]=s[n],s[i]
221+perm(s,(n - 0x1))
222+s[i],s[n]=s[n],s[i]
223+end
224+end
225+end
226+perm({})
227+perm({0x1})
228+perm({0x1,0x2})
229+perm({0x1,0x2,0x3})
230+perm({0x1,0x2,0x3,0x4})
231+perm({0x2,0x2,0x3,0x4})
232+perm({0x1,0x2,0x3,0x4,0x5})
233+perm({0x1,0x2,0x3,0x3,0x5})
234+perm({0x1,0x2,0x3,0x4,0x5,0x6})
235+perm({0x2,0x2,0x3,0x3,0x5,0x6})
236+local function timesort
237+(a,n,func,msg,pre)
238+local x = os.clock()
239+table.sort(a,func)
240+x=((os.clock() - x) * 0x3e8)
241+pre=(pre or "")
242+print(string.format("\u{25}\u{73}\u{73}\u{6f}\u{72}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{25}\u{64}\u{20}\u{25}\u{73}\u{20}\u{65}\u{6c}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{2e}\u{32}\u{66}\u{20}\u{6d}\u{73}\u{65}\u{63}\u{2e}",pre,n,msg,x))
243+check(a,func)
244+end
245+local limit = 0xc350
246+if _soft then
247+limit=0x1388
248+end
249+a={}
250+for i = 0x1, limit
251+do
252+a[i]=math.random()
253+end
254+timesort(a,limit,nil,"\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}")
255+timesort(a,limit,nil,"\u{73}\u{6f}\u{72}\u{74}\u{65}\u{64}","\u{72}\u{65}\u{2d}")
256+a={}
257+for i = 0x1, limit
258+do
259+a[i]=math.random()
260+end
261+local x = os.clock()
262+;
263+local i = 0x0
264+table.sort(a,function (x,y)
265+i=(i + 0x1)
266+;
267+return (y < x)
268+end)
269+x=((os.clock() - x) * 0x3e8)
270+print(string.format("\u{49}\u{6e}\u{76}\u{65}\u{72}\u{74}\u{2d}\u{73}\u{6f}\u{72}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{74}\u{68}\u{65}\u{72}\u{20}\u{25}\u{64}\u{20}\u{65}\u{6c}\u{65}\u{6d}\u{65}\u{6e}\u{74}\u{73}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{2e}\u{32}\u{66}\u{20}\u{6d}\u{73}\u{65}\u{63}\u{2e}\u{2c}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{25}\u{69}\u{20}\u{63}\u{6f}\u{6d}\u{70}\u{61}\u{72}\u{69}\u{73}\u{6f}\u{6e}\u{73}",limit,x,i))
271+check(a,function (x,y)
272+return (y < x)
273+end)
274+table.sort({})
275+for i = 0x1, limit
276+do
277+a[i]=false
278+end
279+timesort(a,limit,function (x,y)
280+return nil
281+end,"\u{65}\u{71}\u{75}\u{61}\u{6c}")
282+for i,v in pairs(a)
283+do
284+assert((v == false))
285+end
286+AA={"\u{e1}\u{6c}\u{6f}","\u{0}\u{66}\u{69}\u{72}\u{73}\u{74}\u{20}\u{3a}\u{2d}\u{29}","\u{61}\u{6c}\u{6f}","\u{74}\u{68}\u{65}\u{6e}\u{20}\u{74}\u{68}\u{69}\u{73}\u{20}\u{6f}\u{6e}\u{65}","\u{34}\u{35}","\u{61}\u{6e}\u{64}\u{20}\u{61}\u{20}\u{6e}\u{65}\u{77}"}
287+table.sort(AA)
288+check(AA)
289+table.sort(AA,function (x,y)
290+load(string.format("\u{41}\u{41}\u{5b}\u{25}\u{71}\u{5d}\u{20}\u{3d}\u{20}\u{27}\u{27}",x),"")()
291+collectgarbage()
292+return (x < y)
293+end)
294+_G.AA=nil
295+local tt = {["\u{5f}\u{5f}\u{6c}\u{74}"] = function (a,b)
296+return (a.val < b.val)
297+end}
298+a={}
299+for i = 0x1, 0xa
300+do
301+a[i]={["\u{76}\u{61}\u{6c}"] = math.random(0x64)}
302+;
303+setmetatable(a[i],tt)
304+;
305+end
306+table.sort(a)
307+check(a,tt.__lt)
308+check(a)
309+print("\u{4f}\u{4b}")
desk/res/lua/cycled/strings.luanew file+441
@@ -0,0 +1,441 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}")
2+local maxi <const> = math.maxinteger
3+local mini <const> = math.mininteger
4+local function checkerror
5+(msg,f, ...)
6+local s,err = pcall(f,...)
7+assert((not (s and string.find(err,msg))))
8+end
9+assert(("\u{61}\u{6c}\u{6f}" < "\u{61}\u{6c}\u{6f}\u{31}"))
10+assert(("" < "\u{61}"))
11+assert(("\u{61}\u{6c}\u{6f}\u{0}\u{61}\u{6c}\u{6f}" < "\u{61}\u{6c}\u{6f}\u{0}\u{62}"))
12+assert(("\u{61}\u{6c}\u{6f}\u{0}\u{61}\u{6c}\u{6f}\u{0}\u{0}" > "\u{61}\u{6c}\u{6f}\u{0}\u{61}\u{6c}\u{6f}\u{0}"))
13+assert(("\u{61}\u{6c}\u{6f}" < "\u{61}\u{6c}\u{6f}\u{0}"))
14+assert(("\u{61}\u{6c}\u{6f}\u{0}" > "\u{61}\u{6c}\u{6f}"))
15+assert(("\u{0}" < "\u{1}"))
16+assert(("\u{0}\u{0}" < "\u{0}\u{1}"))
17+assert(("\u{1}\u{0}\u{61}\u{0}\u{61}" <= "\u{1}\u{0}\u{61}\u{0}\u{61}"))
18+assert((not ("\u{1}\u{0}\u{61}\u{0}\u{62}" <= "\u{1}\u{0}\u{61}\u{0}\u{61}")))
19+assert(("\u{0}\u{0}\u{0}" < "\u{0}\u{0}\u{0}\u{0}"))
20+assert((not ("\u{0}\u{0}\u{0}\u{0}" < "\u{0}\u{0}\u{0}")))
21+assert(("\u{0}\u{0}\u{0}" <= "\u{0}\u{0}\u{0}\u{0}"))
22+assert((not ("\u{0}\u{0}\u{0}\u{0}" <= "\u{0}\u{0}\u{0}")))
23+assert(("\u{0}\u{0}\u{0}" <= "\u{0}\u{0}\u{0}"))
24+assert(("\u{0}\u{0}\u{0}" >= "\u{0}\u{0}\u{0}"))
25+assert((not ("\u{0}\u{0}\u{62}" < "\u{0}\u{0}\u{61}\u{0}")))
26+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x2,0x4) == "\u{32}\u{33}\u{34}"))
27+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x7) == "\u{37}\u{38}\u{39}"))
28+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x7,0x6) == ""))
29+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x7,0x7) == "\u{37}"))
30+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x0,0x0) == ""))
31+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",(- 0xa),0xa) == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"))
32+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x1,0x9) == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"))
33+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",(- 0xa),(- 0x14)) == ""))
34+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",(- 0x1)) == "\u{39}"))
35+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",(- 0x4)) == "\u{36}\u{37}\u{38}\u{39}"))
36+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",(- 0x6),(- 0x4)) == "\u{34}\u{35}\u{36}"))
37+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",mini,(- 0x4)) == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}"))
38+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",mini,maxi) == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"))
39+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",mini,mini) == ""))
40+assert((string.sub("\u{0}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",0x3,0x5) == "\u{32}\u{33}\u{34}"))
41+assert((("\u{0}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}"):sub(0x8) == "\u{37}\u{38}\u{39}"))
42+assert((string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{33}\u{34}\u{35}") == 0x3))
43+local a,b = string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{33}\u{34}\u{35}")
44+assert((string.sub("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}",a,b) == "\u{33}\u{34}\u{35}"))
45+assert((string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{33}\u{34}\u{35}",0x3) == 0x3))
46+assert((string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{33}\u{34}\u{35}",0x4) == 0xd))
47+assert((not string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{33}\u{34}\u{36}",0x4)))
48+assert((string.find("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}","\u{2e}\u{34}\u{35}",(- 0x9)) == 0xd))
49+assert((not string.find("\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}","\u{0}",0x5,0x1)))
50+assert((string.find("","") == 0x1))
51+assert((string.find("","",0x1) == 0x1))
52+assert((not string.find("","",0x2)))
53+assert((not string.find("","\u{61}\u{61}\u{61}",0x1)))
54+assert((("\u{61}\u{6c}\u{6f}\u{28}\u{2e}\u{29}\u{61}\u{6c}\u{6f}"):find("\u{28}\u{2e}\u{29}",0x1,0x1) == 0x4))
55+assert((string.len("") == 0x0))
56+assert((string.len("\u{0}\u{0}\u{0}") == 0x3))
57+assert((string.len("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}") == 0xa))
58+assert((# ("" == 0x0)))
59+assert((# ("\u{0}\u{0}\u{0}" == 0x3)))
60+assert((# ("\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}" == 0xa)))
61+assert((string.byte("\u{61}") == 0x61))
62+assert((string.byte("\u{e4}") > 0x7f))
63+assert((string.byte(string.char(0xff)) == 0xff))
64+assert((string.byte(string.char(0x0)) == 0x0))
65+assert((string.byte("\u{0}") == 0x0))
66+assert((string.byte("\u{0}\u{0}\u{61}\u{6c}\u{6f}\u{0}\u{78}",(- 0x1)) == string.byte("\u{78}")))
67+assert((string.byte("\u{62}\u{61}",0x2) == 0x61))
68+assert((string.byte("\u{a}\u{a}",0x2,(- 0x1)) == 0xa))
69+assert((string.byte("\u{a}\u{a}",0x2,0x2) == 0xa))
70+assert((string.byte("") == nil))
71+assert((string.byte("\u{68}\u{69}",(- 0x3)) == nil))
72+assert((string.byte("\u{68}\u{69}",0x3) == nil))
73+assert((string.byte("\u{68}\u{69}",0x9,0xa) == nil))
74+assert((string.byte("\u{68}\u{69}",0x2,0x1) == nil))
75+assert((string.char() == ""))
76+assert((string.char(0x0,0xff,0x0) == "\u{0}\u{ff}\u{0}"))
77+assert((string.char(0x0,string.byte("\u{e4}"),0x0) == "\u{0}\u{e4}\u{0}"))
78+assert((string.char(string.byte("\u{e4}\u{6c}\u{0}\u{f3}\u{75}",0x1,(- 0x1))) == "\u{e4}\u{6c}\u{0}\u{f3}\u{75}"))
79+assert((string.char(string.byte("\u{e4}\u{6c}\u{0}\u{f3}\u{75}",0x1,0x0)) == ""))
80+assert((string.char(string.byte("\u{e4}\u{6c}\u{0}\u{f3}\u{75}",(- 0xa),0x64)) == "\u{e4}\u{6c}\u{0}\u{f3}\u{75}"))
81+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",string.char,0x100)
82+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",string.char,(- 0x1))
83+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",string.char,math.maxinteger)
84+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",string.char,math.mininteger)
85+assert((string.upper("\u{61}\u{62}\u{0}\u{63}") == "\u{41}\u{42}\u{0}\u{43}"))
86+assert((string.lower("\u{0}\u{41}\u{42}\u{43}\u{63}\u{25}\u{24}") == "\u{0}\u{61}\u{62}\u{63}\u{63}\u{25}\u{24}"))
87+assert((string.rep("\u{74}\u{65}\u{73}\u{74}\u{65}",0x0) == ""))
88+assert((string.rep("\u{74}\u{e9}\u{73}\u{0}\u{74}\u{ea}",0x2) == "\u{74}\u{e9}\u{73}\u{0}\u{74}\u{ea}\u{74}\u{e9}\u{73}\u{0}\u{74}\u{ea}"))
89+assert((string.rep("",0xa) == ""))
90+if (string.packsize("\u{69}") == 0x4) then
91+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}",string.rep,"\u{61}\u{61}",(0x1 << 0x1e))
92+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}",string.rep,"\u{61}",(0x1 << 0x1e),"\u{2c}")
93+end
94+assert((string.rep("\u{74}\u{65}\u{73}\u{74}\u{65}",0x0,"\u{78}\u{75}\u{78}\u{75}") == ""))
95+assert((string.rep("\u{74}\u{65}\u{73}\u{74}\u{65}",0x1,"\u{78}\u{75}\u{78}\u{75}") == "\u{74}\u{65}\u{73}\u{74}\u{65}"))
96+assert((string.rep("\u{1}\u{0}\u{1}",0x2,"\u{0}\u{0}") == "\u{1}\u{0}\u{1}\u{0}\u{0}\u{1}\u{0}\u{1}"))
97+assert((string.rep("",0xa,"\u{2e}") == string.rep("\u{2e}",0x9)))
98+assert((not pcall(string.rep,"\u{61}\u{61}",((maxi // 0x2) + 0xa))))
99+assert((not pcall(string.rep,"",((maxi // 0x2) + 0xa),"\u{61}\u{61}")))
100+assert((string.reverse("") == ""))
101+assert((string.reverse("\u{0}\u{1}\u{2}\u{3}") == "\u{3}\u{2}\u{1}\u{0}"))
102+assert((string.reverse("\u{0}\u{31}\u{32}\u{33}\u{34}") == "\u{34}\u{33}\u{32}\u{31}\u{0}"))
103+for i = 0x0, 0x1e
104+do
105+assert((string.len(string.rep("\u{61}",i)) == i))
106+end
107+assert((type(tostring(nil)) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
108+assert((type(tostring(0xc)) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"))
109+assert(string.find(tostring({}),"\u{74}\u{61}\u{62}\u{6c}\u{65}\u{3a}"))
110+assert(string.find(tostring(print),"\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{3a}"))
111+assert((# (tostring("\u{0}") == 0x1)))
112+assert((tostring(true) == "\u{74}\u{72}\u{75}\u{65}"))
113+assert((tostring(false) == "\u{66}\u{61}\u{6c}\u{73}\u{65}"))
114+assert((tostring((- 0x4b3)) == "\u{2d}\u{31}\u{32}\u{30}\u{33}"))
115+assert((tostring(1203.125) == "\u{31}\u{32}\u{30}\u{33}\u{2e}\u{31}\u{32}\u{35}"))
116+assert((tostring((- 0.5)) == "\u{2d}\u{30}\u{2e}\u{35}"))
117+assert((tostring((- 0x7fff)) == "\u{2d}\u{33}\u{32}\u{37}\u{36}\u{37}"))
118+if math.tointeger(0x7fffffff) then
119+assert((tostring((- 0x7fffffff)) == "\u{2d}\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{37}"))
120+end
121+if math.tointeger(0x4000000000000000) then
122+assert((tostring(0x4000000000000000) == "\u{34}\u{36}\u{31}\u{31}\u{36}\u{38}\u{36}\u{30}\u{31}\u{38}\u{34}\u{32}\u{37}\u{33}\u{38}\u{37}\u{39}\u{30}\u{34}"))
123+assert((tostring((- 0x4000000000000000)) == "\u{2d}\u{34}\u{36}\u{31}\u{31}\u{36}\u{38}\u{36}\u{30}\u{31}\u{38}\u{34}\u{32}\u{37}\u{33}\u{38}\u{37}\u{39}\u{30}\u{34}"))
124+end
125+if (tostring(0.0) == "\u{30}\u{2e}\u{30}") then
126+assert(((("" .. 0xc) == "\u{31}\u{32}") and ((12.0 .. "") == "\u{31}\u{32}\u{2e}\u{30}")))
127+assert((tostring((- (0x4b3 + 0.0))) == "\u{2d}\u{31}\u{32}\u{30}\u{33}\u{2e}\u{30}"))
128+else
129+assert((tostring(0.0) == "\u{30}"))
130+assert(((("" .. 0xc) == "\u{31}\u{32}") and ((12.0 .. "") == "\u{31}\u{32}")))
131+assert((tostring((- (0x4b3 + 0.0))) == "\u{2d}\u{31}\u{32}\u{30}\u{33}"))
132+end
133+do
134+local null = "\u{28}\u{6e}\u{75}\u{6c}\u{6c}\u{29}"
135+assert((string.format("\u{25}\u{70}",0x4) == null))
136+assert((string.format("\u{25}\u{70}",true) == null))
137+assert((string.format("\u{25}\u{70}",nil) == null))
138+assert((string.format("\u{25}\u{70}",{}) ~= null))
139+assert((string.format("\u{25}\u{70}",print) ~= null))
140+assert((string.format("\u{25}\u{70}",coroutine.running()) ~= null))
141+assert((string.format("\u{25}\u{70}",io.stdin) ~= null))
142+assert((string.format("\u{25}\u{70}",io.stdin) == string.format("\u{25}\u{70}",io.stdin)))
143+assert((string.format("\u{25}\u{70}",print) == string.format("\u{25}\u{70}",print)))
144+assert((string.format("\u{25}\u{70}",print) ~= string.format("\u{25}\u{70}",assert)))
145+assert((# (string.format("\u{25}\u{39}\u{30}\u{70}",{}) == 0x5a)))
146+assert((# (string.format("\u{25}\u{2d}\u{36}\u{30}\u{70}",{}) == 0x3c)))
147+assert((string.format("\u{25}\u{31}\u{30}\u{70}",false) == (string.rep("\u{20}",(0xa - (# null))) .. null)))
148+assert((string.format("\u{25}\u{2d}\u{31}\u{32}\u{70}",1.5) == (null .. string.rep("\u{20}",(0xc - (# null))))))
149+do
150+local t1 = {}
151+;
152+local t2 = {}
153+assert((string.format("\u{25}\u{70}",t1) ~= string.format("\u{25}\u{70}",t2)))
154+end
155+do
156+local s1 = string.rep("\u{61}",0xa)
157+local s2 = string.rep("\u{61}\u{61}",0x5)
158+assert((string.format("\u{25}\u{70}",s1) == string.format("\u{25}\u{70}",s2)))
159+end
160+do
161+local s1 = string.rep("\u{61}",0x12c)
162+;
163+local s2 = string.rep("\u{61}",0x12c)
164+assert((string.format("\u{25}\u{70}",s1) ~= string.format("\u{25}\u{70}",s2)))
165+end
166+end
167+local x = "\u{22}\u{ed}\u{6c}\u{6f}\u{22}\u{a}\u{5c}"
168+assert((string.format("\u{25}\u{71}\u{25}\u{73}",x,x) == "\u{22}\u{5c}\u{22}\u{ed}\u{6c}\u{6f}\u{5c}\u{22}\u{5c}\u{a}\u{5c}\u{5c}\u{22}\u{22}\u{ed}\u{6c}\u{6f}\u{22}\u{a}\u{5c}"))
169+assert((string.format("\u{25}\u{71}","\u{0}") == "\u{22}\u{5c}\u{30}\u{22}"))
170+assert((load(string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{71}",x))() == x))
171+x="\u{0}\u{1}\u{2}\u{33}\u{5}\u{0}\u{39}"
172+assert((load(string.format("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{25}\u{71}",x))() == x))
173+assert((string.format("\u{0}\u{25}\u{63}\u{0}\u{25}\u{63}\u{25}\u{78}\u{0}",string.byte("\u{e4}"),string.byte("\u{62}"),0x8c) == "\u{0}\u{e4}\u{0}\u{62}\u{38}\u{63}\u{0}"))
174+assert((string.format("") == ""))
175+assert(((string.format("\u{25}\u{63}",0x22) .. (string.format("\u{25}\u{63}",0x30) .. (string.format("\u{25}\u{63}",0x5a) .. string.format("\u{25}\u{63}",0x64)))) == string.format("\u{25}\u{31}\u{63}\u{25}\u{2d}\u{63}\u{25}\u{2d}\u{31}\u{63}\u{25}\u{63}",0x22,0x30,0x5a,0x64)))
176+assert((string.format("\u{25}\u{73}\u{0}\u{20}\u{69}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{0}\u{25}\u{73}","\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}","\u{62}\u{65}") == "\u{6e}\u{6f}\u{74}\u{20}\u{62}\u{65}\u{0}\u{20}\u{69}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{0}\u{62}\u{65}"))
177+assert((string.format("\u{25}\u{25}\u{25}\u{64}\u{20}\u{25}\u{30}\u{31}\u{30}\u{64}",0xa,0x17) == "\u{25}\u{31}\u{30}\u{20}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{32}\u{33}"))
178+assert((tonumber(string.format("\u{25}\u{66}",10.3)) == 10.3))
179+assert((string.format("\u{22}\u{25}\u{2d}\u{35}\u{30}\u{73}\u{22}","\u{61}") == ("\u{22}\u{61}" .. (string.rep("\u{20}",0x31) .. "\u{22}"))))
180+assert((string.format("\u{2d}\u{25}\u{2e}\u{32}\u{30}\u{73}\u{2e}\u{32}\u{30}\u{73}",string.rep("\u{25}",0x7d0)) == ("\u{2d}" .. (string.rep("\u{25}",0x14) .. "\u{2e}\u{32}\u{30}\u{73}"))))
181+assert((string.format("\u{22}\u{2d}\u{25}\u{32}\u{30}\u{73}\u{2e}\u{32}\u{30}\u{73}\u{22}",string.rep("\u{25}",0x7d0)) == string.format("\u{25}\u{71}",("\u{2d}" .. (string.rep("\u{25}",0x7d0) .. "\u{2e}\u{32}\u{30}\u{73}")))))
182+do
183+local function checkQ
184+(v)
185+local s = string.format("\u{25}\u{71}",v)
186+local nv = load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. s))()
187+assert(((v == nv) and (math.type(v) == math.type(nv))))
188+end
189+checkQ("\u{0}\u{0}\u{1}\u{ff}\u{234}")
190+checkQ(math.maxinteger)
191+checkQ(math.mininteger)
192+checkQ(math.pi)
193+checkQ(0.1)
194+checkQ(true)
195+checkQ(nil)
196+checkQ(false)
197+checkQ(math.huge)
198+checkQ((- math.huge))
199+assert((string.format("\u{25}\u{71}",(0x0 / 0x0)) == "\u{28}\u{30}\u{2f}\u{30}\u{29}"))
200+checkerror("\u{6e}\u{6f}\u{20}\u{6c}\u{69}\u{74}\u{65}\u{72}\u{61}\u{6c}",string.format,"\u{25}\u{71}",{})
201+end
202+assert((string.format("\u{0}\u{25}\u{73}\u{0}","\u{0}\u{0}\u{1}") == "\u{0}\u{0}\u{0}\u{1}\u{0}"))
203+checkerror("\u{63}\u{6f}\u{6e}\u{74}\u{61}\u{69}\u{6e}\u{73}\u{20}\u{7a}\u{65}\u{72}\u{6f}\u{73}",string.format,"\u{25}\u{31}\u{30}\u{73}","\u{0}")
204+assert((string.format("\u{25}\u{73}\u{20}\u{25}\u{73}",nil,true) == "\u{6e}\u{69}\u{6c}\u{20}\u{74}\u{72}\u{75}\u{65}"))
205+assert((string.format("\u{25}\u{73}\u{20}\u{25}\u{2e}\u{34}\u{73}",false,true) == "\u{66}\u{61}\u{6c}\u{73}\u{65}\u{20}\u{74}\u{72}\u{75}\u{65}"))
206+assert((string.format("\u{25}\u{2e}\u{33}\u{73}\u{20}\u{25}\u{2e}\u{33}\u{73}",false,true) == "\u{66}\u{61}\u{6c}\u{20}\u{74}\u{72}\u{75}"))
207+local m = setmetatable({},{["\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}"] = function ()
208+return "\u{68}\u{65}\u{6c}\u{6c}\u{6f}"
209+end,["\u{5f}\u{5f}\u{6e}\u{61}\u{6d}\u{65}"] = "\u{68}\u{69}"})
210+assert((string.format("\u{25}\u{73}\u{20}\u{25}\u{2e}\u{31}\u{30}\u{73}",m,m) == "\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{68}\u{65}\u{6c}\u{6c}\u{6f}"))
211+getmetatable(m).__tostring=nil
212+assert((string.format("\u{25}\u{2e}\u{34}\u{73}",m) == "\u{68}\u{69}\u{3a}\u{20}"))
213+getmetatable(m).__tostring=function ()
214+return {}
215+end
216+checkerror("\u{27}\u{5f}\u{5f}\u{74}\u{6f}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}\u{20}\u{6d}\u{75}\u{73}\u{74}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",tostring,m)
217+assert((string.format("\u{25}\u{78}",0.0) == "\u{30}"))
218+assert((string.format("\u{25}\u{30}\u{32}\u{78}",0.0) == "\u{30}\u{30}"))
219+assert((string.format("\u{25}\u{30}\u{38}\u{58}",0xffffffff) == "\u{46}\u{46}\u{46}\u{46}\u{46}\u{46}\u{46}\u{46}"))
220+assert((string.format("\u{25}\u{2b}\u{30}\u{38}\u{64}",0x7b0d) == "\u{2b}\u{30}\u{30}\u{33}\u{31}\u{35}\u{30}\u{31}"))
221+assert((string.format("\u{25}\u{2b}\u{30}\u{38}\u{64}",(- 0x78cf)) == "\u{2d}\u{30}\u{30}\u{33}\u{30}\u{39}\u{32}\u{37}"))
222+do
223+local i = 0x1
224+local j = 0x2710
225+while ((i + 0x1) < j) do
226+local m = ((i + j) // 0x2)
227+if ((0xa ^ m) < math.huge) then
228+i=m
229+else
230+j=m
231+end
232+end
233+assert((((0xa ^ i) < math.huge) and ((0xa ^ j) == math.huge)))
234+local s = string.format("\u{25}\u{2e}\u{39}\u{39}\u{66}",(- (0xa ^ i)))
235+assert((string.len(s) >= (i + 0x65)))
236+assert((tonumber(s) == (- (0xa ^ i))))
237+assert(((0xa ^ 0x26) < math.huge))
238+local s = string.format("\u{25}\u{2e}\u{39}\u{39}\u{66}",(- (0xa ^ 0x26)))
239+assert((string.len(s) >= (0x26 + 0x65)))
240+assert((tonumber(s) == (- (0xa ^ 0x26))))
241+end
242+do
243+local max,min = 0x7fffffff,(- 0x80000000)
244+assert((string.sub(string.format("\u{25}\u{38}\u{78}",(- 0x1)),(- 0x8)) == "\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}"))
245+assert((string.format("\u{25}\u{78}",max) == "\u{37}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}"))
246+assert((string.sub(string.format("\u{25}\u{78}",min),(- 0x8)) == "\u{38}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}"))
247+assert((string.format("\u{25}\u{64}",max) == "\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{37}"))
248+assert((string.format("\u{25}\u{64}",min) == "\u{2d}\u{32}\u{31}\u{34}\u{37}\u{34}\u{38}\u{33}\u{36}\u{34}\u{38}"))
249+assert((string.format("\u{25}\u{75}",0xffffffff) == "\u{34}\u{32}\u{39}\u{34}\u{39}\u{36}\u{37}\u{32}\u{39}\u{35}"))
250+assert((string.format("\u{25}\u{6f}",0xabcd) == "\u{31}\u{32}\u{35}\u{37}\u{31}\u{35}"))
251+max,min=0x7fffffffffffffff,(- 0x8000000000000000)
252+if (max > (2.0 ^ 0x35)) then
253+assert((string.format("\u{25}\u{78}",(((0x2 ^ 0x34) | 0x0) - 0x1)) == "\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}"))
254+assert((string.format("\u{30}\u{78}\u{25}\u{38}\u{58}",0x8f000003) == "\u{30}\u{78}\u{38}\u{46}\u{30}\u{30}\u{30}\u{30}\u{30}\u{33}"))
255+assert((string.format("\u{25}\u{64}",(0x2 ^ 0x35)) == "\u{39}\u{30}\u{30}\u{37}\u{31}\u{39}\u{39}\u{32}\u{35}\u{34}\u{37}\u{34}\u{30}\u{39}\u{39}\u{32}"))
256+assert((string.format("\u{25}\u{69}",(- (0x2 ^ 0x35))) == "\u{2d}\u{39}\u{30}\u{30}\u{37}\u{31}\u{39}\u{39}\u{32}\u{35}\u{34}\u{37}\u{34}\u{30}\u{39}\u{39}\u{32}"))
257+assert((string.format("\u{25}\u{78}",max) == "\u{37}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}"))
258+assert((string.format("\u{25}\u{78}",min) == "\u{38}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}"))
259+assert((string.format("\u{25}\u{64}",max) == "\u{39}\u{32}\u{32}\u{33}\u{33}\u{37}\u{32}\u{30}\u{33}\u{36}\u{38}\u{35}\u{34}\u{37}\u{37}\u{35}\u{38}\u{30}\u{37}"))
260+assert((string.format("\u{25}\u{64}",min) == "\u{2d}\u{39}\u{32}\u{32}\u{33}\u{33}\u{37}\u{32}\u{30}\u{33}\u{36}\u{38}\u{35}\u{34}\u{37}\u{37}\u{35}\u{38}\u{30}\u{38}"))
261+assert((string.format("\u{25}\u{75}",(~ (- (0x1 << 0x40)))) == "\u{31}\u{38}\u{34}\u{34}\u{36}\u{37}\u{34}\u{34}\u{30}\u{37}\u{33}\u{37}\u{30}\u{39}\u{35}\u{35}\u{31}\u{36}\u{31}\u{35}"))
262+assert((tostring(0x11f71fb04cb) == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{38}\u{39}\u{30}\u{31}\u{32}\u{33}"))
263+end
264+end
265+do
266+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{20}\u{25}\u{61}\u{20}\u{25}\u{41}\u{27}")
267+local function matchhexa
268+(n)
269+local s = string.format("\u{25}\u{61}",n)
270+assert(string.find(s,"\u{5e}\u{25}\u{2d}\u{3f}\u{30}\u{78}\u{5b}\u{31}\u{2d}\u{39}\u{61}\u{2d}\u{66}\u{5d}\u{25}\u{2e}\u{3f}\u{5b}\u{30}\u{2d}\u{39}\u{61}\u{2d}\u{66}\u{5d}\u{2a}\u{70}\u{5b}\u{2d}\u{2b}\u{5d}\u{3f}\u{25}\u{64}\u{2b}\u{24}"))
271+assert((tonumber(s) == n))
272+s=string.format("\u{25}\u{41}",n)
273+assert(string.find(s,"\u{5e}\u{25}\u{2d}\u{3f}\u{30}\u{58}\u{5b}\u{31}\u{2d}\u{39}\u{41}\u{2d}\u{46}\u{5d}\u{25}\u{2e}\u{3f}\u{5b}\u{30}\u{2d}\u{39}\u{41}\u{2d}\u{46}\u{5d}\u{2a}\u{50}\u{5b}\u{2d}\u{2b}\u{5d}\u{3f}\u{25}\u{64}\u{2b}\u{24}"))
274+assert((tonumber(s) == n))
275+end
276+for _,n in ipairs({0.1,(- 0.1),(0x1 / 0x3),(- (0x1 / 0x3)),1e30,(- 1e30),(- (0x2d / 0xf7)),0x1,(- 0x1),0x2,(- 0x2),3e-20,(- 3e-20)})
277+do
278+matchhexa(n)
279+end
280+assert(string.find(string.format("\u{25}\u{41}",0.0),"\u{5e}\u{30}\u{58}\u{30}\u{25}\u{2e}\u{3f}\u{30}\u{2a}\u{50}\u{25}\u{2b}\u{3f}\u{30}\u{24}"))
281+assert(string.find(string.format("\u{25}\u{61}",(- 0.0)),"\u{5e}\u{25}\u{2d}\u{30}\u{78}\u{30}\u{25}\u{2e}\u{3f}\u{30}\u{2a}\u{70}\u{25}\u{2b}\u{3f}\u{30}\u{24}"))
282+if (not _port) then
283+assert(string.find(string.format("\u{25}\u{61}",(0x1 / 0x0)),"\u{5e}\u{69}\u{6e}\u{66}"))
284+assert(string.find(string.format("\u{25}\u{41}",(- (0x1 / 0x0))),"\u{5e}\u{25}\u{2d}\u{49}\u{4e}\u{46}"))
285+assert(string.find(string.format("\u{25}\u{61}",(0x0 / 0x0)),"\u{5e}\u{25}\u{2d}\u{3f}\u{6e}\u{61}\u{6e}"))
286+assert(string.find(string.format("\u{25}\u{61}",(- 0.0)),"\u{5e}\u{25}\u{2d}\u{30}\u{78}\u{30}"))
287+end
288+if (not pcall(string.format,"\u{25}\u{2e}\u{33}\u{61}",0x0)) then
289+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{6d}\u{6f}\u{64}\u{69}\u{66}\u{69}\u{65}\u{72}\u{73}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{20}\u{27}\u{25}\u{61}\u{27}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{76}\u{61}\u{69}\u{6c}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
290+else
291+assert(string.find(string.format("\u{25}\u{2b}\u{2e}\u{32}\u{41}",0xc),"\u{5e}\u{25}\u{2b}\u{30}\u{58}\u{25}\u{78}\u{25}\u{2e}\u{25}\u{78}\u{30}\u{50}\u{25}\u{2b}\u{3f}\u{25}\u{64}\u{24}"))
292+assert(string.find(string.format("\u{25}\u{2e}\u{34}\u{41}",(- 0xc)),"\u{5e}\u{25}\u{2d}\u{30}\u{58}\u{25}\u{78}\u{25}\u{2e}\u{25}\u{78}\u{30}\u{30}\u{30}\u{50}\u{25}\u{2b}\u{3f}\u{25}\u{64}\u{24}"))
293+end
294+end
295+assert((string.format("\u{25}\u{23}\u{31}\u{32}\u{6f}",0xa) == "\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{30}\u{31}\u{32}"))
296+assert((string.format("\u{25}\u{23}\u{31}\u{30}\u{78}",0x64) == "\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{30}\u{78}\u{36}\u{34}"))
297+assert((string.format("\u{25}\u{23}\u{2d}\u{31}\u{37}\u{58}",0x64) == "\u{30}\u{58}\u{36}\u{34}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}"))
298+assert((string.format("\u{25}\u{30}\u{31}\u{33}\u{69}",(- 0x64)) == "\u{2d}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}\u{30}\u{30}"))
299+assert((string.format("\u{25}\u{32}\u{2e}\u{35}\u{64}",(- 0x64)) == "\u{2d}\u{30}\u{30}\u{31}\u{30}\u{30}"))
300+assert((string.format("\u{25}\u{2e}\u{75}",0x0) == ""))
301+assert((string.format("\u{25}\u{2b}\u{23}\u{30}\u{31}\u{34}\u{2e}\u{30}\u{66}",0x64) == "\u{2b}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}\u{30}\u{30}\u{2e}"))
302+assert((string.format("\u{25}\u{2d}\u{31}\u{36}\u{63}",0x61) == "\u{61}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}\u{20}"))
303+assert((string.format("\u{25}\u{2b}\u{2e}\u{33}\u{47}",1.5) == "\u{2b}\u{31}\u{2e}\u{35}"))
304+assert((string.format("\u{25}\u{2e}\u{30}\u{73}","\u{61}\u{6c}\u{6f}") == ""))
305+assert((string.format("\u{25}\u{2e}\u{73}","\u{61}\u{6c}\u{6f}") == ""))
306+assert(string.match(string.format("\u{25}\u{20}\u{31}\u{2e}\u{30}\u{45}",0x64),"\u{5e}\u{20}\u{31}\u{45}\u{25}\u{2b}\u{30}\u{2b}\u{32}\u{24}"))
307+assert(string.match(string.format("\u{25}\u{20}\u{2e}\u{31}\u{67}",(0x2 ^ 0xa)),"\u{5e}\u{20}\u{31}\u{65}\u{25}\u{2b}\u{30}\u{2b}\u{33}\u{24}"))
308+local function check
309+(fmt,msg)
310+checkerror(msg,string.format,fmt,0xa)
311+end
312+local aux = string.rep("\u{30}",0x258)
313+check("\u{25}\u{31}\u{30}\u{30}\u{2e}\u{33}\u{64}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
314+check(("\u{25}\u{31}" .. (aux .. "\u{2e}\u{33}\u{64}")),"\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}")
315+check("\u{25}\u{31}\u{2e}\u{31}\u{30}\u{30}\u{64}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
316+check(("\u{25}\u{31}\u{30}\u{2e}\u{31}" .. (aux .. "\u{30}\u{30}\u{34}\u{64}")),"\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}")
317+check("\u{25}\u{74}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
318+check(("\u{25}" .. (aux .. "\u{64}")),"\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{6f}\u{6e}\u{67}")
319+check("\u{25}\u{64}\u{20}\u{25}\u{64}","\u{6e}\u{6f}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}")
320+check("\u{25}\u{30}\u{31}\u{30}\u{63}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
321+check("\u{25}\u{2e}\u{31}\u{30}\u{63}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
322+check("\u{25}\u{30}\u{2e}\u{33}\u{34}\u{73}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
323+check("\u{25}\u{23}\u{69}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
324+check("\u{25}\u{33}\u{2e}\u{31}\u{70}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
325+check("\u{25}\u{30}\u{2e}\u{73}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
326+check("\u{25}\u{31}\u{30}\u{71}","\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{68}\u{61}\u{76}\u{65}\u{20}\u{6d}\u{6f}\u{64}\u{69}\u{66}\u{69}\u{65}\u{72}\u{73}")
327+check("\u{25}\u{46}","\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{63}\u{6f}\u{6e}\u{76}\u{65}\u{72}\u{73}\u{69}\u{6f}\u{6e}")
328+assert((load("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{a}\u{2d}\u{2d}\u{63}\u{6f}\u{6d}\u{6d}\u{65}\u{6e}\u{74}\u{20}\u{77}\u{69}\u{74}\u{68}\u{6f}\u{75}\u{74}\u{20}\u{65}\u{6e}\u{64}\u{69}\u{6e}\u{67}\u{20}\u{45}\u{4f}\u{4c}")() == 0x1))
329+checkerror("\u{74}\u{61}\u{62}\u{6c}\u{65}\u{20}\u{65}\u{78}\u{70}\u{65}\u{63}\u{74}\u{65}\u{64}",table.concat,0x3)
330+checkerror(("\u{61}\u{74}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}" .. maxi),table.concat,{},"\u{20}",maxi,maxi)
331+checkerror(("\u{61}\u{74}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{20}\u{25}" .. mini),table.concat,{},"\u{20}",mini,mini)
332+assert((table.concat({}) == ""))
333+assert((table.concat({},"\u{78}") == ""))
334+assert((table.concat({"\u{0}","\u{0}\u{1}","\u{0}\u{1}\u{2}"},"\u{2e}\u{0}\u{2e}") == "\u{0}\u{2e}\u{0}\u{2e}\u{0}\u{1}\u{2e}\u{0}\u{2e}\u{0}\u{1}\u{2}"))
335+local a = {}
336+;
337+for i = 0x1, 0x12c
338+do
339+a[i]="\u{78}\u{75}\u{78}\u{75}"
340+end
341+assert(((table.concat(a,"\u{31}\u{32}\u{33}") .. "\u{31}\u{32}\u{33}") == string.rep("\u{78}\u{75}\u{78}\u{75}\u{31}\u{32}\u{33}",0x12c)))
342+assert((table.concat(a,"\u{62}",0x14,0x14) == "\u{78}\u{75}\u{78}\u{75}"))
343+assert((table.concat(a,"",0x14,0x15) == "\u{78}\u{75}\u{78}\u{75}\u{78}\u{75}\u{78}\u{75}"))
344+assert((table.concat(a,"\u{78}",0x16,0x15) == ""))
345+assert((table.concat(a,"\u{33}",0x12b) == "\u{78}\u{75}\u{78}\u{75}\u{33}\u{78}\u{75}\u{78}\u{75}"))
346+assert((table.concat({},"\u{78}",maxi,(maxi - 0x1)) == ""))
347+assert((table.concat({},"\u{78}",(mini + 0x1),mini) == ""))
348+assert((table.concat({},"\u{78}",maxi,mini) == ""))
349+assert((table.concat({[maxi] = "\u{61}\u{6c}\u{6f}"},"\u{78}",maxi,maxi) == "\u{61}\u{6c}\u{6f}"))
350+assert((table.concat({[maxi] = "\u{61}\u{6c}\u{6f}",[(maxi - 0x1)] = "\u{79}"},"\u{2d}",(maxi - 0x1),maxi) == "\u{79}\u{2d}\u{61}\u{6c}\u{6f}"))
351+assert((not pcall(table.concat,{"\u{61}","\u{62}",{}})))
352+a={"\u{61}","\u{62}","\u{63}"}
353+assert((table.concat(a,"\u{2c}",0x1,0x0) == ""))
354+assert((table.concat(a,"\u{2c}",0x1,0x1) == "\u{61}"))
355+assert((table.concat(a,"\u{2c}",0x1,0x2) == "\u{61}\u{2c}\u{62}"))
356+assert((table.concat(a,"\u{2c}",0x2) == "\u{62}\u{2c}\u{63}"))
357+assert((table.concat(a,"\u{2c}",0x3) == "\u{63}"))
358+assert((table.concat(a,"\u{2c}",0x4) == ""))
359+if (not _port) then
360+local locales = {"\u{70}\u{74}\u{62}","\u{70}\u{74}\u{5f}\u{42}\u{52}\u{2e}\u{69}\u{73}\u{6f}\u{38}\u{38}\u{35}\u{39}\u{31}","\u{49}\u{53}\u{4f}\u{2d}\u{38}\u{38}\u{35}\u{39}\u{2d}\u{31}"}
361+local function trylocale
362+(w)
363+for i = 0x1, (# locales)
364+do
365+if os.setlocale(locales[i],w) then
366+print(string.format("\u{27}\u{25}\u{73}\u{27}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{65}\u{20}\u{73}\u{65}\u{74}\u{20}\u{74}\u{6f}\u{20}\u{27}\u{25}\u{73}\u{27}",w,locales[i]))
367+return locales[i]
368+end
369+end
370+print(string.format("\u{27}\u{25}\u{73}\u{27}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{65}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{6f}\u{75}\u{6e}\u{64}",w))
371+return false
372+end
373+if trylocale("\u{63}\u{6f}\u{6c}\u{6c}\u{61}\u{74}\u{65}") then
374+assert((("\u{61}\u{6c}\u{6f}" < "\u{e1}\u{6c}\u{6f}") and ("\u{e1}\u{6c}\u{6f}" < "\u{61}\u{6d}\u{6f}")))
375+end
376+if trylocale("\u{63}\u{74}\u{79}\u{70}\u{65}") then
377+assert((string.gsub("\u{e1}\u{e9}\u{ed}\u{f3}\u{fa}","\u{25}\u{61}","\u{78}") == "\u{78}\u{78}\u{78}\u{78}\u{78}"))
378+assert((string.gsub("\u{e1}\u{c1}\u{e9}\u{c9}","\u{25}\u{6c}","\u{78}") == "\u{78}\u{c1}\u{78}\u{c9}"))
379+assert((string.gsub("\u{e1}\u{c1}\u{e9}\u{c9}","\u{25}\u{75}","\u{78}") == "\u{e1}\u{78}\u{e9}\u{78}"))
380+assert((string.upper("\u{e1}\u{c1}\u{e9}\u{7b}\u{78}\u{75}\u{78}\u{75}\u{7d}\u{e7}\u{e3}\u{6f}") == "\u{c1}\u{c1}\u{c9}\u{7b}\u{58}\u{55}\u{58}\u{55}\u{7d}\u{c7}\u{c3}\u{4f}"))
381+end
382+os.setlocale("\u{43}")
383+assert((os.setlocale() == "\u{43}"))
384+assert((os.setlocale(nil,"\u{6e}\u{75}\u{6d}\u{65}\u{72}\u{69}\u{63}") == "\u{43}"))
385+end
386+do
387+local f = string.gmatch("\u{31}\u{20}\u{32}\u{20}\u{33}\u{20}\u{34}\u{20}\u{35}","\u{25}\u{64}\u{2b}")
388+assert((f() == "\u{31}"))
389+local co = coroutine.wrap(f)
390+assert((co() == "\u{32}"))
391+end
392+if (T == nil) then
393+(Message or print)("\u{a}\u{20}\u{3e}\u{3e}\u{3e}\u{20}\u{74}\u{65}\u{73}\u{74}\u{43}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{61}\u{63}\u{74}\u{69}\u{76}\u{65}\u{3a}\u{20}\u{73}\u{6b}\u{69}\u{70}\u{70}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{70}\u{75}\u{73}\u{68}\u{66}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}\u{20}\u{74}\u{65}\u{73}\u{74}\u{73}\u{20}\u{3c}\u{3c}\u{3c}\u{a}")
394+else
395+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{70}\u{75}\u{73}\u{68}\u{66}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{27}")
396+local blen = 0xc8
397+local function callpfs
398+(op,fmt,n)
399+local x = {T.testC(("\u{70}\u{75}\u{73}\u{68}\u{66}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}" .. (op .. "\u{3b}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{2a}")),fmt,n)}
400+assert((# (x == 0x4)))
401+return x[0x4]
402+end
403+local function testpfs
404+(op,fmt,n)
405+assert((callpfs(op,fmt,n) == string.format(fmt,n)))
406+end
407+testpfs("\u{49}","",0x0)
408+testpfs("\u{49}",string.rep("\u{61}",(blen - 0x1)),0x0)
409+testpfs("\u{49}",string.rep("\u{61}",blen),0x0)
410+testpfs("\u{49}",string.rep("\u{61}",(blen + 0x1)),0x0)
411+local str = (string.rep("\u{61}\u{62}",blen) .. ("\u{25}\u{64}" .. string.rep("\u{64}",(blen / 0x2))))
412+testpfs("\u{49}",str,(0x2 ^ 0xe))
413+testpfs("\u{49}",str,(- (0x2 ^ 0xf)))
414+str=("\u{25}\u{64}" .. string.rep("\u{63}\u{64}",blen))
415+testpfs("\u{49}",str,(0x2 ^ 0xe))
416+testpfs("\u{49}",str,(- (0x2 ^ 0xf)))
417+str=(string.rep("\u{63}",(blen - 0x2)) .. "\u{25}\u{64}")
418+testpfs("\u{49}",str,(0x2 ^ 0xe))
419+testpfs("\u{49}",str,(- (0x2 ^ 0xf)))
420+for l = 0xc, 0xe
421+do
422+local str1 = string.rep("\u{61}",l)
423+for i = 0x0, 0x1f4, 0xd
424+do
425+for j = 0x0, 0x1f4, 0xd
426+do
427+str=(string.rep("\u{61}",i) .. ("\u{25}\u{73}" .. string.rep("\u{64}",j)))
428+testpfs("\u{53}",str,str1)
429+testpfs("\u{53}",str,str)
430+end
431+end
432+end
433+str="\u{61}\u{62}\u{63}\u{20}\u{25}\u{63}\u{20}\u{64}\u{65}\u{66}"
434+testpfs("\u{49}",str,string.byte("\u{41}"))
435+testpfs("\u{49}",str,0xff)
436+str=(string.rep("\u{61}",(blen - 0x1)) .. ("\u{25}\u{70}" .. string.rep("\u{63}\u{64}",blen)))
437+testpfs("\u{50}",str,{})
438+str=(string.rep("\u{25}\u{25}",(0x3 * blen)) .. ("\u{25}\u{70}" .. string.rep("\u{25}\u{25}",(0x2 * blen))))
439+testpfs("\u{50}",str,{})
440+end
441+print("\u{4f}\u{4b}")
desk/res/lua/cycled/tpack.luanew file+259
@@ -0,0 +1,259 @@
1+local pack = string.pack
2+local packsize = string.packsize
3+local unpack = string.unpack
4+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{63}\u{6b}\u{2f}\u{75}\u{6e}\u{70}\u{61}\u{63}\u{6b}")
5+local NB = 0x10
6+local sizeshort = packsize("\u{68}")
7+local sizeint = packsize("\u{69}")
8+local sizelong = packsize("\u{6c}")
9+local sizesize_t = packsize("\u{54}")
10+local sizeLI = packsize("\u{6a}")
11+local sizefloat = packsize("\u{66}")
12+local sizedouble = packsize("\u{64}")
13+local sizenumber = packsize("\u{6e}")
14+local little = (pack("\u{69}\u{32}",0x1) == "\u{1}\u{0}")
15+local align = packsize("\u{21}\u{78}\u{58}\u{69}\u{31}\u{36}")
16+assert(((((0x1 <= sizeshort) and (sizeshort <= sizeint)) and (sizeint <= sizelong)) and (sizefloat <= sizedouble)))
17+print("\u{70}\u{6c}\u{61}\u{74}\u{66}\u{6f}\u{72}\u{6d}\u{3a}")
18+print(string.format("\u{9}\u{73}\u{68}\u{6f}\u{72}\u{74}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{69}\u{6e}\u{74}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{6c}\u{6f}\u{6e}\u{67}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{73}\u{69}\u{7a}\u{65}\u{5f}\u{74}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{64}\u{6f}\u{75}\u{62}\u{6c}\u{65}\u{20}\u{25}\u{64}\u{2c}\u{a}\u{9}\u{6c}\u{75}\u{61}\u{20}\u{49}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{25}\u{64}\u{2c}\u{20}\u{6c}\u{75}\u{61}\u{20}\u{4e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{20}\u{25}\u{64}",sizeshort,sizeint,sizelong,sizesize_t,sizefloat,sizedouble,sizeLI,sizenumber))
19+print(("\u{9}" .. (((little and "\u{6c}\u{69}\u{74}\u{74}\u{6c}\u{65}") or "\u{62}\u{69}\u{67}") .. "\u{20}\u{65}\u{6e}\u{64}\u{69}\u{61}\u{6e}")))
20+print(("\u{9}\u{61}\u{6c}\u{69}\u{67}\u{6e}\u{6d}\u{65}\u{6e}\u{74}\u{3a}\u{20}" .. align))
21+local function checkerror
22+(msg,f, ...)
23+local status,err = pcall(f,...)
24+assert((not (status and string.find(err,msg))))
25+end
26+assert((unpack("\u{42}",pack("\u{42}",0xff)) == 0xff))
27+assert((unpack("\u{62}",pack("\u{62}",0x7f)) == 0x7f))
28+assert((unpack("\u{62}",pack("\u{62}",(- 0x80))) == (- 0x80)))
29+assert((unpack("\u{48}",pack("\u{48}",0xffff)) == 0xffff))
30+assert((unpack("\u{68}",pack("\u{68}",0x7fff)) == 0x7fff))
31+assert((unpack("\u{68}",pack("\u{68}",(- 0x8000))) == (- 0x8000)))
32+assert((unpack("\u{4c}",pack("\u{4c}",0xffffffff)) == 0xffffffff))
33+assert((unpack("\u{6c}",pack("\u{6c}",0x7fffffff)) == 0x7fffffff))
34+assert((unpack("\u{6c}",pack("\u{6c}",(- 0x80000000))) == (- 0x80000000)))
35+for i = 0x1, NB
36+do
37+local s = string.rep("\u{ff}",i)
38+assert((pack(("\u{69}" .. i),(- 0x1)) == s))
39+assert((packsize(("\u{69}" .. i)) == (# s)))
40+assert((unpack(("\u{69}" .. i),s) == (- 0x1)))
41+s=("\u{aa}" .. string.rep("\u{0}",(i - 0x1)))
42+assert((pack(("\u{3c}\u{49}" .. i),0xaa) == s))
43+assert((unpack(("\u{3c}\u{49}" .. i),s) == 0xaa))
44+assert((pack(("\u{3e}\u{49}" .. i),0xaa) == s:reverse()))
45+assert((unpack(("\u{3e}\u{49}" .. i),s:reverse()) == 0xaa))
46+end
47+do
48+local lnum = 0x807060504030201
49+local s = pack("\u{3c}\u{6a}",lnum)
50+assert((unpack("\u{3c}\u{6a}",s) == lnum))
51+assert((unpack(("\u{3c}\u{69}" .. (sizeLI + 0x1)),(s .. "\u{0}")) == lnum))
52+assert((unpack(("\u{3c}\u{69}" .. (sizeLI + 0x1)),(s .. "\u{0}")) == lnum))
53+for i = (sizeLI + 0x1), NB
54+do
55+local s = pack("\u{3c}\u{6a}",(- lnum))
56+assert((unpack("\u{3c}\u{6a}",s) == (- lnum)))
57+assert((unpack(("\u{3c}\u{69}" .. i),(s .. ("\u{ff}"):rep((i - sizeLI)))) == (- lnum)))
58+assert((unpack(("\u{3e}\u{69}" .. i),(("\u{ff}"):rep((i - sizeLI)) .. s:reverse())) == (- lnum)))
59+assert((unpack(("\u{3c}\u{49}" .. i),(s .. ("\u{0}"):rep((i - sizeLI)))) == (- lnum)))
60+checkerror("\u{64}\u{6f}\u{65}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{69}\u{74}",unpack,("\u{3c}\u{49}" .. i),(("\u{0}"):rep((i - 0x1)) .. "\u{1}"))
61+checkerror("\u{64}\u{6f}\u{65}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{69}\u{74}",unpack,("\u{3e}\u{69}" .. i),("\u{1}" .. ("\u{0}"):rep((i - 0x1))))
62+end
63+end
64+for i = 0x1, sizeLI
65+do
66+local lstr = "\u{1}\u{2}\u{3}\u{4}\u{5}\u{6}\u{7}\u{8}\u{9}\u{a}\u{b}\u{c}\u{d}"
67+local lnum = 0x807060504030201
68+local n = (lnum & (~ (- (0x1 << (i * 0x8)))))
69+local s = string.sub(lstr,0x1,i)
70+assert((pack(("\u{3c}\u{69}" .. i),n) == s))
71+assert((pack(("\u{3e}\u{69}" .. i),n) == s:reverse()))
72+assert((unpack(("\u{3e}\u{69}" .. i),s:reverse()) == n))
73+end
74+do
75+local u = 0xf0
76+for i = 0x1, (sizeLI - 0x1)
77+do
78+assert((unpack(("\u{3c}\u{69}" .. i),("\u{f0}" .. ("\u{ff}"):rep((i - 0x1)))) == (- 0x10)))
79+assert((unpack(("\u{3e}\u{49}" .. i),("\u{f0}" .. ("\u{ff}"):rep((i - 0x1)))) == u))
80+u=((u * 0x100) + 0xff)
81+end
82+end
83+do
84+assert((pack("\u{3e}\u{69}\u{32}\u{20}\u{3c}\u{69}\u{32}",0xa,0x14) == "\u{0}\u{a}\u{14}\u{0}"))
85+local a,b = unpack("\u{3c}\u{69}\u{32}\u{20}\u{3e}\u{69}\u{32}","\u{a}\u{0}\u{0}\u{14}")
86+assert(((a == 0xa) and (b == 0x14)))
87+assert((pack("\u{3d}\u{69}\u{34}",0x7d1) == pack("\u{69}\u{34}",0x7d1)))
88+end
89+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{73}")
90+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}",pack,"\u{69}\u{30}",0x0)
91+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}",pack,("\u{69}" .. (NB + 0x1)),0x0)
92+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}",pack,("\u{21}" .. (NB + 0x1)),0x0)
93+checkerror("\u{25}\u{28}\u{31}\u{37}\u{25}\u{29}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}\u{20}\u{25}\u{5b}\u{31}\u{2c}\u{31}\u{36}\u{25}\u{5d}",pack,("\u{58}\u{69}" .. (NB + 0x1)))
94+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{27}\u{72}\u{27}",pack,"\u{69}\u{33}\u{72}",0x0)
95+checkerror("\u{31}\u{36}\u{25}\u{2d}\u{62}\u{79}\u{74}\u{65}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}",unpack,"\u{69}\u{31}\u{36}",string.rep("\u{3}",0x10))
96+checkerror("\u{6e}\u{6f}\u{74}\u{20}\u{70}\u{6f}\u{77}\u{65}\u{72}\u{20}\u{6f}\u{66}\u{20}\u{32}",pack,"\u{21}\u{34}\u{69}\u{33}",0x0)
97+;
98+checkerror("\u{6d}\u{69}\u{73}\u{73}\u{69}\u{6e}\u{67}\u{20}\u{73}\u{69}\u{7a}\u{65}",pack,"\u{63}","")
99+checkerror("\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{25}\u{2d}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}",packsize,"\u{73}")
100+checkerror("\u{76}\u{61}\u{72}\u{69}\u{61}\u{62}\u{6c}\u{65}\u{25}\u{2d}\u{6c}\u{65}\u{6e}\u{67}\u{74}\u{68}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}",packsize,"\u{7a}")
101+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{66}\u{6f}\u{72}\u{6d}\u{61}\u{74}",packsize,("\u{63}\u{31}" .. string.rep("\u{30}",0x28)))
102+if (packsize("\u{69}") == 0x4) then
103+local s = string.rep("\u{63}\u{32}\u{36}\u{38}\u{34}\u{33}\u{35}\u{34}\u{35}\u{36}",(0x2 ^ 0x3))
104+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}",packsize,s)
105+s=(string.rep("\u{63}\u{32}\u{36}\u{38}\u{34}\u{33}\u{35}\u{34}\u{35}\u{36}",((0x2 ^ 0x3) - 0x1)) .. "\u{63}\u{32}\u{36}\u{38}\u{34}\u{33}\u{35}\u{34}\u{35}\u{35}")
106+assert((packsize(s) == 0x7fffffff))
107+end
108+for i = 0x1, (sizeLI - 0x1)
109+do
110+local umax = ((0x1 << (i * 0x8)) - 0x1)
111+local max = (umax >> 0x1)
112+local min = (~ max)
113+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3c}\u{49}" .. i),(- 0x1))
114+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3c}\u{49}" .. i),min)
115+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3e}\u{49}" .. i),(umax + 0x1))
116+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3e}\u{69}" .. i),umax)
117+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3e}\u{69}" .. i),(max + 0x1))
118+checkerror("\u{6f}\u{76}\u{65}\u{72}\u{66}\u{6c}\u{6f}\u{77}",pack,("\u{3c}\u{69}" .. i),(min - 0x1))
119+assert((unpack(("\u{3e}\u{69}" .. i),pack(("\u{3e}\u{69}" .. i),max)) == max))
120+assert((unpack(("\u{3c}\u{69}" .. i),pack(("\u{3c}\u{69}" .. i),min)) == min))
121+assert((unpack(("\u{3e}\u{49}" .. i),pack(("\u{3e}\u{49}" .. i),umax)) == umax))
122+end
123+assert((unpack("\u{3e}\u{6a}",pack("\u{3e}\u{6a}",math.maxinteger)) == math.maxinteger))
124+assert((unpack("\u{3c}\u{6a}",pack("\u{3c}\u{6a}",math.mininteger)) == math.mininteger))
125+assert((unpack("\u{3c}\u{4a}",pack("\u{3c}\u{6a}",(- 0x1))) == (- 0x1)))
126+if little then
127+assert((pack("\u{66}",0x18) == pack("\u{3c}\u{66}",0x18)))
128+else
129+assert((pack("\u{66}",0x18) == pack("\u{3e}\u{66}",0x18)))
130+end
131+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{63}\u{6b}\u{2f}\u{75}\u{6e}\u{70}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{66}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{69}\u{6e}\u{67}\u{2d}\u{70}\u{6f}\u{69}\u{6e}\u{74}\u{20}\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{73}")
132+for _,n in ipairs({0x0,(- 1.1),1.9,(0x1 / 0x0),(- (0x1 / 0x0)),1e20,(- 1e20),0.1,2000.7})
133+do
134+assert((unpack("\u{6e}",pack("\u{6e}",n)) == n))
135+assert((unpack("\u{3c}\u{6e}",pack("\u{3c}\u{6e}",n)) == n))
136+assert((unpack("\u{3e}\u{6e}",pack("\u{3e}\u{6e}",n)) == n))
137+assert((pack("\u{3c}\u{66}",n) == pack("\u{3e}\u{66}",n):reverse()))
138+assert((pack("\u{3e}\u{64}",n) == pack("\u{3c}\u{64}",n):reverse()))
139+end
140+for _,n in ipairs({0x0,(- 1.5),(0x1 / 0x0),(- (0x1 / 0x0)),1e10,(- 1e9),0.5,2000.25})
141+do
142+assert((unpack("\u{3c}\u{66}",pack("\u{3c}\u{66}",n)) == n))
143+assert((unpack("\u{3e}\u{66}",pack("\u{3e}\u{66}",n)) == n))
144+assert((unpack("\u{3c}\u{64}",pack("\u{3c}\u{64}",n)) == n))
145+assert((unpack("\u{3e}\u{64}",pack("\u{3e}\u{64}",n)) == n))
146+end
147+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{70}\u{61}\u{63}\u{6b}\u{2f}\u{75}\u{6e}\u{70}\u{61}\u{63}\u{6b}\u{20}\u{6f}\u{66}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}\u{73}")
148+do
149+local s = string.rep("\u{61}\u{62}\u{63}",0x3e8)
150+assert((pack("\u{7a}\u{42}",s,0xf7) == (s .. "\u{0}\u{f7}")))
151+local s1,b = unpack("\u{7a}\u{42}",(s .. "\u{0}\u{f9}"))
152+assert(((b == 0xf9) and (s1 == s)))
153+s1=pack("\u{73}",s)
154+assert((unpack("\u{73}",s1) == s))
155+checkerror("\u{64}\u{6f}\u{65}\u{73}\u{20}\u{6e}\u{6f}\u{74}\u{20}\u{66}\u{69}\u{74}",pack,"\u{73}\u{31}",s)
156+checkerror("\u{63}\u{6f}\u{6e}\u{74}\u{61}\u{69}\u{6e}\u{73}\u{20}\u{7a}\u{65}\u{72}\u{6f}\u{73}",pack,"\u{7a}","\u{61}\u{6c}\u{6f}\u{0}")
157+;
158+checkerror("\u{75}\u{6e}\u{66}\u{69}\u{6e}\u{69}\u{73}\u{68}\u{65}\u{64}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",unpack,"\u{7a}\u{63}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}","\u{61}\u{6c}\u{6f}")
159+for i = 0x2, NB
160+do
161+local s1 = pack(("\u{73}" .. i),s)
162+assert(((unpack(("\u{73}" .. i),s1) == s) and (# (s1 == (# (s + i))))))
163+end
164+end
165+do
166+local x = pack("\u{73}","\u{61}\u{6c}\u{6f}")
167+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{73}\u{68}\u{6f}\u{72}\u{74}",unpack,"\u{73}",x:sub(0x1,(- 0x2)))
168+checkerror("\u{74}\u{6f}\u{6f}\u{20}\u{73}\u{68}\u{6f}\u{72}\u{74}",unpack,"\u{63}\u{35}","\u{61}\u{62}\u{63}\u{64}")
169+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{6c}\u{69}\u{6d}\u{69}\u{74}\u{73}",pack,"\u{73}\u{31}\u{30}\u{30}","\u{61}\u{6c}\u{6f}")
170+end
171+do
172+assert((pack("\u{63}\u{30}","") == ""))
173+assert((packsize("\u{63}\u{30}") == 0x0))
174+assert((unpack("\u{63}\u{30}","") == ""))
175+assert((pack("\u{3c}\u{21}\u{20}\u{63}\u{33}","\u{61}\u{62}\u{63}") == "\u{61}\u{62}\u{63}"))
176+assert((packsize("\u{3c}\u{21}\u{20}\u{63}\u{33}") == 0x3))
177+assert((pack("\u{3e}\u{21}\u{34}\u{20}\u{63}\u{36}","\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}") == "\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}"))
178+assert((pack("\u{63}\u{33}","\u{31}\u{32}\u{33}") == "\u{31}\u{32}\u{33}"))
179+assert((pack("\u{63}\u{30}","") == ""))
180+assert((pack("\u{63}\u{38}","\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}") == "\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{0}\u{0}"))
181+assert((pack("\u{63}\u{38}\u{38}","") == string.rep("\u{0}",0x58)))
182+assert((pack("\u{63}\u{31}\u{38}\u{38}","\u{61}\u{62}") == ("\u{61}\u{62}" .. string.rep("\u{0}",(0xbc - 0x2)))))
183+local a,b,c = unpack("\u{21}\u{34}\u{20}\u{7a}\u{20}\u{63}\u{33}","\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}\u{68}\u{69}\u{0}\u{78}\u{79}\u{7a}")
184+assert((((a == "\u{61}\u{62}\u{63}\u{64}\u{65}\u{66}\u{67}\u{68}\u{69}") and (b == "\u{78}\u{79}\u{7a}")) and (c == 0xe)))
185+checkerror("\u{6c}\u{6f}\u{6e}\u{67}\u{65}\u{72}\u{20}\u{74}\u{68}\u{61}\u{6e}",pack,"\u{63}\u{33}","\u{31}\u{32}\u{33}\u{34}")
186+end
187+do
188+local x = pack("\u{3c}\u{62}\u{20}\u{68}\u{20}\u{62}\u{20}\u{66}\u{20}\u{64}\u{20}\u{66}\u{20}\u{6e}\u{20}\u{69}",0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8)
189+assert((# (x == packsize("\u{3c}\u{62}\u{20}\u{68}\u{20}\u{62}\u{20}\u{66}\u{20}\u{64}\u{20}\u{66}\u{20}\u{6e}\u{20}\u{69}"))))
190+local a,b,c,d,e,f,g,h = unpack("\u{3c}\u{62}\u{20}\u{68}\u{20}\u{62}\u{20}\u{66}\u{20}\u{64}\u{20}\u{66}\u{20}\u{6e}\u{20}\u{69}",x)
191+assert(((((((((a == 0x1) and (b == 0x2)) and (c == 0x3)) and (d == 0x4)) and (e == 0x5)) and (f == 0x6)) and (g == 0x7)) and (h == 0x8)))
192+end
193+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{61}\u{6c}\u{69}\u{67}\u{6e}\u{6d}\u{65}\u{6e}\u{74}")
194+do
195+assert((pack("\u{20}\u{3c}\u{20}\u{69}\u{31}\u{20}\u{69}\u{32}\u{20}",0x2,0x3) == "\u{2}\u{3}\u{0}"))
196+local x = pack("\u{3e}\u{21}\u{38}\u{20}\u{62}\u{20}\u{58}\u{68}\u{20}\u{69}\u{34}\u{20}\u{69}\u{38}\u{20}\u{63}\u{31}\u{20}\u{58}\u{69}\u{38}",(- 0xc),0x64,0xc8,"\u{ec}")
197+assert((# (x == packsize("\u{3e}\u{21}\u{38}\u{20}\u{62}\u{20}\u{58}\u{68}\u{20}\u{69}\u{34}\u{20}\u{69}\u{38}\u{20}\u{63}\u{31}\u{20}\u{58}\u{69}\u{38}"))))
198+assert((x == ("\u{f4}" .. ("\u{0}\u{0}\u{0}" .. ("\u{0}\u{0}\u{0}\u{64}" .. ("\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{c8}" .. ("\u{ec}" .. "\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}")))))))
199+local a,b,c,d,pos = unpack("\u{3e}\u{21}\u{38}\u{20}\u{63}\u{31}\u{20}\u{58}\u{68}\u{20}\u{69}\u{34}\u{20}\u{69}\u{38}\u{20}\u{62}\u{20}\u{58}\u{69}\u{38}\u{20}\u{58}\u{49}\u{20}\u{58}\u{48}",x)
200+assert(((((a == "\u{f4}") and (b == 0x64)) and (c == 0xc8)) and (d == (- (0x14 and ((pos - 0x1) == (# x)))))))
201+x=pack("\u{3e}\u{21}\u{34}\u{20}\u{63}\u{33}\u{20}\u{63}\u{34}\u{20}\u{63}\u{32}\u{20}\u{7a}\u{20}\u{69}\u{34}\u{20}\u{63}\u{35}\u{20}\u{63}\u{32}\u{20}\u{58}\u{69}\u{34}","\u{61}\u{62}\u{63}","\u{61}\u{62}\u{63}\u{64}","\u{78}\u{7a}","\u{68}\u{65}\u{6c}\u{6c}\u{6f}",0x5,"\u{77}\u{6f}\u{72}\u{6c}\u{64}","\u{78}\u{79}")
202+assert((x == "\u{61}\u{62}\u{63}\u{61}\u{62}\u{63}\u{64}\u{78}\u{7a}\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{0}\u{0}\u{0}\u{0}\u{0}\u{5}\u{77}\u{6f}\u{72}\u{6c}\u{64}\u{78}\u{79}\u{0}"))
203+local a,b,c,d,e,f,g,pos = unpack("\u{3e}\u{21}\u{34}\u{20}\u{63}\u{33}\u{20}\u{63}\u{34}\u{20}\u{63}\u{32}\u{20}\u{7a}\u{20}\u{69}\u{34}\u{20}\u{63}\u{35}\u{20}\u{63}\u{32}\u{20}\u{58}\u{68}\u{20}\u{58}\u{69}\u{34}",x)
204+assert(((((((((a == "\u{61}\u{62}\u{63}") and (b == "\u{61}\u{62}\u{63}\u{64}")) and (c == "\u{78}\u{7a}")) and (d == "\u{68}\u{65}\u{6c}\u{6c}\u{6f}")) and (e == 0x5)) and (f == "\u{77}\u{6f}\u{72}\u{6c}\u{64}")) and (g == "\u{78}\u{79}")) and (((pos - 0x1) % 0x4) == 0x0)))
205+x=pack("\u{20}\u{62}\u{20}\u{62}\u{20}\u{58}\u{64}\u{20}\u{62}\u{20}\u{58}\u{62}\u{20}\u{78}",0x1,0x2,0x3)
206+assert((packsize("\u{20}\u{62}\u{20}\u{62}\u{20}\u{58}\u{64}\u{20}\u{62}\u{20}\u{58}\u{62}\u{20}\u{78}") == 0x4))
207+assert((x == "\u{1}\u{2}\u{3}\u{0}"))
208+a,b,c,pos=unpack("\u{62}\u{62}\u{58}\u{64}\u{62}",x)
209+assert(((((a == 0x1) and (b == 0x2)) and (c == 0x3)) and (pos == (# x))))
210+assert((packsize("\u{21}\u{38}\u{20}\u{78}\u{58}\u{69}\u{38}") == 0x8))
211+local pos = unpack("\u{21}\u{38}\u{20}\u{78}\u{58}\u{69}\u{38}","\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}")
212+;
213+assert((pos == 0x9))
214+assert((packsize("\u{21}\u{38}\u{20}\u{78}\u{58}\u{69}\u{32}") == 0x2))
215+local pos = unpack("\u{21}\u{38}\u{20}\u{78}\u{58}\u{69}\u{32}","\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}")
216+;
217+assert((pos == 0x3))
218+assert((packsize("\u{21}\u{32}\u{20}\u{78}\u{58}\u{69}\u{32}") == 0x2))
219+local pos = unpack("\u{21}\u{32}\u{20}\u{78}\u{58}\u{69}\u{32}","\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}")
220+;
221+assert((pos == 0x3))
222+assert((packsize("\u{21}\u{32}\u{20}\u{78}\u{58}\u{69}\u{38}") == 0x2))
223+local pos = unpack("\u{21}\u{32}\u{20}\u{78}\u{58}\u{69}\u{38}","\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}")
224+;
225+assert((pos == 0x3))
226+assert((packsize("\u{21}\u{31}\u{36}\u{20}\u{78}\u{58}\u{69}\u{31}\u{36}") == 0x10))
227+local pos = unpack("\u{21}\u{31}\u{36}\u{20}\u{78}\u{58}\u{69}\u{31}\u{36}","\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}\u{30}\u{31}\u{32}\u{33}\u{34}\u{35}\u{36}\u{37}")
228+;
229+assert((pos == 0x11))
230+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}",pack,"\u{58}")
231+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}",unpack,"\u{58}\u{58}\u{69}","")
232+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}",unpack,"\u{58}\u{20}\u{69}","")
233+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{6e}\u{65}\u{78}\u{74}\u{20}\u{6f}\u{70}\u{74}\u{69}\u{6f}\u{6e}",pack,"\u{58}\u{63}\u{31}")
234+end
235+do
236+local x = pack("\u{69}\u{34}\u{69}\u{34}\u{69}\u{34}\u{69}\u{34}",0x1,0x2,0x3,0x4)
237+for pos = 0x1, 0x10, 0x4
238+do
239+local i,p = unpack("\u{69}\u{34}",x,pos)
240+assert(((i == ((pos // 0x4) + 0x1)) and (p == (pos + 0x4))))
241+end
242+for pos = 0x0, 0xc
243+do
244+local i,p = unpack("\u{21}\u{34}\u{20}\u{69}\u{34}",x,(pos + 0x1))
245+assert(((i == (((pos + 0x3) // 0x4) + 0x1)) and (p == ((i * 0x4) + 0x1))))
246+end
247+local i,p = unpack("\u{21}\u{34}\u{20}\u{69}\u{34}",x,(- 0x4))
248+assert(((i == 0x4) and (p == 0x11)))
249+local i,p = unpack("\u{21}\u{34}\u{20}\u{69}\u{34}",x,(- 0x7))
250+assert(((i == 0x4) and (p == 0x11)))
251+local i,p = unpack("\u{21}\u{34}\u{20}\u{69}\u{34}",x,(- (# x)))
252+assert(((i == 0x1) and (p == 0x5)))
253+for i = 0x1, (# (x + 0x1))
254+do
255+assert((unpack("\u{63}\u{30}",x,i) == ""))
256+end
257+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}",unpack,"\u{63}\u{30}",x,(# (x + 0x2)))
258+end
259+print("\u{4f}\u{4b}")
zod/luau/res/lua/cycled/tracegc.lua → desk/res/lua/cycled/tracegc.luarenamed+2−2
@@ -4,13 +4,13 @@ _ENV=nil
44local active = false
55local mt = {}
66function mt.__gc(o)
7−stderr:write("\46")
7+stderr:write("\u{2e}")
88if active then
99setmetatable(o,mt)
1010end
1111end
1212function M.start()
13−if not active then
13+if (not active) then
1414active=true
1515setmetatable({},mt)
1616end
desk/res/lua/cycled/utf8.luanew file+203
@@ -0,0 +1,203 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{55}\u{54}\u{46}\u{2d}\u{38}\u{20}\u{6c}\u{69}\u{62}\u{72}\u{61}\u{72}\u{79}")
2+local utf8 = require("\u{75}\u{74}\u{66}\u{38}")
3+local function checkerror
4+(msg,f, ...)
5+local s,err = pcall(f,...)
6+assert((not (s and string.find(err,msg))))
7+end
8+local function len
9+(s)
10+return (# string.gsub(s,"\u{5b}\u{80}\u{2d}\u{bf}\u{5d}",""))
11+end
12+local justone = ("\u{5e}" .. (utf8.charpattern .. "\u{24}"))
13+local function checksyntax
14+(s,t)
15+local ts = {"\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{27}"}
16+for i = 0x1, (# t)
17+do
18+ts[(i + 0x1)]=string.format("\u{5c}\u{75}\u{7b}\u{25}\u{78}\u{7d}",t[i])
19+end
20+ts[(# (t + 0x2))]="\u{27}"
21+ts=table.concat(ts)
22+assert((assert(load(ts))() == s))
23+end
24+assert((not utf8.offset("\u{61}\u{6c}\u{6f}",0x5)))
25+assert((not utf8.offset("\u{61}\u{6c}\u{6f}",(- 0x4))))
26+local function check
27+(s,t,nonstrict)
28+local l = utf8.len(s,0x1,(- 0x1),nonstrict)
29+assert((# ((t == l) and (len(s) == l))))
30+assert((utf8.char(table.unpack(t)) == s))
31+assert((utf8.offset(s,0x0) == 0x1))
32+checksyntax(s,t)
33+local t1 = {utf8.codepoint(s,0x1,(- 0x1),nonstrict)}
34+assert((# (t == (# t1))))
35+for i = 0x1, (# t)
36+do
37+assert((t[i] == t1[i]))
38+end
39+for i = 0x1, l
40+do
41+local pi = utf8.offset(s,i)
42+local pi1 = utf8.offset(s,0x2,pi)
43+assert(string.find(string.sub(s,pi,(pi1 - 0x1)),justone))
44+assert((utf8.offset(s,(- 0x1),pi1) == pi))
45+assert((utf8.offset(s,((i - l) - 0x1)) == pi))
46+assert(((pi1 - pi) == (# utf8.char(utf8.codepoint(s,pi,pi,nonstrict)))))
47+for j = pi, (pi1 - 0x1)
48+do
49+assert((utf8.offset(s,0x0,j) == pi))
50+end
51+for j = (pi + 0x1), (pi1 - 0x1)
52+do
53+assert((not utf8.len(s,j)))
54+end
55+assert((utf8.len(s,pi,pi,nonstrict) == 0x1))
56+assert((utf8.len(s,pi,(pi1 - 0x1),nonstrict) == 0x1))
57+assert((utf8.len(s,pi,(- 0x1),nonstrict) == ((l - i) + 0x1)))
58+assert((utf8.len(s,pi1,(- 0x1),nonstrict) == (l - i)))
59+assert((utf8.len(s,0x1,pi,nonstrict) == i))
60+end
61+local i = 0x0
62+for p,c in utf8.codes(s,nonstrict)
63+do
64+i=(i + 0x1)
65+assert(((c == t[i]) and (p == utf8.offset(s,i))))
66+assert((utf8.codepoint(s,p,p,nonstrict) == c))
67+end
68+assert((i == (# t)))
69+i=0x0
70+for c in string.gmatch(s,utf8.charpattern)
71+do
72+i=(i + 0x1)
73+assert((c == utf8.char(t[i])))
74+end
75+assert((i == (# t)))
76+for i = 0x1, l
77+do
78+assert((utf8.offset(s,i) == utf8.offset(s,((i - l) - 0x1),(# (s + 0x1)))))
79+end
80+end
81+do
82+local function check
83+(s,p)
84+local a,b = utf8.len(s)
85+assert((not (a and (b == p))))
86+end
87+check("\u{61}\u{62}\u{63}\u{e3}\u{64}\u{65}\u{66}",0x4)
88+check("\u{f4}\u{9f}\u{bf}",0x1)
89+check("\u{f4}\u{9f}\u{bf}\u{bf}",0x1)
90+check("\u{e6}\u{b1}\u{89}\u{e5}\u{ad}\u{97}\u{80}",(# ("\u{e6}\u{b1}\u{89}\u{e5}\u{ad}\u{97}" + 0x1)))
91+check("\u{80}\u{68}\u{65}\u{6c}\u{6c}\u{6f}",0x1)
92+check("\u{68}\u{65}\u{6c}\u{80}\u{6c}\u{6f}",0x4)
93+check("\u{e6}\u{b1}\u{89}\u{e5}\u{ad}\u{97}\u{bf}",(# ("\u{e6}\u{b1}\u{89}\u{e5}\u{ad}\u{97}" + 0x1)))
94+check("\u{bf}\u{68}\u{65}\u{6c}\u{6c}\u{6f}",0x1)
95+check("\u{68}\u{65}\u{6c}\u{bf}\u{6c}\u{6f}",0x4)
96+end
97+do
98+local function errorcodes
99+(s)
100+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{55}\u{54}\u{46}\u{25}\u{2d}\u{38}\u{20}\u{63}\u{6f}\u{64}\u{65}",function ()
101+for c in utf8.codes(s)
102+do
103+assert(c)
104+end
105+end)
106+end
107+errorcodes("\u{61}\u{62}\u{ff}")
108+errorcodes("\u{110000}")
109+errorcodes("\u{69}\u{6e}\u{80}\u{76}\u{61}\u{6c}\u{69}\u{64}")
110+errorcodes("\u{bf}\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}")
111+errorcodes("\u{ce}\u{b1}\u{ce}\u{bb}\u{cf}\u{86}\u{bf}\u{ce}\u{b1}")
112+local f = utf8.codes("")
113+assert((f("",0x2) == nil))
114+assert((f("",(- 0x1)) == nil))
115+assert((f("",math.mininteger) == nil))
116+end
117+checkerror("\u{70}\u{6f}\u{73}\u{69}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.offset,"\u{61}\u{62}\u{63}",0x1,0x5)
118+checkerror("\u{70}\u{6f}\u{73}\u{69}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.offset,"\u{61}\u{62}\u{63}",0x1,(- 0x4))
119+checkerror("\u{70}\u{6f}\u{73}\u{69}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.offset,"",0x1,0x2)
120+checkerror("\u{70}\u{6f}\u{73}\u{69}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.offset,"",0x1,(- 0x1))
121+checkerror("\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{62}\u{79}\u{74}\u{65}",utf8.offset,"\u{f0}\u{a6}\u{a7}\u{ba}",0x1,0x2)
122+checkerror("\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{62}\u{79}\u{74}\u{65}",utf8.offset,"\u{f0}\u{a6}\u{a7}\u{ba}",0x1,0x2)
123+checkerror("\u{63}\u{6f}\u{6e}\u{74}\u{69}\u{6e}\u{75}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{62}\u{79}\u{74}\u{65}",utf8.offset,"\u{80}",0x1)
124+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.len,"\u{61}\u{62}\u{63}",0x0,0x2)
125+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.len,"\u{61}\u{62}\u{63}",0x1,0x4)
126+local s = "\u{68}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{57}\u{6f}\u{72}\u{6c}\u{64}"
127+local t = {string.byte(s,0x1,(- 0x1))}
128+for i = 0x1, utf8.len(s)
129+do
130+assert((t[i] == string.byte(s,i)))
131+end
132+check(s,t)
133+check("\u{e6}\u{b1}\u{89}\u{e5}\u{ad}\u{97}\u{2f}\u{e6}\u{bc}\u{a2}\u{e5}\u{ad}\u{97}",{0x6c49,0x5b57,0x2f,0x6f22,0x5b57})
134+do
135+local s = "\u{c3}\u{a1}\u{c3}\u{a9}\u{c3}\u{ad}\u{80}"
136+local t = {utf8.codepoint(s,0x1,(# (s - 0x1)))}
137+assert((# ((((t == 0x3) and (t[0x1] == 0xe1)) and (t[0x2] == 0xe9)) and (t[0x3] == 0xed))))
138+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{55}\u{54}\u{46}\u{25}\u{2d}\u{38}\u{20}\u{63}\u{6f}\u{64}\u{65}",utf8.codepoint,s,0x1,(# s))
139+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.codepoint,s,(# (s + 0x1)))
140+t={utf8.codepoint(s,0x4,0x3)}
141+assert((# (t == 0x0)))
142+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.codepoint,s,(- (# (s + 0x1))),0x1)
143+checkerror("\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{62}\u{6f}\u{75}\u{6e}\u{64}\u{73}",utf8.codepoint,s,0x1,(# (s + 0x1)))
144+assert((utf8.codepoint("\u{d7ff}") == (0xd800 - 0x1)))
145+assert((utf8.codepoint("\u{e000}") == (0xdfff + 0x1)))
146+assert((utf8.codepoint("\u{d800}",0x1,0x1,true) == 0xd800))
147+assert((utf8.codepoint("\u{dfff}",0x1,0x1,true) == 0xdfff))
148+assert((utf8.codepoint("\u{7fffffff}",0x1,0x1,true) == 0x7fffffff))
149+end
150+assert((utf8.char() == ""))
151+assert((utf8.char(0x0,0x61,0x62,0x63,0x1) == "\u{0}\u{61}\u{62}\u{63}\u{1}"))
152+assert((utf8.codepoint(utf8.char(0x10ffff)) == 0x10ffff))
153+assert((utf8.codepoint(utf8.char(0x7fffffff),0x1,0x1,true) == ((0x1 << 0x1f) - 0x1)))
154+checkerror("\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",utf8.char,(0x7fffffff + 0x1))
155+checkerror("\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{6f}\u{75}\u{74}\u{20}\u{6f}\u{66}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}",utf8.char,(- 0x1))
156+local function invalid
157+(s)
158+checkerror("\u{69}\u{6e}\u{76}\u{61}\u{6c}\u{69}\u{64}\u{20}\u{55}\u{54}\u{46}\u{25}\u{2d}\u{38}\u{20}\u{63}\u{6f}\u{64}\u{65}",utf8.codepoint,s)
159+assert((not utf8.len(s)))
160+end
161+invalid("\u{f4}\u{9f}\u{bf}\u{bf}")
162+invalid("\u{d800}")
163+invalid("\u{dfff}")
164+invalid("\u{c0}\u{80}")
165+invalid("\u{c1}\u{bf}")
166+invalid("\u{e0}\u{9f}\u{bf}")
167+invalid("\u{f0}\u{8f}\u{bf}\u{bf}")
168+invalid("\u{80}")
169+invalid("\u{bf}")
170+invalid("\u{fe}")
171+invalid("\u{ff}")
172+check("",{})
173+s="\u{0}\u{20}\u{7f}\u{c2}\u{80}\u{20}\u{df}\u{bf}\u{e0}\u{a0}\u{80}\u{20}\u{ef}\u{bf}\u{bf}\u{f0}\u{90}\u{80}\u{80}\u{20}\u{20}\u{f4}\u{8f}\u{bf}\u{bf}"
174+s=string.gsub(s,"\u{20}","")
175+check(s,{0x0,0x7f,0x80,0x7ff,0x800,0xffff,0x10000,0x10ffff})
176+do
177+local s = "\u{4000000}\u{7fffffff}"
178+assert((# (s == 0xc)))
179+check(s,{0x4000000,0x7fffffff},true)
180+s="\u{200000}\u{3ffffff}"
181+assert((# (s == 0xa)))
182+check(s,{0x200000,0x3ffffff},true)
183+s="\u{10000}\u{1fffff}"
184+assert((# (s == 0x8)))
185+check(s,{0x10000,0x1fffff},true)
186+end
187+local x = "\u{e6}\u{97}\u{a5}\u{e6}\u{9c}\u{ac}\u{e8}\u{aa}\u{9e}\u{61}\u{2d}\u{34}\u{0}\u{c3}\u{a9}\u{c3}\u{b3}"
188+check(x,{0x65e5,0x672c,0x8a9e,0x61,0x2d,0x34,0x0,0xe9,0xf3})
189+check("\u{f0}\u{a3}\u{b2}\u{b7}\u{f0}\u{a0}\u{9c}\u{8e}\u{f0}\u{a0}\u{b1}\u{93}\u{f0}\u{a1}\u{81}\u{bb}\u{f0}\u{a0}\u{b5}\u{bc}\u{61}\u{62}\u{f0}\u{a0}\u{ba}\u{a2}",{0x23cb7,0x2070e,0x20c53,0x2107b,0x20d7c,0x61,0x62,0x20ea2})
190+check("\u{f0}\u{a8}\u{b3}\u{8a}\u{f0}\u{a9}\u{b6}\u{98}\u{f0}\u{a6}\u{a7}\u{ba}\u{f0}\u{a8}\u{b3}\u{92}\u{f0}\u{a5}\u{84}\u{ab}\u{f0}\u{a4}\u{93}\u{93}\u{f4}\u{8f}\u{bf}\u{bf}",{0x28cca,0x29d98,0x269fa,0x28cd2,0x2512b,0x244d3,0x10ffff})
191+local i = 0x0
192+for p,c in string.gmatch(x,("\u{28}\u{29}\u{28}" .. (utf8.charpattern .. "\u{29}")))
193+do
194+i=(i + 0x1)
195+assert((utf8.offset(x,i) == p))
196+assert((utf8.len(x,p) == ((utf8.len(x) - i) + 0x1)))
197+assert((utf8.len(c) == 0x1))
198+for j = 0x1, (# (c - 0x1))
199+do
200+assert((utf8.offset(x,0x0,((p + j) - 0x1)) == p))
201+end
202+end
203+print("\u{6f}\u{6b}")
desk/res/lua/cycled/vararg.luanew file+137
@@ -0,0 +1,137 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{76}\u{61}\u{72}\u{61}\u{72}\u{67}")
2+local function f
3+(a, ...)
4+local x = {["\u{6e}"] = select("\u{23}",...),...}
5+for i = 0x1, x.n
6+do
7+assert((a[i] == x[i]))
8+end
9+return x.n
10+end
11+local function c12
12+(...)
13+assert((arg == _G.arg))
14+local x = {...}
15+;
16+x.n=(# x)
17+local res = (((x.n == 0x2) and (x[0x1] == 0x1)) and (x[0x2] == 0x2))
18+if res then
19+res=0x37
20+end
21+return res,0x2
22+end
23+local function vararg
24+(...)
25+return {["\u{6e}"] = select("\u{23}",...),...}
26+end
27+local call = function (f,args)
28+return f(table.unpack(args,0x1,args.n))
29+end
30+assert((f() == 0x0))
31+assert((f({0x1,0x2,0x3},0x1,0x2,0x3) == 0x3))
32+assert((f({"\u{61}\u{6c}\u{6f}",nil,0x2d,f,nil},"\u{61}\u{6c}\u{6f}",nil,0x2d,f,nil) == 0x5))
33+assert((vararg().n == 0x0))
34+assert((vararg(nil,nil).n == 0x2))
35+assert((c12(0x1,0x2) == 0x37))
36+local a,b = assert(call(c12,{0x1,0x2}))
37+assert(((a == 0x37) and (b == 0x2)))
38+a=call(c12,{0x1,0x2,["\u{6e}"] = 0x2})
39+assert(((a == 0x37) and (b == 0x2)))
40+a=call(c12,{0x1,0x2,["\u{6e}"] = 0x1})
41+assert((not a))
42+assert((c12(0x1,0x2,0x3) == false))
43+local a = vararg(call(next,{_G,nil,["\u{6e}"] = 0x2}))
44+local b,c = next(_G)
45+assert((((a[0x1] == b) and (a[0x2] == c)) and (a.n == 0x2)))
46+a=vararg(call(call,{c12,{0x1,0x2}}))
47+assert((((a.n == 0x2) and (a[0x1] == 0x37)) and (a[0x2] == 0x2)))
48+a=call(print,{"\u{2b}"})
49+assert((a == nil))
50+local t = {0x1,0xa}
51+function t:f(...)
52+local arg = {...}
53+;
54+return (self[...] + (# arg))
55+end
56+assert(((t:f(0x1,0x4) == 0x3) and (t:f(0x2) == 0xb)))
57+print("\u{2b}")
58+local lim = 0x14
59+local i,a = 0x1,{}
60+while (i <= lim) do
61+a[i]=(i + 0.3)
62+;
63+i=(i + 0x1)
64+end
65+function f(a,b,c,d, ...)
66+local more = {...}
67+assert(((((a == 1.3) and (more[0x1] == 5.3)) and (more[(lim - 0x4)] == (lim + 0.3))) and (not more[(lim - 0x3)])))
68+end
69+local function g
70+(a,b,c)
71+assert((((a == 1.3) and (b == 2.3)) and (c == 3.3)))
72+end
73+call(f,a)
74+call(g,a)
75+a={}
76+i=0x1
77+while (i <= lim) do
78+a[i]=i
79+;
80+i=(i + 0x1)
81+end
82+assert((call(math.max,a) == lim))
83+print("\u{2b}")
84+local function oneless
85+(a, ...)
86+return ...
87+end
88+function f(n,a, ...)
89+local b
90+assert((arg == _G.arg))
91+if (n == 0x0) then
92+local b,c,d = ...
93+return a,b,c,d,oneless(oneless(oneless(...)))
94+else
95+n,b,a=(n - 0x1),...,a
96+assert((b == ...))
97+return f(n,a,...)
98+end
99+end
100+a,b,c,d,e=assert(f(0xa,0x5,0x4,0x3,0x2,0x1))
101+assert((((((a == 0x5) and (b == 0x4)) and (c == 0x3)) and (d == 0x2)) and (e == 0x1)))
102+a,b,c,d,e=f(0x4)
103+assert((((((a == nil) and (b == nil)) and (c == nil)) and (d == nil)) and (e == nil)))
104+local f = load("\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{7b}\u{2e}\u{2e}\u{2e}\u{7d}\u{20}")
105+local x = f(0x2,0x3)
106+assert((((x[0x1] == 0x2) and (x[0x2] == 0x3)) and (x[0x3] == undef)))
107+f=load("\u{20}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{78}\u{20}\u{3d}\u{20}\u{7b}\u{2e}\u{2e}\u{2e}\u{7d}\u{a}\u{20}\u{20}\u{66}\u{6f}\u{72}\u{20}\u{69}\u{3d}\u{31}\u{2c}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{28}\u{27}\u{23}\u{27}\u{2c}\u{20}\u{2e}\u{2e}\u{2e}\u{29}\u{20}\u{64}\u{6f}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{78}\u{5b}\u{69}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{28}\u{69}\u{2c}\u{20}\u{2e}\u{2e}\u{2e}\u{29}\u{29}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{20}\u{20}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{78}\u{5b}\u{73}\u{65}\u{6c}\u{65}\u{63}\u{74}\u{28}\u{27}\u{23}\u{27}\u{2c}\u{20}\u{2e}\u{2e}\u{2e}\u{29}\u{2b}\u{31}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{75}\u{6e}\u{64}\u{65}\u{66}\u{29}\u{a}\u{20}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{74}\u{72}\u{75}\u{65}\u{a}")
108+assert(f("\u{61}","\u{62}",nil,{},assert))
109+assert(f())
110+a={select(0x3,table.unpack({0xa,0x14,0x1e,0x28}))}
111+assert((# (((a == 0x2) and (a[0x1] == 0x1e)) and (a[0x2] == 0x28))))
112+a={select(0x1)}
113+assert((next(a) == nil))
114+a={select((- 0x1),0x3,0x5,0x7)}
115+assert(((a[0x1] == 0x7) and (a[0x2] == undef)))
116+a={select((- 0x2),0x3,0x5,0x7)}
117+assert((((a[0x1] == 0x5) and (a[0x2] == 0x7)) and (a[0x3] == undef)))
118+pcall(select,0x2710)
119+pcall(select,(- 0x2710))
120+function f(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40,p41,p42,p43,p44,p45,p46,p48,p49,p50, ...)
121+local a1,a2,a3,a4,a5,a6,a7
122+local a8,a9,a10,a11,a12,a13,a14
123+end
124+f()
125+do
126+local function f
127+(a,b,c)
128+return c,b
129+end
130+local function g
131+()
132+return f(0x1,0x2)
133+end
134+local a,b = g()
135+assert(((a == nil) and (b == 0x2)))
136+end
137+print("\u{4f}\u{4b}")
desk/res/lua/cycled/verybig.luanew file+59
@@ -0,0 +1,59 @@
1+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{52}\u{4b}")
2+local function foo
3+()
4+local dummy = {0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff,0x100}
5+assert(((24.5 + 0.6) == 25.1))
6+local t = {["\u{66}\u{6f}\u{6f}"] = function (self,x)
7+return (x + self.x)
8+end,["\u{78}"] = 0xa}
9+t.t=t
10+assert((t:foo(1.5) == 11.5))
11+assert((t.t:foo(0.5) == 10.5))
12+assert((24.3 == 24.3))
13+assert(((function ()
14+return t.x
15+end)() == 0xa))
16+end
17+foo()
18+foo=nil
19+if _soft then
20+return 0xa
21+end
22+print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6c}\u{61}\u{72}\u{67}\u{65}\u{20}\u{70}\u{72}\u{6f}\u{67}\u{72}\u{61}\u{6d}\u{73}\u{20}\u{28}\u{3e}\u{36}\u{34}\u{6b}\u{29}")
23+local prog = "\u{24}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{61}\u{2c}\u{62}\u{a}\u{a}\u{62}\u{20}\u{3d}\u{20}\u{7b}\u{24}\u{31}\u{24}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{30}\u{39}\u{20}\u{3d}\u{20}\u{36}\u{35}\u{35}\u{33}\u{34}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{30}\u{20}\u{3d}\u{20}\u{36}\u{35}\u{35}\u{33}\u{35}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{31}\u{20}\u{3d}\u{20}\u{36}\u{35}\u{35}\u{33}\u{36}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{32}\u{20}\u{3d}\u{20}\u{36}\u{35}\u{35}\u{33}\u{37}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{33}\u{20}\u{3d}\u{20}\u{31}\u{36}\u{37}\u{37}\u{37}\u{32}\u{31}\u{34}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{34}\u{20}\u{3d}\u{20}\u{31}\u{36}\u{37}\u{37}\u{37}\u{32}\u{31}\u{35}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{35}\u{20}\u{3d}\u{20}\u{31}\u{36}\u{37}\u{37}\u{37}\u{32}\u{31}\u{36}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{36}\u{20}\u{3d}\u{20}\u{31}\u{36}\u{37}\u{37}\u{37}\u{32}\u{31}\u{37}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{37}\u{20}\u{3d}\u{20}\u{30}\u{78}\u{37}\u{66}\u{66}\u{66}\u{66}\u{66}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{38}\u{20}\u{3d}\u{20}\u{2d}\u{30}\u{78}\u{37}\u{66}\u{66}\u{66}\u{66}\u{66}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{31}\u{39}\u{20}\u{3d}\u{20}\u{30}\u{78}\u{31}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{30}\u{20}\u{3d}\u{20}\u{2d}\u{30}\u{78}\u{31}\u{66}\u{66}\u{66}\u{66}\u{64}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{31}\u{20}\u{3d}\u{20}\u{2d}\u{36}\u{35}\u{35}\u{33}\u{34}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{32}\u{20}\u{3d}\u{20}\u{2d}\u{36}\u{35}\u{35}\u{33}\u{35}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{33}\u{20}\u{3d}\u{20}\u{2d}\u{36}\u{35}\u{35}\u{33}\u{36}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{34}\u{20}\u{3d}\u{20}\u{2d}\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{2c}\u{a}\u{20}\u{20}\u{62}\u{33}\u{30}\u{30}\u{32}\u{35}\u{20}\u{3d}\u{20}\u{31}\u{35}\u{30}\u{31}\u{32}\u{2e}\u{35}\u{2c}\u{a}\u{20}\u{20}\u{24}\u{32}\u{24}\u{a}\u{7d}\u{3b}\u{a}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{62}\u{2e}\u{61}\u{35}\u{30}\u{30}\u{30}\u{38}\u{20}\u{3d}\u{3d}\u{20}\u{32}\u{35}\u{30}\u{30}\u{34}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{5b}\u{22}\u{61}\u{31}\u{31}\u{22}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{35}\u{2e}\u{35}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{62}\u{2e}\u{61}\u{33}\u{33}\u{30}\u{30}\u{37}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{31}\u{36}\u{35}\u{30}\u{33}\u{2e}\u{35}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{2e}\u{61}\u{35}\u{30}\u{30}\u{30}\u{39}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{32}\u{35}\u{30}\u{30}\u{34}\u{2e}\u{35}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{62}\u{5b}\u{22}\u{62}\u{22}\u{2e}\u{2e}\u{33}\u{30}\u{30}\u{32}\u{34}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{2d}\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{29}\u{a}\u{a}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{62}\u{3a}\u{78}\u{78}\u{78}\u{20}\u{28}\u{61}\u{2c}\u{62}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{61}\u{2b}\u{62}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{62}\u{3a}\u{78}\u{78}\u{78}\u{28}\u{31}\u{30}\u{2c}\u{20}\u{31}\u{32}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{32}\u{32}\u{29}\u{20}\u{20}\u{20}\u{2d}\u{2d}\u{20}\u{70}\u{75}\u{73}\u{68}\u{73}\u{65}\u{6c}\u{66}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{6e}\u{6f}\u{6e}\u{2d}\u{63}\u{6f}\u{6e}\u{73}\u{74}\u{61}\u{6e}\u{74}\u{20}\u{69}\u{6e}\u{64}\u{65}\u{78}\u{a}\u{62}\u{5b}\u{22}\u{78}\u{78}\u{78}\u{22}\u{5d}\u{20}\u{3d}\u{20}\u{75}\u{6e}\u{64}\u{65}\u{66}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{73}\u{20}\u{3d}\u{20}\u{30}\u{3b}\u{20}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{6e}\u{3d}\u{30}\u{a}\u{66}\u{6f}\u{72}\u{20}\u{61}\u{2c}\u{62}\u{20}\u{69}\u{6e}\u{20}\u{70}\u{61}\u{69}\u{72}\u{73}\u{28}\u{62}\u{29}\u{20}\u{64}\u{6f}\u{20}\u{73}\u{3d}\u{73}\u{2b}\u{62}\u{3b}\u{20}\u{6e}\u{3d}\u{6e}\u{2b}\u{31}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{2d}\u{2d}\u{20}\u{77}\u{69}\u{74}\u{68}\u{20}\u{33}\u{32}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{2c}\u{20}\u{65}\u{78}\u{61}\u{63}\u{74}\u{20}\u{76}\u{61}\u{6c}\u{75}\u{65}\u{20}\u{6f}\u{66}\u{20}\u{27}\u{73}\u{27}\u{20}\u{64}\u{65}\u{70}\u{65}\u{6e}\u{64}\u{73}\u{20}\u{6f}\u{6e}\u{20}\u{73}\u{75}\u{6d}\u{6d}\u{61}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{38}\u{31}\u{38}\u{30}\u{30}\u{30}\u{30}\u{30}\u{2e}\u{30}\u{20}\u{3c}\u{20}\u{73}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{73}\u{20}\u{3c}\u{20}\u{38}\u{31}\u{38}\u{36}\u{30}\u{30}\u{30}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{6e}\u{20}\u{3d}\u{3d}\u{20}\u{37}\u{30}\u{30}\u{30}\u{31}\u{29}\u{a}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{3b}\u{20}\u{62}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{70}\u{72}\u{69}\u{6e}\u{74}\u{27}\u{2b}\u{27}\u{a}\u{a}\u{6c}\u{6f}\u{63}\u{61}\u{6c}\u{20}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{66}\u{28}\u{78}\u{29}\u{20}\u{62}\u{3d}\u{78}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{66}\u{7b}\u{24}\u{33}\u{24}\u{7d}\u{20}\u{6f}\u{72}\u{20}\u{31}\u{30}\u{a}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{61}\u{3d}\u{3d}\u{31}\u{30}\u{29}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{62}\u{5b}\u{31}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{61}\u{31}\u{30}\u{22}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{5b}\u{32}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{35}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{62}\u{5b}\u{23}\u{62}\u{2d}\u{31}\u{5d}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{61}\u{35}\u{30}\u{30}\u{30}\u{39}\u{22}\u{29}\u{a}\u{a}\u{a}\u{66}\u{75}\u{6e}\u{63}\u{74}\u{69}\u{6f}\u{6e}\u{20}\u{78}\u{78}\u{78}\u{78}\u{20}\u{28}\u{78}\u{29}\u{20}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{62}\u{5b}\u{78}\u{5d}\u{20}\u{65}\u{6e}\u{64}\u{a}\u{a}\u{61}\u{73}\u{73}\u{65}\u{72}\u{74}\u{28}\u{78}\u{78}\u{78}\u{78}\u{28}\u{33}\u{29}\u{20}\u{3d}\u{3d}\u{20}\u{22}\u{61}\u{31}\u{31}\u{22}\u{29}\u{a}\u{a}\u{61}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{3b}\u{20}\u{62}\u{3d}\u{6e}\u{69}\u{6c}\u{a}\u{78}\u{78}\u{78}\u{78}\u{20}\u{3d}\u{20}\u{6e}\u{69}\u{6c}\u{a}\u{a}\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}\u{31}\u{30}\u{a}\u{a}"
24+local function sig
25+(x)
26+return ((((x % 0x2) == 0x0) and "") or "\u{2d}")
27+end
28+local F = {function ()
29+for i = 0xa, 0xc359
30+do
31+io.write("\u{61}",i,"\u{20}\u{3d}\u{20}",sig(i),(0x5 + ((i - 0xa) / 0x2)),"\u{2c}\u{a}")
32+end
33+end,function ()
34+for i = 0x754a, 0xc359
35+do
36+io.write("\u{62}",i,"\u{20}\u{3d}\u{20}",sig(i),(0x3aa5 + ((i - 0x754a) / 0x2)),"\u{2c}\u{a}")
37+end
38+end,function ()
39+for i = 0xa, 0xc359
40+do
41+io.write("\u{22}\u{61}",i,"\u{22}\u{2c}\u{20}",sig(i),(0x5 + ((i - 0xa) / 0x2)),"\u{2c}\u{a}")
42+end
43+end}
44+local file = os.tmpname()
45+io.output(file)
46+for s in string.gmatch(prog,"\u{24}\u{28}\u{5b}\u{5e}\u{24}\u{5d}\u{2b}\u{29}")
47+do
48+local n = tonumber(s)
49+if (not n) then
50+io.write(s)
51+else
52+F[n]()
53+end
54+end
55+io.close()
56+local result = dofile(file)
57+assert(os.remove(file))
58+print("\u{4f}\u{4b}")
59+return result
zod/luau/res/lua/db.lua → desk/res/lua/db.luarenamed

The content is the same.

zod/luau/res/lua/errors.lua → desk/res/lua/errors.luarenamed

The content is the same.

zod/luau/res/lua/events.lua → desk/res/lua/events.luarenamed

The content is the same.

zod/luau/res/lua/files.lua → desk/res/lua/files.luarenamed

The content is the same.

zod/luau/res/lua/foo.lua → desk/res/lua/foo.luarenamed+2−5
@@ -22,9 +22,6 @@ test_cases = {
2222 { 0x7fffffffffffffff, "9.2233720368548e+18" },
2323 { 9223372036854775807, "9.2233720368548e+18" },
2424
25− { 0xffffffffffffffff, "1.844674407371e+19" },
26− { 18446744073709551615, "1.844674407371e+19" },
27−
2825 { 0x100000000, "4294967296" },
2926 { 4294967296, "4294967296" },
3027
@@ -50,9 +47,9 @@ do
5047 return 8, foo;
5148end
5249
53−print('the way of the future')
50+-- print('the way of the future')
5451
55−print 'hello'
52+-- print 'hello'
5653
5754h{key1 = 'Sonmi~451'}
5855
zod/luau/res/lua/gc.lua → desk/res/lua/gc.luarenamed

The content is the same.

zod/luau/res/lua/gengc.lua → desk/res/lua/gengc.luarenamed

The content is the same.

zod/luau/res/lua/goto.lua → desk/res/lua/goto.luarenamed

The content is the same.

zod/luau/res/lua/heavy.lua → desk/res/lua/heavy.luarenamed

The content is the same.

zod/luau/res/lua/literals.lua → desk/res/lua/literals.luarenamed

The content is the same.

zod/luau/res/lua/locals.lua → desk/res/lua/locals.luarenamed

The content is the same.

zod/luau/res/lua/main.lua → desk/res/lua/main.luarenamed

The content is the same.

zod/luau/res/lua/math.lua → desk/res/lua/math.luarenamed

The content is the same.

zod/luau/res/lua/nextvar.lua → desk/res/lua/nextvar.luarenamed

The content is the same.

zod/luau/res/lua/pm.lua → desk/res/lua/pm.luarenamed

The content is the same.

zod/luau/res/lua/sort.lua → desk/res/lua/sort.luarenamed

The content is the same.

zod/luau/res/lua/strings.lua → desk/res/lua/strings.luarenamed

The content is the same.

zod/luau/res/lua/tpack.lua → desk/res/lua/tpack.luarenamed

The content is the same.

zod/luau/res/lua/tracegc.lua → desk/res/lua/tracegc.luarenamed

The content is the same.

zod/luau/res/lua/utf8.lua → desk/res/lua/utf8.luarenamed

The content is the same.

zod/luau/res/lua/vararg.lua → desk/res/lua/vararg.luarenamed

The content is the same.

zod/luau/res/lua/verybig.lua → desk/res/lua/verybig.luarenamed

The content is the same.

desk/sur/interlist.hoonnew file+8
@@ -0,0 +1,8 @@
1+|%
2+++ interlist
3+ |$ [sep val]
4+ $%
5+ [%double =val =sep tail=(interlist sep val)]
6+ [%single =val]
7+ ==
8+--
zod/luau/sur/lua.hoon → desk/sur/lua.hoonrenamed+5−5
@@ -1,7 +1,7 @@
11|%
22+$ name @t
33+$ namelist (lest name)
4−+$ ast
4++$ chunk
55 $%
66 [%blok blok]
77 ==
@@ -19,7 +19,7 @@
1919 [%false ~]
2020 [%nil ~]
2121 ==
22−+$ string @t
22++$ string (list @)
2323+$ table field-list
2424+$ field-list (list field)
2525+$ field
@@ -60,7 +60,7 @@
6060 ==
6161+$ numeral
6262 $%
63− [%int @u]
63+ [%int @st]
6464 [%float @rd]
6565 ==
6666+$ exprlist (lest expr)
@@ -104,8 +104,8 @@
104104+$ funcbody [pars=parlist body=blok]
105105+$ parlist [pars=(list name) wildcard=?]
106106+$ local-function [=name body=funcbody]
107−+$ local-asmnt [=attnamelist rhs=(unit exprlist)]
108−+$ attnamelist (lest [=name attr=(unit attrib)])
107++$ local-asmnt [=attrnamelist rhs=(unit exprlist)]
108++$ attrnamelist (lest [=name attr=(unit attrib)])
109109+$ attrib
110110 $?
111111 %const
zod/luau/sur/spider.hoon → desk/sur/spider.hoonrenamed

The content is the same.

zod/luau/sys.kelvin → desk/sys.kelvinrenamed

The content is the same.

desk/ted/eval-lua.hoonnew file+19
@@ -0,0 +1,19 @@
1+/- spider
2+/+ *strandio
3+/+ lua-parser
4+/+ lua-printer
5+/+ lua-interpreter
6+=>
7+|%
8+--
9+=/ m (strand:spider ,vase)
10+^- thread:spider
11+|= arg=vase
12+^- form:m
13+=/ file=beam (need (de-beam (need !<((unit path) arg))))
14+;< =cage bind:m (read-file file)
15+=/ lua-code=@t (of-wain:format !<(wain +.cage))
16+~& %parsing
17+=/ ast (scan (trip lua-code) lua-parser)
18+~& %evaluating
19+%- pure:m !>((lua-interpreter ast))
zod/luau/ted/test-lua.hoon → desk/ted/test-lua.hoonrenamed+8−9
@@ -30,7 +30,12 @@
3030 ?- -.flag
3131 %restrict ~[+.flag]
3232 ==
33−;< bek=beak bind:m get-beak
33+=/ parse
34+ |* src=tape
35+ ?: (has-flag %crash-parser)
36+ (some (scan src lua-parser))
37+ (rust src lua-parser)
38+ ;< bek=beak bind:m get-beak
3439;< lua-files=(list path) bind:m (list-tree [bek /res/lua])
3540=/ lua-files %+ skim lua-files
3641 |= =path
@@ -51,10 +56,7 @@
5156 ;< =cage bind:m (read-file [bek current-file])
5257 =/ lua-code=@t (of-wain:format !<(wain +.cage))
5358 ~& %parsing
54− =/ ast-unit
55− ?: (has-flag %crash-parser)
56− (some (rash lua-code lua-parser))
57− (rush lua-code lua-parser)
59+ =/ ast-unit (parse (trip lua-code))
5860 ;< parse-result=test-result bind:m
5961 =/ m (strand:spider ,test-result)
6062 ?~ ast-unit (pure:m %err)
@@ -68,10 +70,7 @@
6870 %& [(into current-file 2 ~.cycled) %ins %lua !>((to-wain:format (crip printed)))]~
6971 ==
7072 ~& %parsing-printed
71− =/ cycled-ast-unit
72− ?: (has-flag %crash-parser)
73− (some (scan printed lua-parser))
74− (rust printed lua-parser)
73+ =/ cycled-ast-unit (parse printed)
7574 ?~ cycled-ast-unit (pure:m %err)
7675 =/ ast u.cycled-ast-unit
7776 ~? (has-flag %print-asts) ast
zod/luau/TODO.mddeleted−6
@@ -1,6 +0,0 @@
1−# Parser
2−
3−- [x] functioncall
4−- [x] any string apart from the basic string with no escapes
5−- [ ] check if int fits in int or make it a float
6−- [ ] should `print-blok` have `do`-`end`? This is fucked.
zod/luau/lib/interlist.hoondeleted−32
@@ -1,32 +0,0 @@
1−=<
2−|%
3−++ interlist
4− |$ [sep val]
5− $%
6− [%double =val =sep tail=(interlist sep val)]
7− [%single =val]
8− ==
9−++ parse-interlist
10− |* [s=rule v=rule]
11− =/ val (rule-type v)
12− =/ sep (rule-type s)
13− %+ cook
14− |* [v=* rest=(list [* *])]
15− ^- (interlist sep val)
16− =/ rrest (flop rest)
17− ?~ rrest [%single v]
18− =/ tail
19− %+ roll t.rrest
20− |* [[s=* v=*] _[acc=`(interlist sep val)`[%single +.i.rrest] last-sep=-.i.rrest]]
21− [[%double v last-sep acc] s]
22− [%double v +.tail -.tail]
23− ;~(plug v (star ;~(plug s v)))
24−--
25−|%
26−++ rule-type
27− |* =rule
28− $_
29− =/ ret q:$:rule
30− ?> ?=(^ ret)
31− p.u.ret
32−--
zod/luau/res/lua/cycled/all.luadeleted−203
@@ -1,203 +0,0 @@
1−local version = "\76\117\97\32\53\46\52"
2−if _VERSION ~= version then
3−io.stderr:write("\84\104\105\115\32\116\101\115\116\32\115\117\105\116\101\32\105\115\32\102\111\114\32",version,"\44\32\110\111\116\32\102\111\114\32",_VERSION,"\10\69\120\105\116\105\110\103\32\116\101\115\116\115")
4−return
5−end
6−_G.ARG=arg
7−_soft=rawget(_G,"\95\115\111\102\116") or false
8−_port=rawget(_G,"\95\112\111\114\116") or false
9−_nomsg=rawget(_G,"\95\110\111\109\115\103") or false
10−local usertests = rawget(_G,"\95\85")
11−if usertests then
12−_soft=true
13−_port=true
14−_nomsg=true
15−end
16−debug=nil
17−if usertests then
18−T=nil
19−else
20−T=rawget(_G,"\84")
21−end
22−print("\10\9\83\116\97\114\116\105\110\103\32\84\101\115\116\115")
23−do
24−local random_x,random_y = math.randomseed()
25−print(string.format("\114\97\110\100\111\109\32\115\101\101\100\115\58\32\37\100\44\32\37\100",random_x,random_y))
26−end
27−print("\99\117\114\114\101\110\116\32\112\97\116\104\58\10\42\42\42\42" .. package.path .. "\42\42\42\42\10")
28−local initclock = os.clock()
29−local lastclock = initclock
30−local walltime = os.time()
31−local collectgarbage = collectgarbage
32−do
33−local msgs = {}
34−function Message(m)
35−if not _nomsg then
36−print(m)
37−msgs[# msgs + 1]=string.sub(m,3,- 3)
38−end
39−end
40−assert(os.setlocale("\67"))
41−local T,print,format,write,assert,type,unpack,floor = T,print,string.format,io.write,assert,type,table.unpack,math.floor
42−local function F
43−(m)
44−local function round
45−(m)
46−m=m + 0.04999
47−return format("\37\46\49\102",m)
48−end
49−if m < 1000 then
50−return m
51−else
52−m=m / 1000
53−if m < 1000 then
54−return round(m) .. "\75"
55−else
56−return round(m / 1000) .. "\77"
57−end
58−end
59−end
60−local Cstacklevel
61−local showmem
62−if not T then
63−local max = 0
64−showmem=function ()
65−local m = collectgarbage("\99\111\117\110\116") * 1024
66−max=(m > max) and m or max
67−print(format("\32\32\32\32\45\45\45\45\32\116\111\116\97\108\32\109\101\109\111\114\121\58\32\37\115\44\32\109\97\120\32\109\101\109\111\114\121\58\32\37\115\32\45\45\45\45\10",F(m),F(max)))
68−end
69−Cstacklevel=function ()
70−return 0
71−end
72−else
73−showmem=function ()
74−T.checkmemory()
75−local total,numblocks,maxmem = T.totalmem()
76−local count = collectgarbage("\99\111\117\110\116")
77−print(format("\10\32\32\32\32\45\45\45\45\32\116\111\116\97\108\32\109\101\109\111\114\121\58\32\37\115\32\40\37\46\48\102\75\41\44\32\109\97\120\32\117\115\101\58\32\37\115\44\32\32\98\108\111\99\107\115\58\32\37\100\10",F(total),count,F(maxmem),numblocks))
78−print(format("\9\40\115\116\114\105\110\103\115\58\32\32\37\100\44\32\116\97\98\108\101\115\58\32\37\100\44\32\102\117\110\99\116\105\111\110\115\58\32\37\100\44\32" .. "\10\9\117\100\97\116\97\58\32\37\100\44\32\116\104\114\101\97\100\115\58\32\37\100\41",T.totalmem("\115\116\114\105\110\103"),T.totalmem("\116\97\98\108\101"),T.totalmem("\102\117\110\99\116\105\111\110"),T.totalmem("\117\115\101\114\100\97\116\97"),T.totalmem("\116\104\114\101\97\100")))
79−end
80−Cstacklevel=function ()
81−local _,_,ncalls = T.stacklevel()
82−return ncalls
83−end
84−end
85−local Cstack = Cstacklevel()
86−local function report
87−(n)
88−print("\10\42\42\42\42\42\32\70\73\76\69\32\39" .. n .. "\39\42\42\42\42\42")
89−end
90−local olddofile = dofile
91−local dofile = function (n,strip)
92−showmem()
93−local c = os.clock()
94−print(string.format("\116\105\109\101\58\32\37\103\32\40\43\37\103\41",c - initclock,c - lastclock))
95−lastclock=c
96−report(n)
97−local f = assert(loadfile(n))
98−local b = string.dump(f,strip)
99−f=assert(load(b))
100−return f()
101−end
102−dofile("\109\97\105\110\46\108\117\97")
103−require("\116\114\97\99\101\103\99").start()
104−report("\103\99\46\108\117\97")
105−local f = assert(loadfile("\103\99\46\108\117\97"))
106−f()
107−dofile("\100\98\46\108\117\97")
108−assert(dofile("\99\97\108\108\115\46\108\117\97") == deep and deep)
109−_G.deep=nil
110−olddofile("\115\116\114\105\110\103\115\46\108\117\97")
111−olddofile("\108\105\116\101\114\97\108\115\46\108\117\97")
112−dofile("\116\112\97\99\107\46\108\117\97")
113−assert(dofile("\97\116\116\114\105\98\46\108\117\97") == 27)
114−dofile("\103\101\110\103\99\46\108\117\97")
115−assert(dofile("\108\111\99\97\108\115\46\108\117\97") == 5)
116−dofile("\99\111\110\115\116\114\117\99\116\115\46\108\117\97")
117−dofile("\99\111\100\101\46\108\117\97",true)
118−if not _G._soft then
119−report("\98\105\103\46\108\117\97")
120−local f = coroutine.wrap(assert(loadfile("\98\105\103\46\108\117\97")))
121−assert(f() == "\98")
122−assert(f() == "\97")
123−end
124−dofile("\99\115\116\97\99\107\46\108\117\97")
125−dofile("\110\101\120\116\118\97\114\46\108\117\97")
126−dofile("\112\109\46\108\117\97")
127−dofile("\117\116\102\56\46\108\117\97")
128−dofile("\97\112\105\46\108\117\97")
129−assert(dofile("\101\118\101\110\116\115\46\108\117\97") == 12)
130−dofile("\118\97\114\97\114\103\46\108\117\97")
131−dofile("\99\108\111\115\117\114\101\46\108\117\97")
132−dofile("\99\111\114\111\117\116\105\110\101\46\108\117\97")
133−dofile("\103\111\116\111\46\108\117\97",true)
134−dofile("\101\114\114\111\114\115\46\108\117\97")
135−dofile("\109\97\116\104\46\108\117\97")
136−dofile("\115\111\114\116\46\108\117\97",true)
137−dofile("\98\105\116\119\105\115\101\46\108\117\97")
138−assert(dofile("\118\101\114\121\98\105\103\46\108\117\97",true) == 10)
139−;
140−collectgarbage()
141−dofile("\102\105\108\101\115\46\108\117\97")
142−if # msgs > 0 then
143−local m = table.concat(msgs,"\10\32\32")
144−warn("\35\116\101\115\116\115\32\110\111\116\32\112\101\114\102\111\114\109\101\100\58\10\32\32",m,"\10")
145−end
146−print("\40\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\116\119\111\32\119\97\114\110\105\110\103\115\32\110\111\119\41")
147−warn("\64\111\110")
148−warn("\35\84\104\105\115\32\105\115\32","\97\110\32\101\120\112\101\99\116\101\100","\32\119\97\114\110\105\110\103")
149−warn("\64\111\102\102")
150−warn("\42\42\42\42\42\42\42\42\32\84\72\73\83\32\87\65\82\78\73\78\71\32\83\72\79\85\76\68\32\78\79\84\32\65\80\80\69\65\82\32\42\42\42\42\42\42\42\42\42\42")
151−warn("\42\42\42\42\42\42\42\42\32\84\72\73\83\32\87\65\82\78\73\78\71\32\65\76\83\79\32\83\72\79\85\76\68\32\78\79\84\32\65\80\80\69\65\82\32\42\42\42\42\42\42\42\42\42\42")
152−warn("\64\111\110")
153−warn("\35\84\104\105\115\32\105\115","\32\97\110\111\116\104\101\114\32\111\110\101")
154−assert(debug == nil)
155−local debug = require("\100\101\98\117\103")
156−print(string.format("\37\100\45\98\105\116\32\105\110\116\101\103\101\114\115\44\32\37\100\45\98\105\116\32\102\108\111\97\116\115",string.packsize("\106") * 8,string.packsize("\110") * 8))
157−debug.sethook(function (a)
158−assert(type(a) == "\115\116\114\105\110\103")
159−end,"\99\114")
160−_G.showmem=showmem
161−assert(Cstack == Cstacklevel(),"\115\104\111\117\108\100\32\98\101\32\97\116\32\116\104\101\32\115\97\109\101\32\67\45\115\116\97\99\107\32\108\101\118\101\108\32\105\116\32\119\97\115\32\119\104\101\110\32\115\116\97\114\116\101\100\32\116\104\101\32\116\101\115\116\115")
162−end
163−local _G,showmem,print,format,clock,time,difftime,assert,open,warn = _G,showmem,print,string.format,os.clock,os.time,os.difftime,assert,io.open,warn
164−local fname = T and "\116\105\109\101\45\100\101\98\117\103\46\116\120\116" or "\116\105\109\101\46\116\120\116"
165−local lasttime
166−if not usertests then
167−local f = io.open(fname)
168−if f then
169−lasttime=assert(tonumber(f:read("\97")))
170−f:close()
171−;
172−else
173−lasttime=nil
174−end
175−end
176−print("\99\108\101\97\110\105\110\103\32\97\108\108\33\33\33\33")
177−for n in pairs(_G)
178−do
179−if not ({["\95\95\95\71\108\111\98"] = 1,["\116\111\115\116\114\105\110\103"] = 1})[n] then
180−_G[n]=undef
181−end
182−end
183−collectgarbage()
184−collectgarbage()
185−collectgarbage()
186−collectgarbage()
187−collectgarbage()
188−collectgarbage()
189−;
190−showmem()
191−local clocktime = clock() - initclock
192−walltime=difftime(time(),walltime)
193−print(format("\10\10\116\111\116\97\108\32\116\105\109\101\58\32\37\46\50\102\115\32\40\119\97\108\108\32\116\105\109\101\58\32\37\103\115\41\10",clocktime,walltime))
194−if not usertests then
195−lasttime=lasttime or clocktime
196−local diff = (clocktime - lasttime) / lasttime
197−local tolerance = 0.05
198−if (diff >= tolerance or diff <= - tolerance) then
199−warn(format("\35\116\105\109\101\32\100\105\102\102\101\114\101\110\99\101\32\102\114\111\109\32\112\114\101\118\105\111\117\115\32\116\101\115\116\58\32\37\43\46\49\102\37\37",diff * 100))
200−end
201−assert(open(fname,"\119")):write(clocktime):close()
202−end
203−print("\102\105\110\97\108\32\79\75\32\33\33\33")
zod/luau/res/lua/cycled/api.luadeleted−1167
@@ -1,1167 +0,0 @@
1−if T == nil then
2−(Message or print)("\10\32\62\62\62\32\116\101\115\116\67\32\110\111\116\32\97\99\116\105\118\101\58\32\115\107\105\112\112\105\110\103\32\65\80\73\32\116\101\115\116\115\32\60\60\60\10")
3−return
4−end
5−local debug = require("\100\101\98\117\103")
6−local pack = table.pack
7−local MEMERRMSG = "\110\111\116\32\101\110\111\117\103\104\32\109\101\109\111\114\121"
8−local function tcheck
9−(t1,t2)
10−assert(t1.n == (t2.n or # t2) + 1)
11−for i = 2, t1.n
12−do
13−assert(t1[i] == t2[i - 1])
14−end
15−end
16−local function checkerr
17−(msg,f, ...)
18−local stat,err = pcall(f,...)
19−assert(not stat and string.find(err,msg))
20−end
21−print("\116\101\115\116\105\110\103\32\67\32\65\80\73")
22−local a = T.testC("\112\117\115\104\118\97\108\117\101\32\82\59\32\114\101\116\117\114\110\32\49")
23−assert(a == debug.getregistry())
24−assert(T.testC("\115\101\116\116\111\112\32\49\48\59\32\97\98\115\105\110\100\101\120\32\45\49\59\32\114\101\116\117\114\110\32\49") == 10)
25−assert(T.testC("\115\101\116\116\111\112\32\53\59\32\97\98\115\105\110\100\101\120\32\45\53\59\32\114\101\116\117\114\110\32\49") == 1)
26−assert(T.testC("\115\101\116\116\111\112\32\49\48\59\32\97\98\115\105\110\100\101\120\32\49\59\32\114\101\116\117\114\110\32\49") == 1)
27−assert(T.testC("\115\101\116\116\111\112\32\49\48\59\32\97\98\115\105\110\100\101\120\32\82\59\32\114\101\116\117\114\110\32\49") < - 10)
28−a=T.d2s(12458954321123.0)
29−assert(a == string.pack("\100",12458954321123.0))
30−assert(T.s2d(a) == 12458954321123.0)
31−local a,b,c = T.testC("\112\117\115\104\110\117\109\32\49\59\32\112\117\115\104\110\117\109\32\50\59\32\112\117\115\104\110\117\109\32\51\59\32\114\101\116\117\114\110\32\50")
32−assert(a == 2 and b == 3 and not c)
33−local f = T.makeCfunc("\112\117\115\104\110\117\109\32\49\59\32\112\117\115\104\110\117\109\32\50\59\32\112\117\115\104\110\117\109\32\51\59\32\114\101\116\117\114\110\32\50")
34−a,b,c=f()
35−assert(a == 2 and b == 3 and not c)
36−a,b,c=T.testC("\112\117\115\104\98\111\111\108\32\49\59\32\112\117\115\104\98\111\111\108\32\50\59\32\112\117\115\104\98\111\111\108\32\48\59\32\114\101\116\117\114\110\32\51")
37−assert(a == b and a == true and c == false)
38−a,b,c=T.testC("\112\117\115\104\98\111\111\108\32\48\59\32\112\117\115\104\98\111\111\108\32\49\48\59\32\112\117\115\104\110\105\108\59\10\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\116\111\98\111\111\108\32\45\51\59\32\116\111\98\111\111\108\32\45\51\59\32\116\111\98\111\111\108\32\45\51\59\32\114\101\116\117\114\110\32\51")
39−assert(a == false and b == true and c == false)
40−a,b,c=T.testC("\103\101\116\116\111\112\59\32\114\101\116\117\114\110\32\50",10,20,30,40)
41−assert(a == 40 and b == 5 and not c)
42−local t = pack(T.testC("\115\101\116\116\111\112\32\53\59\32\114\101\116\117\114\110\32\42",2,3))
43−tcheck(t,{["\110"] = 4,2,3})
44−t=pack(T.testC("\115\101\116\116\111\112\32\48\59\32\115\101\116\116\111\112\32\49\53\59\32\114\101\116\117\114\110\32\49\48",3,1,23))
45−assert(t.n == 10 and t[1] == nil and t[10] == nil)
46−t=pack(T.testC("\114\101\109\111\118\101\32\45\50\59\32\114\101\116\117\114\110\32\42",2,3,4))
47−tcheck(t,{["\110"] = 2,2,4})
48−t=pack(T.testC("\105\110\115\101\114\116\32\45\49\59\32\114\101\116\117\114\110\32\42",2,3))
49−tcheck(t,{["\110"] = 2,2,3})
50−t=pack(T.testC("\105\110\115\101\114\116\32\51\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
51−tcheck(t,{["\110"] = 4,2,5,3,4})
52−t=pack(T.testC("\114\101\112\108\97\99\101\32\50\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
53−tcheck(t,{["\110"] = 3,5,3,4})
54−t=pack(T.testC("\114\101\112\108\97\99\101\32\45\50\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
55−tcheck(t,{["\110"] = 3,2,3,5})
56−t=pack(T.testC("\114\101\109\111\118\101\32\51\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
57−tcheck(t,{["\110"] = 3,2,4,5})
58−t=pack(T.testC("\99\111\112\121\32\51\32\52\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
59−tcheck(t,{["\110"] = 4,2,3,3,5})
60−t=pack(T.testC("\99\111\112\121\32\45\51\32\45\49\59\32\114\101\116\117\114\110\32\42",2,3,4,5))
61−tcheck(t,{["\110"] = 4,2,3,4,3})
62−do
63−local t = {10,20,30,40,50,60}
64−for i = - 6, 6
65−do
66−local s = string.format("\114\111\116\97\116\101\32\50\32\37\100\59\32\114\101\116\117\114\110\32\55",i)
67−local t1 = pack(T.testC(s,10,20,30,40,50,60))
68−tcheck(t1,t)
69−table.insert(t,1,table.remove(t))
70−end
71−t=pack(T.testC("\114\111\116\97\116\101\32\45\50\32\49\59\32\114\101\116\117\114\110\32\42",10,20,30,40))
72−tcheck(t,{10,20,40,30})
73−t=pack(T.testC("\114\111\116\97\116\101\32\45\50\32\45\49\59\32\114\101\116\117\114\110\32\42",10,20,30,40))
74−tcheck(t,{10,20,40,30})
75−t=pack(T.testC("\114\111\116\97\116\101\32\45\49\32\48\59\32\114\101\116\117\114\110\32\42",10,20,30,40))
76−tcheck(t,{10,20,30,40})
77−t=pack(T.testC("\114\111\116\97\116\101\32\45\49\32\49\59\32\114\101\116\117\114\110\32\42",10,20,30,40))
78−tcheck(t,{10,20,30,40})
79−t=pack(T.testC("\114\111\116\97\116\101\32\53\32\45\49\59\32\114\101\116\117\114\110\32\42",10,20,30,40))
80−tcheck(t,{10,20,30,40})
81−end
82−T.testC("\32\32\119\97\114\110\105\110\103\67\32\34\35\84\104\105\115\32\115\104\111\108\100\32\98\101\32\97\34\10\32\32\119\97\114\110\105\110\103\67\32\34\32\115\105\110\103\108\101\32\34\10\32\32\119\97\114\110\105\110\103\32\34\119\97\114\110\105\110\103\34\10\32\32\119\97\114\110\105\110\103\67\32\34\35\84\104\105\115\32\115\104\111\117\108\100\32\98\101\32\34\10\32\32\119\97\114\110\105\110\103\32\34\97\110\111\116\104\101\114\32\111\110\101\34\10")
83−do
84−local f = T.makeCfunc("\32\32\32\32\103\101\116\103\108\111\98\97\108\32\101\114\114\111\114\10\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\98\111\108\97\10\32\32\32\32\112\99\97\108\108\32\49\32\49\32\49\32\32\32\35\32\99\97\108\108\32\39\101\114\114\111\114\39\32\119\105\116\104\32\103\105\118\101\110\32\104\97\110\100\108\101\114\10\32\32\32\32\112\117\115\104\115\116\97\116\117\115\10\32\32\32\32\114\101\116\117\114\110\32\50\32\32\32\32\32\35\32\114\101\116\117\114\110\32\101\114\114\111\114\32\109\101\115\115\97\103\101\32\97\110\100\32\115\116\97\116\117\115\10\32\32")
85−local msg,st = f(string.upper)
86−assert(st == "\69\82\82\82\85\78" and msg == "\66\79\76\65")
87−local msg,st = f(string.len)
88−assert(st == "\69\82\82\82\85\78" and msg == 4)
89−end
90−t=pack(T.testC("\105\110\115\101\114\116\32\51\59\32\112\117\115\104\118\97\108\117\101\32\51\59\32\114\101\109\111\118\101\32\51\59\32\112\117\115\104\118\97\108\117\101\32\50\59\32\114\101\109\111\118\101\32\50\59\32\10\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\105\110\115\101\114\116\32\50\59\32\112\117\115\104\118\97\108\117\101\32\49\59\32\114\101\109\111\118\101\32\49\59\32\105\110\115\101\114\116\32\49\59\32\10\32\32\32\32\32\32\105\110\115\101\114\116\32\45\50\59\32\112\117\115\104\118\97\108\117\101\32\45\50\59\32\114\101\109\111\118\101\32\45\51\59\32\114\101\116\117\114\110\32\42",2,3,4,5,10,40,90))
91−tcheck(t,{["\110"] = 7,2,3,4,5,10,40,90})
92−t=pack(T.testC("\99\111\110\99\97\116\32\53\59\32\114\101\116\117\114\110\32\42","\97\108\111",2,3,"\106\111\97\111",12))
93−tcheck(t,{["\110"] = 1,"\97\108\111\50\51\106\111\97\111\49\50"})
94−t=pack(T.testC("\99\97\108\108\32\50\44\45\49\59\32\114\101\116\117\114\110\32\42",function (a,b)
95−return 1,2,3,4,a,b
96−end,"\97\108\111","\106\111\97\111"))
97−tcheck(t,{["\110"] = 6,1,2,3,4,"\97\108\111","\106\111\97\111"})
98−do
99−local a = {}
100−for i = 1, 1000
101−do
102−a[i]=true
103−end
104−;
105−a[999]=10
106−local b = T.testC("\112\99\97\108\108\32\49\32\45\49\32\48\59\32\112\111\112\32\49\59\32\116\111\115\116\114\105\110\103\32\45\49\59\32\114\101\116\117\114\110\32\49",table.unpack,a)
107−assert(b == "\49\48")
108−end
109−_G.AA=14
110−;
111−_G.BB="\97\51\49"
112−local a = {T.testC("\32\32\103\101\116\103\108\111\98\97\108\32\65\65\59\10\32\32\103\101\116\103\108\111\98\97\108\32\66\66\59\10\32\32\103\101\116\103\108\111\98\97\108\32\66\66\59\10\32\32\115\101\116\103\108\111\98\97\108\32\65\65\59\10\32\32\114\101\116\117\114\110\32\42\10")}
113−assert(a[2] == 14 and a[3] == "\97\51\49" and a[4] == nil and _G.AA == "\97\51\49")
114−_G.AA,_G.BB=nil
115−assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\50\48\59\32\97\114\105\116\104\32\47\59\32\114\101\116\117\114\110\32\49") == 0.5)
116−assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\50\48\59\32\97\114\105\116\104\32\45\59\32\114\101\116\117\114\110\32\49") == - 10)
117−assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\45\50\48\59\32\97\114\105\116\104\32\42\59\32\114\101\116\117\114\110\32\49") == - 200)
118−assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\51\59\32\97\114\105\116\104\32\94\59\32\114\101\116\117\114\110\32\49") == 1000)
119−assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\115\116\114\105\110\103\32\50\48\59\32\97\114\105\116\104\32\47\59\32\114\101\116\117\114\110\32\49") == 0.5)
120−assert(T.testC("\112\117\115\104\115\116\114\105\110\103\32\49\48\59\32\112\117\115\104\110\117\109\32\50\48\59\32\97\114\105\116\104\32\45\59\32\114\101\116\117\114\110\32\49") == - 10)
121−assert(T.testC("\112\117\115\104\115\116\114\105\110\103\32\49\48\59\32\112\117\115\104\115\116\114\105\110\103\32\45\50\48\59\32\97\114\105\116\104\32\42\59\32\114\101\116\117\114\110\32\49") == - 200)
122−assert(T.testC("\112\117\115\104\115\116\114\105\110\103\32\49\48\59\32\112\117\115\104\115\116\114\105\110\103\32\51\59\32\97\114\105\116\104\32\94\59\32\114\101\116\117\114\110\32\49") == 1000)
123−assert(T.testC("\97\114\105\116\104\32\47\59\32\114\101\116\117\114\110\32\49",2,0) == 10.0 / 0)
124−a=T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\105\110\116\32\51\59\32\97\114\105\116\104\32\92\59\32\114\101\116\117\114\110\32\49")
125−assert(a == 3.0 and math.type(a) == "\102\108\111\97\116")
126−a=T.testC("\112\117\115\104\105\110\116\32\49\48\59\32\112\117\115\104\105\110\116\32\51\59\32\97\114\105\116\104\32\92\59\32\114\101\116\117\114\110\32\49")
127−assert(a == 3 and math.type(a) == "\105\110\116\101\103\101\114")
128−a=assert(T.testC("\112\117\115\104\105\110\116\32\49\48\59\32\112\117\115\104\105\110\116\32\51\59\32\97\114\105\116\104\32\43\59\32\114\101\116\117\114\110\32\49"))
129−assert(a == 13 and math.type(a) == "\105\110\116\101\103\101\114")
130−a=assert(T.testC("\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\105\110\116\32\51\59\32\97\114\105\116\104\32\43\59\32\114\101\116\117\114\110\32\49"))
131−assert(a == 13 and math.type(a) == "\102\108\111\97\116")
132−a,b,c=T.testC("\112\117\115\104\110\117\109\32\49\59\10\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\49\48\59\32\97\114\105\116\104\32\95\59\10\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\53\59\32\114\101\116\117\114\110\32\51")
133−assert(a == 1 and b == - 10 and c == "\53")
134−local mt = {["\95\95\97\100\100"] = function (a,b)
135−return setmetatable({a[1] + b[1]},mt)
136−end,["\95\95\109\111\100"] = function (a,b)
137−return setmetatable({a[1] % b[1]},mt)
138−end,["\95\95\117\110\109"] = function (a)
139−return setmetatable({a[1] * 2},mt)
140−end}
141−a,b,c=setmetatable({4},mt),setmetatable({8},mt),setmetatable({- 3},mt)
142−local x,y,z = T.testC("\97\114\105\116\104\32\43\59\32\114\101\116\117\114\110\32\50",10,a,b)
143−assert(x == 10 and y[1] == 12 and z == nil)
144−assert(T.testC("\97\114\105\116\104\32\37\59\32\114\101\116\117\114\110\32\49",a,c)[1] == 4 % - 3)
145−assert(T.testC("\97\114\105\116\104\32\95\59\32\97\114\105\116\104\32\43\59\32\97\114\105\116\104\32\37\59\32\114\101\116\117\114\110\32\49",b,a,c)[1] == 8 % (4 + (- 3) * 2))
146−checkerr("\100\105\118\105\100\101\32\98\121\32\122\101\114\111",T.testC,"\97\114\105\116\104\32\92",10,0)
147−checkerr("\37\37\48",T.testC,"\97\114\105\116\104\32\37",10,0)
148−assert(T.testC("\99\111\109\112\97\114\101\32\76\84\32\50\32\53\44\32\114\101\116\117\114\110\32\49",3,2,2,4,2,2))
149−assert(T.testC("\99\111\109\112\97\114\101\32\76\69\32\50\32\53\44\32\114\101\116\117\114\110\32\49",3,2,2,4,2,2))
150−assert(not T.testC("\99\111\109\112\97\114\101\32\76\84\32\51\32\52\44\32\114\101\116\117\114\110\32\49",3,2,2,4,2,2))
151−assert(T.testC("\99\111\109\112\97\114\101\32\76\69\32\51\32\52\44\32\114\101\116\117\114\110\32\49",3,2,2,4,2,2))
152−assert(T.testC("\99\111\109\112\97\114\101\32\76\84\32\53\32\50\44\32\114\101\116\117\114\110\32\49",4,2,2,3,2,2))
153−assert(not T.testC("\99\111\109\112\97\114\101\32\76\84\32\50\32\45\51\44\32\114\101\116\117\114\110\32\49","\52","\50","\50","\51","\50","\50"))
154−assert(not T.testC("\99\111\109\112\97\114\101\32\76\84\32\45\51\32\50\44\32\114\101\116\117\114\110\32\49","\51","\50","\50","\52","\50","\50"))
155−assert(not T.testC("\99\111\109\112\97\114\101\32\76\84\32\49\32\52\44\32\114\101\116\117\114\110\32\49"))
156−assert(not T.testC("\99\111\109\112\97\114\101\32\76\69\32\57\32\49\44\32\114\101\116\117\114\110\32\49"))
157−assert(not T.testC("\99\111\109\112\97\114\101\32\69\81\32\57\32\57\44\32\114\101\116\117\114\110\32\49"))
158−local b = {["\95\95\108\116"] = function (a,b)
159−return a[1] < b[1]
160−end}
161−local a1,a3,a4 = setmetatable({1},b),setmetatable({3},b),setmetatable({4},b)
162−assert(T.testC("\99\111\109\112\97\114\101\32\76\84\32\50\32\53\44\32\114\101\116\117\114\110\32\49",a3,2,2,a4,2,2))
163−assert(T.testC("\99\111\109\112\97\114\101\32\76\69\32\50\32\53\44\32\114\101\116\117\114\110\32\49",a3,2,2,a4,2,2))
164−assert(T.testC("\99\111\109\112\97\114\101\32\76\84\32\53\32\45\54\44\32\114\101\116\117\114\110\32\49",a4,2,2,a3,2,2))
165−a,b=T.testC("\99\111\109\112\97\114\101\32\76\84\32\53\32\45\54\44\32\114\101\116\117\114\110\32\50",a1,2,2,a3,2,20)
166−assert(a == 20 and b == false)
167−a,b=T.testC("\99\111\109\112\97\114\101\32\76\69\32\53\32\45\54\44\32\114\101\116\117\114\110\32\50",a1,2,2,a3,2,20)
168−assert(a == 20 and b == false)
169−a,b=T.testC("\99\111\109\112\97\114\101\32\76\69\32\53\32\45\54\44\32\114\101\116\117\114\110\32\50",a1,2,2,a1,2,20)
170−assert(a == 20 and b == true)
171−do
172−local mt = {["\95\95\108\116"] = function (a,b)
173−return a[1] < b[1]
174−end,["\95\95\108\101"] = function (a,b)
175−return a[1] <= b[1]
176−end,["\95\95\101\113"] = function (a,b)
177−return a[1] == b[1]
178−end}
179−local function O
180−(x)
181−return setmetatable({x},mt)
182−end
183−local a,b = T.testC("\99\111\109\112\97\114\101\32\76\84\32\50\32\51\59\32\112\117\115\104\105\110\116\32\49\48\59\32\114\101\116\117\114\110\32\50",O(1),O(2))
184−assert(a == true and b == 10)
185−local a,b = T.testC("\99\111\109\112\97\114\101\32\76\69\32\50\32\51\59\32\112\117\115\104\105\110\116\32\49\48\59\32\114\101\116\117\114\110\32\50",O(3),O(2))
186−assert(a == false and b == 10)
187−local a,b = T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\112\117\115\104\105\110\116\32\49\48\59\32\114\101\116\117\114\110\32\50",O(3),O(3))
188−assert(a == true and b == 10)
189−end
190−local t = setmetatable({["\120"] = 20},{["\95\95\108\101\110"] = function (t)
191−return t.x
192−end})
193−a,b,c=T.testC("\32\32\32\108\101\110\32\50\59\10\32\32\32\76\108\101\110\32\50\59\10\32\32\32\111\98\106\115\105\122\101\32\50\59\10\32\32\32\114\101\116\117\114\110\32\51\10",t)
194−assert(a == 20 and b == 20 and c == 0)
195−t.x="\50\51\52"
196−;
197−t[1]=20
198−a,b,c=T.testC("\32\32\32\108\101\110\32\50\59\10\32\32\32\76\108\101\110\32\50\59\10\32\32\32\111\98\106\115\105\122\101\32\50\59\10\32\32\32\114\101\116\117\114\110\32\51\10",t)
199−assert(a == "\50\51\52" and b == 234 and c == 1)
200−t.x=print
201−;
202−t[1]=20
203−a,c=T.testC("\32\32\32\108\101\110\32\50\59\10\32\32\32\111\98\106\115\105\122\101\32\50\59\10\32\32\32\114\101\116\117\114\110\32\50\10",t)
204−assert(a == print and c == 1)
205−a=setmetatable({["\120"] = "\117"},{["\95\95\99\111\110\99\97\116"] = function (a,b)
206−return a.x .. "\46" .. b.x
207−end})
208−x,y=T.testC("\32\32\112\117\115\104\110\117\109\32\53\10\32\32\112\117\115\104\118\97\108\117\101\32\50\59\10\32\32\112\117\115\104\118\97\108\117\101\32\50\59\10\32\32\99\111\110\99\97\116\32\50\59\10\32\32\112\117\115\104\118\97\108\117\101\32\45\50\59\10\32\32\114\101\116\117\114\110\32\50\59\10",a,a)
209−assert(x == a .. a and y == 5)
210−assert(T.testC("\99\111\110\99\97\116\32\48\59\32\114\101\116\117\114\110\32\49") == "")
211−assert(T.testC("\99\111\110\99\97\116\32\49\59\32\114\101\116\117\114\110\32\49","\120\117\120\117") == "\120\117\120\117")
212−local function B
213−(x)
214−return x and 1 or 0
215−end
216−local function count
217−(x,n)
218−n=n or 2
219−local prog = "\32\32\32\32\105\115\110\117\109\98\101\114\32\37\100\59\10\32\32\32\32\105\115\115\116\114\105\110\103\32\37\100\59\10\32\32\32\32\105\115\102\117\110\99\116\105\111\110\32\37\100\59\10\32\32\32\32\105\115\99\102\117\110\99\116\105\111\110\32\37\100\59\10\32\32\32\32\105\115\116\97\98\108\101\32\37\100\59\10\32\32\32\32\105\115\117\115\101\114\100\97\116\97\32\37\100\59\10\32\32\32\32\105\115\110\105\108\32\37\100\59\10\32\32\32\32\105\115\110\117\108\108\32\37\100\59\10\32\32\32\32\114\101\116\117\114\110\32\56\10\32\32"
220−prog=string.format(prog,n,n,n,n,n,n,n,n)
221−local a,b,c,d,e,f,g,h = T.testC(prog,x)
222−return B(a) + B(b) + B(c) + B(d) + B(e) + B(f) + B(g) + (100 * B(h))
223−end
224−assert(count(3) == 2)
225−assert(count("\97\108\111") == 1)
226−assert(count("\51\50") == 2)
227−assert(count({}) == 1)
228−assert(count(print) == 2)
229−assert(count(function ()
230−
231−end) == 1)
232−assert(count(nil) == 1)
233−assert(count(io.stdin) == 1)
234−assert(count(nil,15) == 100)
235−local function to
236−(s,x,n)
237−n=n or 2
238−return T.testC(string.format("\37\115\32\37\100\59\32\114\101\116\117\114\110\32\49",s,n),x)
239−end
240−local null = T.pushuserdata(0)
241−local hfunc = string.gmatch("","")
242−assert(debug.getupvalue(hfunc,1))
243−assert(to("\116\111\115\116\114\105\110\103",{}) == nil)
244−assert(to("\116\111\115\116\114\105\110\103","\97\108\111") == "\97\108\111")
245−assert(to("\116\111\115\116\114\105\110\103",12) == "\49\50")
246−assert(to("\116\111\115\116\114\105\110\103",12,3) == nil)
247−assert(to("\111\98\106\115\105\122\101",{}) == 0)
248−assert(to("\111\98\106\115\105\122\101",{1,2,3}) == 3)
249−assert(to("\111\98\106\115\105\122\101","\97\108\111\97") == 6)
250−assert(to("\111\98\106\115\105\122\101",T.newuserdata(0)) == 0)
251−assert(to("\111\98\106\115\105\122\101",T.newuserdata(101)) == 101)
252−assert(to("\111\98\106\115\105\122\101",124) == 0)
253−assert(to("\111\98\106\115\105\122\101",true) == 0)
254−assert(to("\116\111\110\117\109\98\101\114",{}) == 0)
255−assert(to("\116\111\110\117\109\98\101\114","\49\50") == 12)
256−assert(to("\116\111\110\117\109\98\101\114","\115\50") == 0)
257−assert(to("\116\111\110\117\109\98\101\114",1,20) == 0)
258−assert(to("\116\111\112\111\105\110\116\101\114",10) == null)
259−assert(to("\116\111\112\111\105\110\116\101\114",true) == null)
260−assert(to("\116\111\112\111\105\110\116\101\114",nil) == null)
261−assert(to("\116\111\112\111\105\110\116\101\114","\97\98\99") ~= null)
262−assert(to("\116\111\112\111\105\110\116\101\114",string.rep("\120",10)) == to("\116\111\112\111\105\110\116\101\114",string.rep("\120",10)))
263−do
264−local s1 = string.rep("\120",300)
265−local s2 = string.rep("\120",300)
266−assert(to("\116\111\112\111\105\110\116\101\114",s1) ~= to("\116\111\112\111\105\110\116\101\114",s2))
267−end
268−assert(to("\116\111\112\111\105\110\116\101\114",T.pushuserdata(20)) ~= null)
269−assert(to("\116\111\112\111\105\110\116\101\114",io.read) ~= null)
270−assert(to("\116\111\112\111\105\110\116\101\114",hfunc) ~= null)
271−assert(to("\116\111\112\111\105\110\116\101\114",function ()
272−
273−end) ~= null)
274−assert(to("\116\111\112\111\105\110\116\101\114",io.stdin) ~= null)
275−assert(to("\102\117\110\99\50\110\117\109",20) == 0)
276−assert(to("\102\117\110\99\50\110\117\109",T.pushuserdata(10)) == 0)
277−assert(to("\102\117\110\99\50\110\117\109",io.read) ~= 0)
278−assert(to("\102\117\110\99\50\110\117\109",hfunc) ~= 0)
279−a=to("\116\111\99\102\117\110\99\116\105\111\110",math.deg)
280−assert(a(3) == math.deg(3) and a == math.deg)
281−print("\116\101\115\116\105\110\103\32\112\97\110\105\99\32\102\117\110\99\116\105\111\110")
282−do
283−assert(T.checkpanic("\112\117\115\104\115\116\114\105\110\103\32\104\105\59\32\101\114\114\111\114") == "\104\105")
284−assert(T.checkpanic("\112\117\115\104\115\116\114\105\110\103\32\104\105\59\32\101\114\114\111\114\59","\99\104\101\99\107\115\116\97\99\107\32\53\32\88\88\10\32\32\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\39\32\97\108\111\39\10\32\32\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\39\32\109\117\110\100\111\39\10\32\32\32\32\32\32\99\111\110\99\97\116\32\51") == "\104\105\32\97\108\111\32\109\117\110\100\111")
285−assert(T.checkpanic("\108\111\97\100\115\116\114\105\110\103\32\52") == "\98\97\100\32\97\114\103\117\109\101\110\116\32\35\52\32\40\115\116\114\105\110\103\32\101\120\112\101\99\116\101\100\44\32\103\111\116\32\110\111\32\118\97\108\117\101\41")
286−T.totalmem(T.totalmem() + 10000)
287−assert(T.checkpanic("\110\101\119\117\115\101\114\100\97\116\97\32\50\48\48\48\48") == MEMERRMSG)
288−T.totalmem(0)
289−if not _soft then
290−local msg = T.checkpanic("\32\32\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\34\102\117\110\99\116\105\111\110\32\102\40\41\32\102\40\41\32\101\110\100\34\10\32\32\32\32\32\32\108\111\97\100\115\116\114\105\110\103\32\45\49\59\32\99\97\108\108\32\48\32\48\10\32\32\32\32\32\32\103\101\116\103\108\111\98\97\108\32\102\59\32\99\97\108\108\32\48\32\48\10\32\32\32\32")
291−assert(string.find(msg,"\115\116\97\99\107\32\111\118\101\114\102\108\111\119"))
292−end
293−assert(T.checkpanic("\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\34\114\101\116\117\114\110\32\123\95\95\99\108\111\115\101\32\61\32\102\117\110\99\116\105\111\110\32\40\41\32\89\32\61\32\39\104\111\39\59\32\101\110\100\125\34\10\32\32\32\32\110\101\119\116\97\98\108\101\10\32\32\32\32\108\111\97\100\115\116\114\105\110\103\32\45\50\10\32\32\32\32\99\97\108\108\32\48\32\49\10\32\32\32\32\115\101\116\109\101\116\97\116\97\98\108\101\32\45\50\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\10\32\32\32\32\112\117\115\104\115\116\114\105\110\103\32\34\104\105\34\10\32\32\32\32\101\114\114\111\114\10\32\32","\32\32\32\32\103\101\116\103\108\111\98\97\108\32\89\10\32\32\32\32\99\111\110\99\97\116\32\50\32\32\32\32\32\32\32\32\32\35\32\99\111\110\99\97\116\32\111\114\105\103\105\110\97\108\32\101\114\114\111\114\32\119\105\116\104\32\103\108\111\98\97\108\32\89\10\32\32") == "\104\105\104\111")
294−end
295−if not _soft then
296−print("\116\101\115\116\105\110\103\32\115\116\97\99\107\32\111\118\101\114\102\108\111\119")
297−collectgarbage("\115\116\111\112")
298−checkerr("\88\88\88\88",T.testC,"\99\104\101\99\107\115\116\97\99\107\32\49\48\48\48\48\50\51\32\88\88\88\88")
299−checkerr("\94\115\116\97\99\107\32\111\118\101\114\102\108\111\119\36",T.testC,"\99\104\101\99\107\115\116\97\99\107\32\49\48\48\48\48\50\51\32\39\39")
300−local s = string.rep("\112\117\115\104\110\105\108\59\99\104\101\99\107\115\116\97\99\107\32\49\32\88\88\59",1000000)
301−checkerr("\111\118\101\114\102\108\111\119",T.testC,s)
302−collectgarbage("\114\101\115\116\97\114\116")
303−print("\43")
304−end
305−local lim = _soft and 500 or 12000
306−local prog = {"\99\104\101\99\107\115\116\97\99\107\32" .. (lim * 2 + 100) .. "\109\115\103","\110\101\119\116\97\98\108\101"}
307−for i = 1, lim
308−do
309−prog[# prog + 1]="\112\117\115\104\110\117\109\32" .. i
310−prog[# prog + 1]="\112\117\115\104\110\117\109\32" .. i * 10
311−end
312−prog[# prog + 1]="\114\97\119\103\101\116\105\32\82\32\50"
313−prog[# prog + 1]="\105\110\115\101\114\116\32" .. - (2 * lim + 2)
314−for i = 1, lim
315−do
316−prog[# prog + 1]="\115\101\116\116\97\98\108\101\32" .. - (2 * (lim - i + 1) + 1)
317−end
318−prog[# prog + 1]="\114\101\116\117\114\110\32\50"
319−prog=table.concat(prog,"\59")
320−local g,t = T.testC(prog)
321−assert(g == _G)
322−for i = 1, lim
323−do
324−assert(t[i] == i * 10)
325−;
326−t[i]=undef
327−end
328−assert(next(t) == nil)
329−prog,g,t=nil
330−a=T.testC("\32\32\108\111\97\100\115\116\114\105\110\103\32\50\59\32\112\99\97\108\108\32\48\32\49\32\48\59\10\32\32\112\117\115\104\118\97\108\117\101\32\51\59\32\105\110\115\101\114\116\32\45\50\59\32\112\99\97\108\108\32\49\32\49\32\48\59\10\32\32\112\99\97\108\108\32\48\32\48\32\48\59\10\32\32\114\101\116\117\114\110\32\49\10","\88\88\61\49\53\48",function (a)
331−assert(a == nil)
332−;
333−return 3
334−end)
335−assert(type(a) == "\115\116\114\105\110\103" and XX == 150)
336−_G.XX=nil
337−local function check3
338−(p, ...)
339−local arg = {...}
340−assert(# arg == 3)
341−assert(string.find(arg[3],p))
342−end
343−check3("\58\49\58",T.testC("\108\111\97\100\115\116\114\105\110\103\32\50\59\32\114\101\116\117\114\110\32\42","\120\61"))
344−check3("\37\46",T.testC("\108\111\97\100\102\105\108\101\32\50\59\32\114\101\116\117\114\110\32\42","\46"))
345−check3("\120\120\120\120",T.testC("\108\111\97\100\102\105\108\101\32\50\59\32\114\101\116\117\114\110\32\42","\120\120\120\120"))
346−local function checkerrnopro
347−(code,msg)
348−local th = coroutine.create(function ()
349−
350−end)
351−local stt,err = pcall(T.testC,th,code)
352−assert(not stt and string.find(err,msg))
353−end
354−if not _soft then
355−collectgarbage("\115\116\111\112")
356−checkerrnopro("\112\117\115\104\110\117\109\32\51\59\32\99\97\108\108\32\48\32\48","\97\116\116\101\109\112\116\32\116\111\32\99\97\108\108")
357−print("\116\101\115\116\105\110\103\32\115\116\97\99\107\32\111\118\101\114\102\108\111\119\32\105\110\32\117\110\112\114\111\116\101\99\116\101\100\32\116\104\114\101\97\100")
358−function F()
359−F()
360−end
361−checkerrnopro("\103\101\116\103\108\111\98\97\108\32\39\70\39\59\32\99\97\108\108\32\48\32\48\59","\115\116\97\99\107\32\111\118\101\114\102\108\111\119")
362−F=nil
363−collectgarbage("\114\101\115\116\97\114\116")
364−end
365−print("\43")
366−do
367−local a = {}
368−local a1 = T.testC("\114\97\119\115\101\116\112\32\50\32\49\59\32\114\101\116\117\114\110\32\49",a,20)
369−assert(a == a1)
370−assert(a[T.pushuserdata(1)] == 20)
371−local a1,res = T.testC("\114\97\119\103\101\116\112\32\45\49\32\49\59\32\114\101\116\117\114\110\32\50",a)
372−assert(a == a1 and res == 20)
373−end
374−do
375−local a = {}
376−a[a]=10
377−local prog = "\103\101\116\116\97\98\108\101\32\45\49\59\32\114\101\116\117\114\110\32\42"
378−local res = {T.testC(prog,a)}
379−assert(# res == 2 and res[1] == prog and res[2] == 10)
380−local prog = "\115\101\116\116\97\98\108\101\32\45\50\59\32\114\101\116\117\114\110\32\42"
381−local res = {T.testC(prog,a,20)}
382−assert(a[a] == 20)
383−assert(# res == 1 and res[1] == prog)
384−a[a]=10
385−local prog = "\114\97\119\103\101\116\32\45\49\59\32\114\101\116\117\114\110\32\42"
386−local res = {T.testC(prog,a)}
387−assert(# res == 2 and res[1] == prog and res[2] == 10)
388−local prog = "\114\97\119\115\101\116\32\45\50\59\32\114\101\116\117\114\110\32\42"
389−local res = {T.testC(prog,a,20)}
390−assert(a[a] == 20)
391−assert(# res == 1 and res[1] == prog)
392−local prog = "\114\97\119\115\101\116\32\45\49\59\32\114\101\116\117\114\110\32\42"
393−local res = {T.testC(prog,30,a)}
394−assert(a[30] == a)
395−assert(# res == 1 and res[1] == prog)
396−local prog = "\115\101\116\116\97\98\108\101\32\45\49\59\32\114\101\116\117\114\110\32\42"
397−local res = {T.testC(prog,40,a)}
398−assert(a[40] == a)
399−assert(# res == 1 and res[1] == prog)
400−local prog = "\114\97\119\115\101\116\105\32\45\49\32\49\48\48\59\32\114\101\116\117\114\110\32\42"
401−local res = {T.testC(prog,a)}
402−assert(a[100] == a)
403−assert(# res == 1 and res[1] == prog)
404−local prog = "\115\101\116\105\32\45\49\32\50\48\48\59\32\114\101\116\117\114\110\32\42"
405−local res = {T.testC(prog,a)}
406−assert(a[200] == a)
407−assert(# res == 1 and res[1] == prog)
408−end
409−a={["\120"] = 0,["\121"] = 12}
410−x,y=T.testC("\103\101\116\116\97\98\108\101\32\50\59\32\112\117\115\104\118\97\108\117\101\32\52\59\32\103\101\116\116\97\98\108\101\32\50\59\32\114\101\116\117\114\110\32\50",a,3,"\121",4,"\120")
411−assert(x == 0 and y == 12)
412−T.testC("\115\101\116\116\97\98\108\101\32\45\53",a,3,4,"\120",15)
413−assert(a.x == 15)
414−a[a]=print
415−x=T.testC("\103\101\116\116\97\98\108\101\32\50\59\32\114\101\116\117\114\110\32\49",a)
416−assert(x == print)
417−T.testC("\115\101\116\116\97\98\108\101\32\50",a,"\120")
418−assert(a[a] == "\120")
419−b=setmetatable({["\112"] = a},{})
420−getmetatable(b).__index=function (t,i)
421−return t.p[i]
422−end
423−local k,x = T.testC("\103\101\116\116\97\98\108\101\32\51\44\32\114\101\116\117\114\110\32\50",4,b,20,35,"\120")
424−assert(x == 15 and k == 35)
425−k=T.testC("\103\101\116\102\105\101\108\100\32\50\32\121\44\32\114\101\116\117\114\110\32\49",b)
426−assert(k == 12)
427−getmetatable(b).__index=function (t,i)
428−return a[i]
429−end
430−getmetatable(b).__newindex=function (t,i,v)
431−a[i]=v
432−end
433−y=T.testC("\105\110\115\101\114\116\32\50\59\32\103\101\116\116\97\98\108\101\32\45\53\59\32\114\101\116\117\114\110\32\49",2,3,4,"\121",b)
434−assert(y == 12)
435−k=T.testC("\115\101\116\116\97\98\108\101\32\45\53\44\32\114\101\116\117\114\110\32\49",b,3,4,"\120",16)
436−assert(a.x == 16 and k == 4)
437−a[b]="\120\117\120\117"
438−y=T.testC("\103\101\116\116\97\98\108\101\32\50\44\32\114\101\116\117\114\110\32\49",b)
439−assert(y == "\120\117\120\117")
440−T.testC("\115\101\116\116\97\98\108\101\32\50",b,19)
441−assert(a[b] == 19)
442−do
443−local t = {["\95\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57"] = 32}
444−local a = T.testC("\32\32\32\32\103\101\116\102\105\101\108\100\32\50\32\95\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\10\32\32\32\32\114\101\116\117\114\110\32\49\10\32\32",t)
445−assert(a == 32)
446−local a = T.testC("\32\32\32\32\112\117\115\104\110\117\109\32\51\51\10\32\32\32\32\115\101\116\103\108\111\98\97\108\32\95\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\10\32\32")
447−assert(_012345678901234567890123456789012345678901234567890123456789 == 33)
448−_012345678901234567890123456789012345678901234567890123456789=nil
449−end
450−a={}
451−t=pack(T.testC("\110\101\120\116\59\32\114\101\116\117\114\110\32\42",a,nil))
452−tcheck(t,{["\110"] = 1,a})
453−a={["\97"] = 3}
454−t=pack(T.testC("\110\101\120\116\59\32\114\101\116\117\114\110\32\42",a,nil))
455−tcheck(t,{["\110"] = 3,a,"\97",3})
456−t=pack(T.testC("\110\101\120\116\59\32\112\111\112\32\49\59\32\110\101\120\116\59\32\114\101\116\117\114\110\32\42",a,nil))
457−tcheck(t,{["\110"] = 1,a})
458−do
459−local A = T.testC("\32\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\50\48\59\32\112\117\115\104\99\99\108\111\115\117\114\101\32\50\59\32\114\101\116\117\114\110\32\49")
460−t,b,c=A("\112\117\115\104\118\97\108\117\101\32\85\48\59\32\112\117\115\104\118\97\108\117\101\32\85\49\59\32\112\117\115\104\118\97\108\117\101\32\85\50\59\32\114\101\116\117\114\110\32\51")
461−assert(b == 10 and c == 20 and type(t) == "\116\97\98\108\101")
462−a,b=A("\116\111\115\116\114\105\110\103\32\85\51\59\32\116\111\110\117\109\98\101\114\32\85\52\59\32\114\101\116\117\114\110\32\50")
463−assert(a == nil and b == 0)
464−A("\112\117\115\104\110\117\109\32\49\48\48\59\32\112\117\115\104\110\117\109\32\50\48\48\59\32\114\101\112\108\97\99\101\32\85\50\59\32\114\101\112\108\97\99\101\32\85\49")
465−b,c=A("\112\117\115\104\118\97\108\117\101\32\85\49\59\32\112\117\115\104\118\97\108\117\101\32\85\50\59\32\114\101\116\117\114\110\32\50")
466−assert(b == 100 and c == 200)
467−A("\114\101\112\108\97\99\101\32\85\50\59\32\114\101\112\108\97\99\101\32\85\49",{["\120"] = 1},{["\120"] = 2})
468−b,c=A("\112\117\115\104\118\97\108\117\101\32\85\49\59\32\112\117\115\104\118\97\108\117\101\32\85\50\59\32\114\101\116\117\114\110\32\50")
469−assert(b.x == 1 and c.x == 2)
470−T.checkmemory()
471−end
472−assert(T.testC("\105\115\110\117\108\108\32\85\49\59\32\114\101\116\117\114\110\32\49") == true)
473−assert(T.testC("\105\115\110\117\108\108\32\85\49\48\48\59\32\114\101\116\117\114\110\32\49") == true)
474−assert(T.testC("\112\117\115\104\118\97\108\117\101\32\85\49\59\32\114\101\116\117\114\110\32\49") == nil)
475−local f = T.testC("\32\112\117\115\104\110\117\109\32\49\48\59\32\112\117\115\104\110\117\109\32\50\48\59\32\112\117\115\104\99\99\108\111\115\117\114\101\32\50\59\32\114\101\116\117\114\110\32\49")
476−assert(T.upvalue(f,1) == 10 and T.upvalue(f,2) == 20 and T.upvalue(f,3) == nil)
477−T.upvalue(f,2,"\120\117\120\117")
478−assert(T.upvalue(f,2) == "\120\117\120\117")
479−do
480−local A = "\99\104\101\99\107\115\116\97\99\107\32\51\48\48\32\109\115\103\59" .. string.rep("\112\117\115\104\110\117\109\32\49\48\59",255) .. "\112\117\115\104\99\99\108\111\115\117\114\101\32\50\53\53\59\32\114\101\116\117\114\110\32\49"
481−A=T.testC(A)
482−for i = 1, 255
483−do
484−assert(A(("\112\117\115\104\118\97\108\117\101\32\85\37\100\59\32\114\101\116\117\114\110\32\49"):format(i)) == 10)
485−end
486−assert(A("\105\115\110\117\108\108\32\85\50\53\54\59\32\114\101\116\117\114\110\32\49"))
487−assert(not A("\105\115\110\105\108\32\85\50\53\54\59\32\114\101\116\117\114\110\32\49"))
488−end
489−checkerr("\103\111\116\32\110\117\109\98\101\114",debug.setuservalue,3,{})
490−checkerr("\103\111\116\32\110\105\108",debug.setuservalue,nil,{})
491−checkerr("\103\111\116\32\108\105\103\104\116\32\117\115\101\114\100\97\116\97",debug.setuservalue,T.pushuserdata(1),{})
492−local b = T.newuserdata(0,10)
493−for i = 1, 10
494−do
495−local v,p = debug.getuservalue(b,i)
496−assert(v == nil and p)
497−end
498−do
499−local v,p = debug.getuservalue(b,- 2)
500−assert(v == nil and not p)
501−local v,p = debug.getuservalue(b,11)
502−assert(v == nil and not p)
503−end
504−local t = {true,false,4.56,print,{},b,"\88\89\90"}
505−for k,v in ipairs(t)
506−do
507−debug.setuservalue(b,v,k)
508−end
509−for k,v in ipairs(t)
510−do
511−local v1,p = debug.getuservalue(b,k)
512−assert(v1 == v and p)
513−end
514−assert(not debug.getuservalue(4))
515−debug.setuservalue(b,function ()
516−return 10
517−end,10)
518−collectgarbage()
519−assert(debug.getuservalue(b,10)() == 10)
520−debug.setuservalue(b,134)
521−collectgarbage()
522−assert(debug.getuservalue(b) == 134)
523−do
524−local oldmode = collectgarbage("\105\110\99\114\101\109\101\110\116\97\108")
525−T.gcstate("\97\116\111\109\105\99")
526−assert(T.gccolor(b) == "\98\108\97\99\107")
527−debug.setuservalue(b,{["\120"] = 100})
528−T.gcstate("\112\97\117\115\101")
529−assert(debug.getuservalue(b).x == 100)
530−collectgarbage(oldmode)
531−end
532−for i = 1, 1000
533−do
534−local bb = T.newuserdata(0,1)
535−debug.setuservalue(bb,b)
536−b=bb
537−end
538−collectgarbage()
539−for i = 1, 1000
540−do
541−b=debug.getuservalue(b)
542−end
543−assert(debug.getuservalue(b).x == 100)
544−b=nil
545−local i = T.ref({})
546−T.unref(i)
547−assert(T.ref({}) == i)
548−local Arr = {}
549−local Lim = 100
550−for i = 1, Lim
551−do
552−Arr[i]=T.ref({})
553−end
554−assert(T.ref(nil) == - 1 and T.getref(- 1) == nil)
555−T.unref(- 1)
556−;
557−T.unref(- 1)
558−for i = 1, Lim
559−do
560−T.unref(Arr[i])
561−end
562−local function printlocks
563−()
564−local f = T.makeCfunc("\103\101\116\116\97\98\108\101\32\82\59\32\114\101\116\117\114\110\32\49")
565−local n = f("\110")
566−print("\110",n)
567−for i = 0, n
568−do
569−print(i,f(i))
570−end
571−end
572−for i = 1, Lim
573−do
574−Arr[i]=T.ref({})
575−end
576−for i = 1, Lim, 2
577−do
578−T.unref(Arr[i])
579−end
580−assert(type(T.getref(Arr[2])) == "\116\97\98\108\101")
581−assert(T.getref(- 1) == nil)
582−a=T.ref({})
583−collectgarbage()
584−assert(type(T.getref(a)) == "\116\97\98\108\101")
585−local tt = {}
586−local cl = {["\110"] = 0}
587−A=nil
588−;
589−B=nil
590−local F
591−F=function (x)
592−local udval = T.udataval(x)
593−table.insert(cl,udval)
594−local d = T.newuserdata(100)
595−d=nil
596−assert(debug.getmetatable(x).__gc == F)
597−assert(load("\116\97\98\108\101\46\105\110\115\101\114\116\40\123\125\44\32\123\125\41"))()
598−assert(not collectgarbage())
599−local dummy = {}
600−if A ~= nil then
601−assert(type(A) == "\117\115\101\114\100\97\116\97")
602−assert(T.udataval(A) == B)
603−debug.getmetatable(A)
604−end
605−A=x
606−B=udval
607−return 1,2,3
608−end
609−tt.__gc=F
610−do
611−collectgarbage()
612−;
613−collectgarbage()
614−;
615−local x = collectgarbage("\99\111\117\110\116")
616−;
617−local a = T.newuserdata(5001)
618−assert(T.testC("\111\98\106\115\105\122\101\32\50\59\32\114\101\116\117\114\110\32\49",a) == 5001)
619−assert(collectgarbage("\99\111\117\110\116") >= x + 4)
620−a=nil
621−collectgarbage()
622−;
623−assert(collectgarbage("\99\111\117\110\116") <= x + 1)
624−x=collectgarbage("\99\111\117\110\116")
625−collectgarbage("\115\116\111\112")
626−for i = 1, 1000
627−do
628−T.newuserdata(0)
629−end
630−assert(collectgarbage("\99\111\117\110\116") > x + 10)
631−collectgarbage()
632−assert(collectgarbage("\99\111\117\110\116") <= x + 1)
633−collectgarbage()
634−x=collectgarbage("\99\111\117\110\116")
635−collectgarbage("\115\116\111\112")
636−a={["\95\95\103\99"] = function ()
637−
638−end}
639−for i = 1, 1000
640−do
641−debug.setmetatable(T.newuserdata(0),a)
642−end
643−assert(collectgarbage("\99\111\117\110\116") >= x + 10)
644−collectgarbage()
645−assert(collectgarbage("\99\111\117\110\116") >= x + 10)
646−collectgarbage()
647−assert(collectgarbage("\99\111\117\110\116") <= x + 1)
648−collectgarbage("\114\101\115\116\97\114\116")
649−end
650−collectgarbage("\115\116\111\112")
651−a=T.newuserdata(0)
652−;
653−debug.setmetatable(a,tt)
654−;
655−local na = T.udataval(a)
656−b=T.newuserdata(0)
657−;
658−debug.setmetatable(b,tt)
659−;
660−local nb = T.udataval(b)
661−c=T.newuserdata(0)
662−;
663−debug.setmetatable(c,tt)
664−;
665−local nc = T.udataval(c)
666−x=T.newuserdata(4)
667−y=T.newuserdata(0)
668−checkerr("\70\73\76\69\37\42\32\101\120\112\101\99\116\101\100\44\32\103\111\116\32\117\115\101\114\100\97\116\97",io.input,a)
669−checkerr("\70\73\76\69\37\42\32\101\120\112\101\99\116\101\100\44\32\103\111\116\32\117\115\101\114\100\97\116\97",io.input,x)
670−assert(debug.getmetatable(x) == nil and debug.getmetatable(y) == nil)
671−local d = T.ref(a)
672−;
673−local e = T.ref(b)
674−;
675−local f = T.ref(c)
676−;
677−t={T.getref(d),T.getref(e),T.getref(f)}
678−assert(t[1] == a and t[2] == b and t[3] == c)
679−t=nil
680−;
681−a=nil
682−;
683−c=nil
684−;
685−T.unref(e)
686−;
687−T.unref(f)
688−collectgarbage()
689−assert(# cl == 1 and cl[1] == nc)
690−x=T.getref(d)
691−assert(type(x) == "\117\115\101\114\100\97\116\97" and debug.getmetatable(x) == tt)
692−x=nil
693−tt.b=b
694−tt=nil
695−A=nil
696−b=nil
697−T.unref(d)
698−;
699−local n5 = T.newuserdata(0)
700−debug.setmetatable(n5,{["\95\95\103\99"] = F})
701−n5=T.udataval(n5)
702−collectgarbage()
703−assert(# cl == 4)
704−assert(cl[2] == n5 and cl[3] == nb and cl[4] == na)
705−collectgarbage("\114\101\115\116\97\114\116")
706−a,na={},{}
707−for i = 30, 1, - 1
708−do
709−a[i]=T.newuserdata(0)
710−debug.setmetatable(a[i],{["\95\95\103\99"] = F})
711−na[i]=T.udataval(a[i])
712−end
713−cl={}
714−a=nil
715−;
716−collectgarbage()
717−assert(# cl == 30)
718−for i = 1, 30
719−do
720−assert(cl[i] == na[i])
721−end
722−na=nil
723−for i = 2, Lim, 2
724−do
725−T.unref(Arr[i])
726−end
727−x=T.newuserdata(41)
728−;
729−debug.setmetatable(x,{["\95\95\103\99"] = F})
730−assert(T.testC("\111\98\106\115\105\122\101\32\50\59\32\114\101\116\117\114\110\32\49",x) == 41)
731−cl={}
732−a={[x] = 1}
733−x=T.udataval(x)
734−collectgarbage()
735−assert(# cl == 0)
736−for n in pairs(a)
737−do
738−a[n]=undef
739−end
740−collectgarbage()
741−assert(# cl == 1 and cl[1] == x)
742−assert(T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\52\59\32\114\101\116\117\114\110\32\49",print,1,print,20))
743−assert(T.testC("\99\111\109\112\97\114\101\32\69\81\32\51\32\50\59\32\114\101\116\117\114\110\32\49","\97\108\111","\97\108\111"))
744−assert(T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49",nil,nil))
745−assert(not T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49",{},{}))
746−assert(not T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49"))
747−assert(not T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49",3))
748−do
749−local map = {}
750−local t = {["\95\95\101\113"] = function (a,b)
751−return map[a] == map[b]
752−end}
753−local function f
754−(x)
755−local u = T.newuserdata(0)
756−debug.setmetatable(u,t)
757−map[u]=x
758−return u
759−end
760−assert(f(10) == f(10))
761−assert(f(10) ~= f(11))
762−assert(T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49",f(10),f(10)))
763−assert(not T.testC("\99\111\109\112\97\114\101\32\69\81\32\50\32\51\59\32\114\101\116\117\114\110\32\49",f(10),f(20)))
764−t.__eq=nil
765−assert(f(10) ~= f(10))
766−end
767−print("\43")
768−_G.TT={}
769−T.sethook("\32\32\35\32\115\101\116\32\97\32\108\105\110\101\32\104\111\111\107\32\97\102\116\101\114\32\51\32\99\111\117\110\116\32\104\111\111\107\115\10\32\32\115\101\116\104\111\111\107\32\52\32\48\32\39\10\32\32\32\32\103\101\116\103\108\111\98\97\108\32\84\84\59\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\45\51\59\32\97\112\112\101\110\100\32\45\50\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\45\50\59\32\97\112\112\101\110\100\32\45\50\10\32\32\39","\99",3)
770−local a = 1
771−a=1
772−a=1
773−a=1
774−a=1
775−debug.sethook()
776−local t = _G.TT
777−assert(t[1] == "\108\105\110\101")
778−local line = t[2]
779−assert(t[3] == "\108\105\110\101" and t[4] == line + 1)
780−assert(t[5] == "\108\105\110\101" and t[6] == line + 2)
781−assert(t[7] == nil)
782−_G.TT=nil
783−do
784−warn("\64\111\102\102")
785−collectgarbage("\115\116\111\112")
786−local a = {}
787−for i = 1, 20
788−do
789−a[i]=T.newuserdata(i)
790−end
791−for i = 1, 20, 2
792−do
793−debug.setmetatable(a[i],{["\95\95\103\99"] = function (x)
794−error("\64\101\120\112\101\99\116\101\100\32\101\114\114\111\114\32\105\110\32\103\99")
795−end})
796−end
797−for i = 2, 20, 2
798−do
799−debug.setmetatable(a[i],{["\95\95\103\99"] = function (x)
800−load("\65\61\65\43\49")()
801−end})
802−end
803−a=nil
804−_G.A=0
805−collectgarbage()
806−assert(A == 10)
807−collectgarbage("\114\101\115\116\97\114\116")
808−warn("\64\111\110")
809−end
810−_G.A=nil
811−do
812−local a = {}
813−;
814−local lim = 30
815−for i = 0, lim
816−do
817−a[i]=T.pushuserdata(i)
818−end
819−for i = 0, lim
820−do
821−assert(T.udataval(a[i]) == i)
822−end
823−for i = 0, lim
824−do
825−assert(T.pushuserdata(i) == a[i])
826−end
827−for i = 0, lim
828−do
829−a[a[i]]=i
830−end
831−for i = 0, lim
832−do
833−a[T.pushuserdata(i)]=i
834−end
835−assert(type(tostring(a[1])) == "\115\116\114\105\110\103")
836−end
837−T.closestate(T.newstate())
838−;
839−L1=T.newstate()
840−assert(L1)
841−assert(T.doremote(L1,"\88\61\39\97\39\59\32\114\101\116\117\114\110\32\39\97\39") == "\97")
842−assert(# pack(T.doremote(L1,"\102\117\110\99\116\105\111\110\32\102\32\40\41\32\114\101\116\117\114\110\32\39\97\108\111\39\44\32\51\32\101\110\100\59\32\102\40\41")) == 0)
843−a,b=T.doremote(L1,"\114\101\116\117\114\110\32\102\40\41")
844−assert(a == "\97\108\111" and b == "\51")
845−T.doremote(L1,"\95\69\82\82\79\82\77\69\83\83\65\71\69\32\61\32\110\105\108")
846−a,b,c=T.doremote(L1,"\114\101\116\117\114\110\32\115\105\110\40\49\41")
847−assert(a == nil and c == 2)
848−a,b,c=T.doremote(L1,"\114\101\116\117\114\110\32\97\43")
849−assert(a == nil and c == 3 and type(b) == "\115\116\114\105\110\103")
850−T.loadlib(L1)
851−a,b,c=T.doremote(L1,"\32\32\115\116\114\105\110\103\32\61\32\114\101\113\117\105\114\101\39\115\116\114\105\110\103\39\10\32\32\97\32\61\32\114\101\113\117\105\114\101\39\95\71\39\59\32\97\115\115\101\114\116\40\97\32\61\61\32\95\71\32\97\110\100\32\114\101\113\117\105\114\101\40\34\95\71\34\41\32\61\61\32\97\41\10\32\32\105\111\32\61\32\114\101\113\117\105\114\101\39\105\111\39\59\32\97\115\115\101\114\116\40\116\121\112\101\40\105\111\46\114\101\97\100\41\32\61\61\32\34\102\117\110\99\116\105\111\110\34\41\10\32\32\97\115\115\101\114\116\40\114\101\113\117\105\114\101\40\34\105\111\34\41\32\61\61\32\105\111\41\10\32\32\97\32\61\32\114\101\113\117\105\114\101\39\116\97\98\108\101\39\59\32\97\115\115\101\114\116\40\116\121\112\101\40\97\46\105\110\115\101\114\116\41\32\61\61\32\34\102\117\110\99\116\105\111\110\34\41\10\32\32\97\32\61\32\114\101\113\117\105\114\101\39\100\101\98\117\103\39\59\32\97\115\115\101\114\116\40\116\121\112\101\40\97\46\103\101\116\108\111\99\97\108\41\32\61\61\32\34\102\117\110\99\116\105\111\110\34\41\10\32\32\97\32\61\32\114\101\113\117\105\114\101\39\109\97\116\104\39\59\32\97\115\115\101\114\116\40\116\121\112\101\40\97\46\115\105\110\41\32\61\61\32\34\102\117\110\99\116\105\111\110\34\41\10\32\32\114\101\116\117\114\110\32\115\116\114\105\110\103\46\115\117\98\40\39\111\107\105\110\97\109\97\39\44\32\49\44\32\50\41\10")
852−assert(a == "\111\107")
853−T.closestate(L1)
854−;
855−L1=T.newstate()
856−T.loadlib(L1)
857−T.doremote(L1,"\97\32\61\32\123\125")
858−T.testC(L1,"\103\101\116\103\108\111\98\97\108\32\34\97\34\59\32\112\117\115\104\115\116\114\105\110\103\32\34\120\34\59\32\112\117\115\104\105\110\116\32\49\59\10\32\32\32\32\32\32\32\32\32\32\32\32\32\115\101\116\116\97\98\108\101\32\45\51")
859−assert(T.doremote(L1,"\114\101\116\117\114\110\32\97\46\120") == "\49")
860−T.closestate(L1)
861−L1=nil
862−print("\43")
863−print("\116\101\115\116\105\110\103\32\116\111\45\98\101\45\99\108\111\115\101\100\32\118\97\114\105\97\98\108\101\115")
864−do
865−local openresource = {}
866−local function newresource
867−()
868−local x = setmetatable({10},{["\95\95\99\108\111\115\101"] = function (y)
869−assert(openresource[# openresource] == y)
870−openresource[# openresource]=nil
871−y[1]=y[1] + 1
872−end})
873−openresource[# openresource + 1]=x
874−return x
875−end
876−local a,b = T.testC("\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\114\101\115\111\117\114\99\101\10\32\32\32\32\112\117\115\104\110\105\108\10\32\32\32\32\116\111\99\108\111\115\101\32\45\50\32\32\35\32\109\97\114\107\32\99\97\108\108\32\114\101\115\117\108\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\32\35\32\109\97\114\107\32\110\105\108\32\116\111\32\98\101\32\99\108\111\115\101\100\32\40\119\105\108\108\32\98\101\32\105\103\110\111\114\101\100\41\10\32\32\32\32\114\101\116\117\114\110\32\50\10\32\32",newresource)
877−assert(a[1] == 11 and b == nil)
878−assert(# openresource == 0)
879−local a = {T.testC("\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\114\101\115\111\117\114\99\101\10\32\32\32\32\116\111\99\108\111\115\101\32\50\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\114\101\116\117\114\110\32\50\10\32\32",newresource)}
880−assert(type(a[1]) == "\115\116\114\105\110\103" and a[2][1] == 11)
881−assert(# openresource == 0)
882−local a,b = pcall(T.makeCfunc("\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\114\101\115\111\117\114\99\101\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\101\114\114\111\114\32\32\32\32\32\32\32\35\32\114\101\115\111\117\114\99\101\32\105\115\32\116\104\101\32\101\114\114\111\114\32\111\98\106\101\99\116\10\32\32"),newresource)
883−assert(a == false and b[1] == 11)
884−assert(# openresource == 0)
885−local a,b = pcall(T.makeCfunc("\32\32\32\32\110\101\119\116\97\98\108\101\32\32\32\35\32\99\114\101\97\116\101\32\110\111\110\45\99\108\111\115\97\98\108\101\32\111\98\106\101\99\116\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\32\40\115\104\111\117\108\100\32\114\97\105\115\101\32\97\110\32\101\114\114\111\114\41\10\32\32\32\32\97\98\111\114\116\32\32\35\32\119\105\108\108\32\110\111\116\32\98\101\32\101\120\101\99\117\116\101\100\10\32\32"))
886−assert(a == false and string.find(b,"\110\111\110\37\45\99\108\111\115\97\98\108\101\32\118\97\108\117\101"))
887−local function check
888−(n)
889−assert(# openresource == n)
890−end
891−_ENV.xxx=true
892−local a = T.testC("\32\32\32\32\112\117\115\104\118\97\108\117\101\32\50\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\78\82\10\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\114\101\115\111\117\114\99\101\59\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\50\32\32\35\32\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\78\82\10\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\97\110\111\116\104\101\114\32\114\101\115\111\117\114\99\101\59\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\51\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\50\32\32\32\35\32\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\116\119\111\32\111\112\101\110\32\114\101\115\111\117\114\99\101\115\10\32\32\32\32\99\97\108\108\32\49\32\48\32\32\35\32\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\10\32\32\32\32\99\108\111\115\101\115\108\111\116\32\45\49\32\32\32\35\32\99\108\111\115\101\32\115\101\99\111\110\100\32\114\101\115\111\117\114\99\101\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\51\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\49\32\32\32\35\32\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\111\110\101\32\111\112\101\110\32\114\101\115\111\117\114\99\101\10\32\32\32\32\99\97\108\108\32\49\32\48\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\10\32\32\32\32\99\108\111\115\101\115\108\111\116\32\52\10\32\32\32\32\115\101\116\103\108\111\98\97\108\32\34\120\120\120\34\32\32\35\32\112\114\101\118\105\111\117\115\32\111\112\46\32\101\114\97\115\101\100\32\116\104\101\32\115\108\111\116\10\32\32\32\32\112\111\112\32\49\32\32\32\32\32\32\32\35\32\112\111\112\32\111\116\104\101\114\32\114\101\115\111\117\114\99\101\32\102\114\111\109\32\116\104\101\32\115\116\97\99\107\10\32\32\32\32\112\117\115\104\105\110\116\32\42\10\32\32\32\32\114\101\116\117\114\110\32\49\32\32\32\32\35\32\114\101\116\117\114\110\32\115\116\97\99\107\32\115\105\122\101\10\32\32",newresource,check)
893−assert(a == 3 and _ENV.xxx == nil)
894−local a = T.testC("\32\32\32\32\112\117\115\104\118\97\108\117\101\32\50\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\78\82\10\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\114\101\115\111\117\114\99\101\59\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\50\32\32\35\32\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\78\82\10\32\32\32\32\99\97\108\108\32\48\32\49\32\32\32\35\32\99\114\101\97\116\101\32\97\110\111\116\104\101\114\32\114\101\115\111\117\114\99\101\59\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\32\35\32\109\97\114\107\32\105\116\32\116\111\32\98\101\32\99\108\111\115\101\100\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\51\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\50\32\32\32\35\32\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\116\119\111\32\111\112\101\110\32\114\101\115\111\117\114\99\101\115\10\32\32\32\32\99\97\108\108\32\49\32\48\32\32\35\32\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\82\10\32\32\32\32\112\111\112\32\49\32\32\32\35\32\112\111\112\32\115\101\99\111\110\100\32\114\101\115\111\117\114\99\101\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\51\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\49\32\32\32\35\32\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\111\110\101\32\111\112\101\110\32\114\101\115\111\117\114\99\101\10\32\32\32\32\99\97\108\108\32\49\32\48\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\82\10\32\32\32\32\112\111\112\32\49\32\32\32\32\32\32\32\35\32\112\111\112\32\111\116\104\101\114\32\114\101\115\111\117\114\99\101\32\102\114\111\109\32\116\104\101\32\115\116\97\99\107\10\32\32\32\32\112\117\115\104\118\97\108\117\101\32\51\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\48\32\32\32\35\32\116\104\101\114\101\32\115\104\111\117\108\100\32\98\101\32\110\111\32\111\112\101\110\32\114\101\115\111\117\114\99\101\115\10\32\32\32\32\99\97\108\108\32\49\32\48\32\32\35\32\115\116\97\99\107\58\32\83\44\32\78\82\44\32\67\72\10\32\32\32\32\112\117\115\104\105\110\116\32\42\10\32\32\32\32\114\101\116\117\114\110\32\49\32\32\32\32\35\32\114\101\116\117\114\110\32\115\116\97\99\107\32\115\105\122\101\10\32\32",newresource,check)
895−assert(a == 3)
896−local a,b = pcall(T.makeCfunc("\32\32\32\32\112\117\115\104\105\110\116\32\51\50\10\32\32\32\32\116\111\99\108\111\115\101\32\45\49\10\32\32"))
897−assert(not a and string.find(b,"\40\67\32\116\101\109\112\111\114\97\114\121\41"))
898−end
899−print("\109\101\109\111\114\121\45\97\108\108\111\99\97\116\105\111\110\32\101\114\114\111\114\115")
900−checkerr("\98\108\111\99\107\32\116\111\111\32\98\105\103",T.newuserdata,math.maxinteger)
901−collectgarbage()
902−local f = load("\108\111\99\97\108\32\97\61\123\125\59\32\102\111\114\32\105\61\49\44\49\48\48\48\48\48\32\100\111\32\97\91\105\93\61\105\32\101\110\100")
903−T.alloccount(10)
904−checkerr(MEMERRMSG,f)
905−T.alloccount()
906−local function testbytes
907−(s,f)
908−collectgarbage()
909−local M = T.totalmem()
910−local oldM = M
911−local a,b = nil
912−while true do
913−collectgarbage()
914−;
915−collectgarbage()
916−T.totalmem(M)
917−a,b=T.testC("\112\99\97\108\108\32\48\32\49\32\48\59\32\112\117\115\104\115\116\97\116\117\115\59\32\114\101\116\117\114\110\32\50",f)
918−T.totalmem(0)
919−if a and b == "\79\75" then
920−break
921−end
922−if b ~= "\79\75" and b ~= MEMERRMSG then
923−error(a,0)
924−end
925−M=M + 7
926−end
927−print(string.format("\109\105\110\105\109\117\109\32\109\101\109\111\114\121\32\102\111\114\32\37\115\58\32\37\100\32\98\121\116\101\115",s,M - oldM))
928−return a
929−end
930−local function testalloc
931−(s,f)
932−collectgarbage()
933−local M = 0
934−local a,b = nil
935−while true do
936−collectgarbage()
937−;
938−collectgarbage()
939−T.alloccount(M)
940−a,b=T.testC("\112\99\97\108\108\32\48\32\49\32\48\59\32\112\117\115\104\115\116\97\116\117\115\59\32\114\101\116\117\114\110\32\50",f)
941−T.alloccount()
942−if a and b == "\79\75" then
943−break
944−end
945−if b ~= "\79\75" and b ~= MEMERRMSG then
946−error(a,0)
947−end
948−M=M + 1
949−end
950−print(string.format("\109\105\110\105\109\117\109\32\97\108\108\111\99\97\116\105\111\110\115\32\102\111\114\32\37\115\58\32\37\100\32\97\108\108\111\99\97\116\105\111\110\115",s,M))
951−return a
952−end
953−local function testamem
954−(s,f)
955−testalloc(s,f)
956−return testbytes(s,f)
957−end
958−b=testamem("\100\111\105\110\103\32\110\111\116\104\105\110\103",function ()
959−return 10
960−end)
961−assert(b == 10)
962−testamem("\115\116\97\116\101\32\99\114\101\97\116\105\111\110",function ()
963−local st = T.newstate()
964−if st then
965−T.closestate(st)
966−end
967−return st
968−end)
969−testamem("\101\109\112\116\121\45\116\97\98\108\101\32\99\114\101\97\116\105\111\110",function ()
970−return {}
971−end)
972−testamem("\115\116\114\105\110\103\32\99\114\101\97\116\105\111\110",function ()
973−return "\88\88\88" .. "\89\89\89"
974−end)
975−testamem("\99\111\114\111\117\116\105\110\101\32\99\114\101\97\116\105\111\110",function ()
976−return coroutine.create(print)
977−end)
978−testamem("\116\111\45\98\101\45\99\108\111\115\101\100\32\118\97\114\105\97\98\108\101\115",function ()
979−local flag
980−do
981−local x <close> = setmetatable({},{["\95\95\99\108\111\115\101"] = function ()
982−flag=true
983−end})
984−flag=false
985−local x = {}
986−end
987−return flag
988−end)
989−local mt = T.testC("\114\97\119\103\101\116\105\32\82\32\49\59\32\114\101\116\117\114\110\32\49")
990−assert(type(mt) == "\116\104\114\101\97\100" and coroutine.running() == mt)
991−local function expand
992−(n,s)
993−if n == 0 then
994−return ""
995−end
996−local e = string.rep("\61",n)
997−return string.format("\84\46\100\111\111\110\110\101\119\115\116\97\99\107\40\91\37\115\91\32\37\115\59\10\32\99\111\108\108\101\99\116\103\97\114\98\97\103\101\40\41\59\32\37\115\93\37\115\93\41\10",e,s,expand(n - 1,s),e)
998−end
999−G=0
1000−;
1001−collectgarbage()
1002−;
1003−a=collectgarbage("\99\111\117\110\116")
1004−load(expand(20,"\71\61\71\43\49"))()
1005−assert(G == 20)
1006−;
1007−collectgarbage()
1008−;
1009−G=nil
1010−testamem("\114\117\110\110\105\110\103\32\99\111\100\101\32\111\110\32\110\101\119\32\116\104\114\101\97\100",function ()
1011−return T.doonnewstack("\108\111\99\97\108\32\120\61\49") == 0
1012−end)
1013−testamem("\108\111\97\100\115\116\114\105\110\103",function ()
1014−return load("\120\61\49")
1015−end)
1016−local testprog = "\108\111\99\97\108\32\102\117\110\99\116\105\111\110\32\102\111\111\32\40\41\32\114\101\116\117\114\110\32\101\110\100\10\108\111\99\97\108\32\116\32\61\32\123\34\120\34\125\10\65\65\32\61\32\34\97\97\97\34\10\102\111\114\32\105\32\61\32\49\44\32\35\116\32\100\111\32\65\65\32\61\32\65\65\32\46\46\32\116\91\105\93\32\101\110\100\10\114\101\116\117\114\110\32\116\114\117\101\10"
1017−_G.AA=nil
1018−local t = os.tmpname()
1019−local f = assert(io.open(t,"\119"))
1020−f:write(testprog)
1021−f:close()
1022−testamem("\100\111\102\105\108\101",function ()
1023−local a = loadfile(t)
1024−return a and a()
1025−end)
1026−assert(os.remove(t))
1027−assert(_G.AA == "\97\97\97\120")
1028−testamem("\103\115\117\98",function ()
1029−local a,b = string.gsub("\97\108\111\32\97\108\111","\40\97\41",function (x)
1030−return x .. "\98"
1031−end)
1032−return (a == "\97\98\108\111\32\97\98\108\111")
1033−end)
1034−testamem("\100\117\109\112\47\117\110\100\117\109\112",function ()
1035−local a = load(testprog)
1036−local b = a and string.dump(a)
1037−a=b and load(b)
1038−return a and a()
1039−end)
1040−_G.AA=nil
1041−local t = os.tmpname()
1042−testamem("\102\105\108\101\32\99\114\101\97\116\105\111\110",function ()
1043−local f = assert(io.open(t,"\119"))
1044−assert(not io.open("\110\111\109\101\110\97\111\101\120\105\115\116\101\110\116\101"))
1045−io.close(f)
1046−;
1047−return not loadfile("\110\111\109\101\110\97\111\101\120\105\115\116\101\110\116\101")
1048−end)
1049−assert(os.remove(t))
1050−testamem("\116\97\98\108\101\32\99\114\101\97\116\105\111\110",function ()
1051−local a,lim = {},10
1052−for i = 1, lim
1053−do
1054−a[i]=i
1055−;
1056−a[i .. "\97"]={}
1057−end
1058−return (type(a[lim .. "\97"]) == "\116\97\98\108\101" and a[lim] == lim)
1059−end)
1060−testamem("\99\111\110\115\116\114\117\99\116\111\114\115",function ()
1061−local a = {10,20,30,40,50,["\97"] = 1,["\98"] = 2,["\99"] = 3,["\100"] = 4,["\101"] = 5}
1062−return (type(a) == "\116\97\98\108\101" and a.e == 5)
1063−end)
1064−local a = 1
1065−local close = nil
1066−testamem("\99\108\111\115\117\114\101\32\99\114\101\97\116\105\111\110",function ()
1067−function close(b)
1068−return function (x)
1069−return b + x
1070−end
1071−end
1072−return (close(2)(4) == 6)
1073−end)
1074−testamem("\117\115\105\110\103\32\99\111\114\111\117\116\105\110\101\115",function ()
1075−local a = coroutine.wrap(function ()
1076−coroutine.yield(string.rep("\97",10))
1077−return {}
1078−end)
1079−assert(string.len(a()) == 10)
1080−return a()
1081−end)
1082−do
1083−local lim = 100
1084−local a = {}
1085−;
1086−for i = 1, lim
1087−do
1088−a[i]="\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57"
1089−end
1090−testamem("\97\117\120\105\108\105\97\114\121\32\98\117\102\102\101\114",function ()
1091−return (# table.concat(a,"\44") == 20 * lim + lim - 1)
1092−end)
1093−end
1094−testamem("\103\114\111\119\105\110\103\32\115\116\97\99\107",function ()
1095−local function foo
1096−(n)
1097−if n == 0 then
1098−return 1
1099−else
1100−return 1 + foo(n - 1)
1101−end
1102−end
1103−return foo(100)
1104−end)
1105−do
1106−local res = T.testC("\114\97\119\99\104\101\99\107\115\116\97\99\107\32\53\48\48\48\48\48\59\32\114\101\116\117\114\110\32\49")
1107−assert(res == false)
1108−local L = T.newstate()
1109−T.alloccount(0)
1110−res=T.testC(L,"\114\97\119\99\104\101\99\107\115\116\97\99\107\32\53\48\48\48\59\32\114\101\116\117\114\110\32\49")
1111−T.alloccount()
1112−T.closestate(L)
1113−assert(res == false)
1114−end
1115−do
1116−local L = T.newstate()
1117−T.alloccount(0)
1118−T.closestate(L)
1119−T.alloccount()
1120−end
1121−do
1122−local L = T.newstate()
1123−T.loadlib(L)
1124−local res = (T.doremote(L,"\32\32\32\32\95\69\78\86\32\61\32\114\101\113\117\105\114\101\34\95\71\34\10\32\32\32\32\108\111\99\97\108\32\84\32\61\32\114\101\113\117\105\114\101\34\84\34\10\32\32\32\32\108\111\99\97\108\32\97\32\61\32\123\125\10\32\32\32\32\102\111\114\32\105\32\61\32\49\44\32\49\48\48\48\32\100\111\32\97\91\105\93\32\61\32\39\105\39\32\46\46\32\105\32\101\110\100\32\32\32\32\45\45\32\103\114\111\119\32\115\116\114\105\110\103\32\116\97\98\108\101\10\32\32\32\32\108\111\99\97\108\32\115\116\115\105\122\101\44\32\115\116\117\115\101\32\61\32\84\46\113\117\101\114\121\115\116\114\40\41\10\32\32\32\32\97\115\115\101\114\116\40\115\116\117\115\101\32\62\32\49\48\48\48\41\10\32\32\32\32\108\111\99\97\108\32\102\117\110\99\116\105\111\110\32\102\111\111\32\40\110\41\10\32\32\32\32\32\32\105\102\32\110\32\62\32\48\32\116\104\101\110\32\102\111\111\40\110\32\45\32\49\41\32\101\110\100\10\32\32\32\32\101\110\100\10\32\32\32\32\102\111\111\40\49\56\48\41\32\32\32\32\45\45\32\103\114\111\119\32\115\116\97\99\107\10\32\32\32\32\108\111\99\97\108\32\95\44\32\115\116\107\115\105\122\101\32\61\32\84\46\115\116\97\99\107\108\101\118\101\108\40\41\10\32\32\32\32\97\115\115\101\114\116\40\115\116\107\115\105\122\101\32\62\32\49\56\48\41\10\32\32\32\32\97\32\61\32\110\105\108\10\32\32\32\32\84\46\97\108\108\111\99\99\111\117\110\116\40\48\41\10\32\32\32\32\99\111\108\108\101\99\116\103\97\114\98\97\103\101\40\41\10\32\32\32\32\84\46\97\108\108\111\99\99\111\117\110\116\40\41\10\32\32\32\32\45\45\32\115\116\97\99\107\32\97\110\100\32\115\116\114\105\110\103\32\116\97\98\108\101\32\99\111\117\108\100\32\110\111\116\32\98\101\32\114\101\97\108\108\111\99\97\116\101\100\44\10\32\32\32\32\45\45\32\115\111\32\116\104\101\121\32\107\101\112\116\32\116\104\101\105\114\32\115\105\122\101\115\32\40\119\105\116\104\111\117\116\32\101\114\114\111\114\115\41\10\32\32\32\32\97\115\115\101\114\116\40\115\101\108\101\99\116\40\50\44\32\84\46\115\116\97\99\107\108\101\118\101\108\40\41\41\32\61\61\32\115\116\107\115\105\122\101\41\10\32\32\32\32\97\115\115\101\114\116\40\84\46\113\117\101\114\121\115\116\114\40\41\32\61\61\32\115\116\115\105\122\101\41\10\32\32\32\32\114\101\116\117\114\110\32\39\111\107\39\10\32\32"))
1125−assert(res == "\111\107")
1126−T.closestate(L)
1127−end
1128−print("\43")
1129−local function gsub
1130−(a,b,c)
1131−a,b=T.testC("\103\115\117\98\32\50\32\51\32\52\59\32\103\101\116\116\111\112\59\32\114\101\116\117\114\110\32\50",a,b,c)
1132−assert(b == 5)
1133−return a
1134−end
1135−assert(gsub("\97\108\111\46\97\108\111\46\117\104\117\104\46","\46","\47\47") == "\97\108\111\47\47\97\108\111\47\47\117\104\117\104\47\47")
1136−assert(gsub("\97\108\111\46\97\108\111\46\117\104\117\104\46","\97\108\111","\47\47") == "\47\47\46\47\47\46\117\104\117\104\46")
1137−assert(gsub("","\97\108\111","\47\47") == "")
1138−assert(gsub("\46\46\46","\46","\47\46") == "\47\46\47\46\47\46")
1139−assert(gsub("\46\46\46","\46\46\46","") == "")
1140−local mt_xuxu,res,top = T.testC("\110\101\119\109\101\116\97\116\97\98\108\101\32\120\117\120\117\59\32\103\101\116\116\111\112\59\32\114\101\116\117\114\110\32\51")
1141−assert(type(mt_xuxu) == "\116\97\98\108\101" and res and top == 3)
1142−local d,res,top = T.testC("\110\101\119\109\101\116\97\116\97\98\108\101\32\120\117\120\117\59\32\103\101\116\116\111\112\59\32\114\101\116\117\114\110\32\51")
1143−assert(mt_xuxu == d and not res and top == 3)
1144−d,res,top=T.testC("\110\101\119\109\101\116\97\116\97\98\108\101\32\120\117\120\117\49\59\32\103\101\116\116\111\112\59\32\114\101\116\117\114\110\32\51")
1145−assert(mt_xuxu ~= d and res and top == 3)
1146−x=T.newuserdata(0)
1147−;
1148−y=T.newuserdata(0)
1149−;
1150−T.testC("\112\117\115\104\115\116\114\105\110\103\32\120\117\120\117\59\32\103\101\116\116\97\98\108\101\32\82\59\32\115\101\116\109\101\116\97\116\97\98\108\101\32\50",x)
1151−assert(getmetatable(x) == mt_xuxu)
1152−local res1,res2,top = T.testC("\116\101\115\116\117\100\97\116\97\32\45\49\32\120\117\120\117\10\32\32\32\9\32\9\9\9\32\32\116\101\115\116\117\100\97\116\97\32\50\32\120\117\120\117\10\9\9\9\9\32\32\103\101\116\116\111\112\10\9\9\9\9\32\32\114\101\116\117\114\110\32\51",x)
1153−assert(res1 and res2 and top == 4)
1154−res1,res2,top=T.testC("\116\101\115\116\117\100\97\116\97\32\45\49\32\120\117\120\117\49\10\9\9\9\32\32\32\32\116\101\115\116\117\100\97\116\97\32\50\32\120\117\120\117\49\10\9\9\9\32\32\32\32\103\101\116\116\111\112\10\9\9\9\32\32\32\32\114\101\116\117\114\110\32\51",x)
1155−assert(not res1 and not res2 and top == 4)
1156−res1,res2,top=T.testC("\116\101\115\116\117\100\97\116\97\32\45\49\32\120\117\120\117\50\10\9\9\9\32\32\32\32\116\101\115\116\117\100\97\116\97\32\50\32\120\117\120\117\50\10\9\9\9\32\32\32\32\103\101\116\116\111\112\10\9\9\9\32\32\32\32\114\101\116\117\114\110\32\51",x)
1157−assert(not res1 and not res2 and top == 4)
1158−res1,res2,top=T.testC("\116\101\115\116\117\100\97\116\97\32\45\49\32\120\117\120\117\10\9\9\9\32\32\32\32\116\101\115\116\117\100\97\116\97\32\50\32\120\117\120\117\10\9\9\9\32\32\32\32\103\101\116\116\111\112\10\9\9\9\32\32\32\32\114\101\116\117\114\110\32\51",y)
1159−assert(not res1 and not res2 and top == 4)
1160−do
1161−local r = debug.getregistry()
1162−assert(r.xuxu == mt_xuxu and r.xuxu1 == d)
1163−r.xuxu=nil
1164−;
1165−r.xuxu1=nil
1166−end
1167−print("\79\75")
zod/luau/res/lua/cycled/attrib.luadeleted−431
@@ -1,431 +0,0 @@
1−print("\116\101\115\116\105\110\103\32\114\101\113\117\105\114\101")
2−assert(require("\115\116\114\105\110\103") == string)
3−assert(require("\109\97\116\104") == math)
4−assert(require("\116\97\98\108\101") == table)
5−assert(require("\105\111") == io)
6−assert(require("\111\115") == os)
7−assert(require("\99\111\114\111\117\116\105\110\101") == coroutine)
8−assert(type(package.path) == "\115\116\114\105\110\103")
9−assert(type(package.cpath) == "\115\116\114\105\110\103")
10−assert(type(package.loaded) == "\116\97\98\108\101")
11−assert(type(package.preload) == "\116\97\98\108\101")
12−assert(type(package.config) == "\115\116\114\105\110\103")
13−print("\112\97\99\107\97\103\101\32\99\111\110\102\105\103\58\32" .. string.gsub(package.config,"\10","\124"))
14−do
15−local max = _soft and 100 or 2000
16−local t = {}
17−for i = 1, max
18−do
19−t[i]=string.rep("\63",i % 10 + 1)
20−end
21−t[# t + 1]="\59"
22−local path = table.concat(t,"\59")
23−local s,err = package.searchpath("\120\117\120\117",path)
24−assert(not s and string.find(err,string.rep("\120\117\120\117",10)) and # string.gsub(err,"\91\94\10\93","") >= max)
25−local path = string.rep("\63",max)
26−local s,err = package.searchpath("\120\117\120\117",path)
27−assert(not s and string.find(err,string.rep("\120\117\120\117",max)))
28−end
29−do
30−local oldpath = package.path
31−package.path={}
32−local s,err = pcall(require,"\110\111\45\115\117\99\104\45\102\105\108\101")
33−assert(not s and string.find(err,"\112\97\99\107\97\103\101\46\112\97\116\104"))
34−package.path=oldpath
35−end
36−do
37−print("\116\101\115\116\105\110\103\32\39\114\101\113\117\105\114\101\39\32\109\101\115\115\97\103\101")
38−local oldpath = package.path
39−local oldcpath = package.cpath
40−package.path="\63\46\108\117\97\59\63\47\63"
41−package.cpath="\63\46\115\111\59\63\47\105\110\105\116"
42−local st,msg = pcall(require,"\88\88\88")
43−local expected = "\109\111\100\117\108\101\32\39\88\88\88\39\32\110\111\116\32\102\111\117\110\100\58\10\9\110\111\32\102\105\101\108\100\32\112\97\99\107\97\103\101\46\112\114\101\108\111\97\100\91\39\88\88\88\39\93\10\9\110\111\32\102\105\108\101\32\39\88\88\88\46\108\117\97\39\10\9\110\111\32\102\105\108\101\32\39\88\88\88\47\88\88\88\39\10\9\110\111\32\102\105\108\101\32\39\88\88\88\46\115\111\39\10\9\110\111\32\102\105\108\101\32\39\88\88\88\47\105\110\105\116\39"
44−assert(msg == expected)
45−package.path=oldpath
46−package.cpath=oldcpath
47−end
48−print("\43")
49−if not _port then
50−local dirsep = string.match(package.config,"\94\40\91\94\10\93\43\41\10")
51−local DIR = "\108\105\98\115" .. dirsep
52−local function D
53−(x)
54−local x = string.gsub(x,"\47",dirsep)
55−return DIR .. x
56−end
57−local function DC
58−(x)
59−local ext = (dirsep == "\92") and "\46\100\108\108" or "\46\115\111"
60−return D(x .. ext)
61−end
62−local function createfiles
63−(files,preextras,posextras)
64−for n,c in pairs(files)
65−do
66−io.output(D(n))
67−io.write(string.format(preextras,n))
68−io.write(c)
69−io.write(string.format(posextras,n))
70−io.close(io.output())
71−end
72−end
73−local function removefiles
74−(files)
75−for n in pairs(files)
76−do
77−os.remove(D(n))
78−end
79−end
80−local files = {["\110\97\109\101\115\46\108\117\97"] = "\100\111\32\114\101\116\117\114\110\32\123\46\46\46\125\32\101\110\100\10",["\101\114\114\46\108\117\97"] = "\66\32\61\32\49\53\59\32\97\32\61\32\97\32\43\32\49\59",["\115\121\110\101\114\114\46\108\117\97"] = "\66\32\61",["\65\46\108\117\97"] = "",["\66\46\108\117\97"] = "\97\115\115\101\114\116\40\46\46\46\61\61\39\66\39\41\59\114\101\113\117\105\114\101\32\39\65\39",["\65\46\108\99"] = "",["\65"] = "",["\76"] = "",["\88\88\120\88"] = "",["\67\46\108\117\97"] = "\112\97\99\107\97\103\101\46\108\111\97\100\101\100\91\46\46\46\93\32\61\32\50\53\59\32\114\101\113\117\105\114\101\39\67\39"}
81−AA=nil
82−local extras = "\78\65\77\69\32\61\32\39\37\115\39\10\82\69\81\85\73\82\69\68\32\61\32\46\46\46\10\114\101\116\117\114\110\32\65\65"
83−createfiles(files,"",extras)
84−assert(package.searchpath("\67\46\108\117\97",D("\63"),"","") == D("\67\46\108\117\97"))
85−assert(package.searchpath("\67\46\108\117\97",D("\63"),"\46","\46") == D("\67\46\108\117\97"))
86−assert(package.searchpath("\45\45\120\45",D("\63"),"\45","\88") == D("\88\88\120\88"))
87−assert(package.searchpath("\45\45\45\120\88",D("\63"),"\45\45\45","\88\88") == D("\88\88\120\88"))
88−assert(package.searchpath(D("\67\46\108\117\97"),"\63",dirsep) == D("\67\46\108\117\97"))
89−assert(package.searchpath("\46\92\67\46\108\117\97",D("\63"),"\92") == D("\46\47\67\46\108\117\97"))
90−local oldpath = package.path
91−package.path=string.gsub("\68\47\63\46\108\117\97\59\68\47\63\46\108\99\59\68\47\63\59\68\47\63\63\120\63\59\68\47\76","\68\47",DIR)
92−local try = function (p,n,r,ext)
93−NAME=nil
94−local rr,x = require(p)
95−assert(NAME == n)
96−assert(REQUIRED == p)
97−assert(rr == r)
98−assert(ext == x)
99−end
100−local a = require("\110\97\109\101\115")
101−assert(a[1] == "\110\97\109\101\115" and a[2] == D("\110\97\109\101\115\46\108\117\97"))
102−local st,msg = pcall(require,"\101\114\114")
103−assert(not st and string.find(msg,"\97\114\105\116\104\109\101\116\105\99") and B == 15)
104−st,msg=pcall(require,"\115\121\110\101\114\114")
105−assert(not st and string.find(msg,"\101\114\114\111\114\32\108\111\97\100\105\110\103\32\109\111\100\117\108\101"))
106−assert(package.searchpath("\67",package.path) == D("\67\46\108\117\97"))
107−assert(require("\67") == 25)
108−assert(require("\67") == 25)
109−AA=nil
110−try("\66","\66\46\108\117\97",true,"\108\105\98\115\47\66\46\108\117\97")
111−assert(package.loaded.B)
112−assert(require("\66") == true)
113−assert(package.loaded.A)
114−assert(require("\67") == 25)
115−package.loaded.A=nil
116−try("\66",nil,true,nil)
117−try("\65","\65\46\108\117\97",true,"\108\105\98\115\47\65\46\108\117\97")
118−package.loaded.A=nil
119−os.remove(D("\65\46\108\117\97"))
120−AA={}
121−try("\65","\65\46\108\99",AA,"\108\105\98\115\47\65\46\108\99")
122−assert(package.searchpath("\65",package.path) == D("\65\46\108\99"))
123−assert(require("\65") == AA)
124−AA=false
125−try("\75","\76",false,"\108\105\98\115\47\76")
126−try("\75","\76",false,"\108\105\98\115\47\76")
127−assert(rawget(_G,"\95\82\69\81\85\73\82\69\68\78\65\77\69") == nil)
128−AA="\120"
129−try("\88","\88\88\120\88",AA,"\108\105\98\115\47\88\88\120\88")
130−removefiles(files)
131−NAME,REQUIRED,AA,B=nil
132−local _G = _G
133−package.path=string.gsub("\68\47\63\46\108\117\97\59\68\47\63\47\105\110\105\116\46\108\117\97","\68\47",DIR)
134−files={["\80\49\47\105\110\105\116\46\108\117\97"] = "\65\65\32\61\32\49\48",["\80\49\47\120\117\120\117\46\108\117\97"] = "\65\65\32\61\32\50\48"}
135−createfiles(files,"\95\69\78\86\32\61\32\123\125\10","\10\114\101\116\117\114\110\32\95\69\78\86\10")
136−AA=0
137−local m,ext = assert(require("\80\49"))
138−assert(ext == "\108\105\98\115\47\80\49\47\105\110\105\116\46\108\117\97")
139−assert(AA == 0 and m.AA == 10)
140−assert(require("\80\49") == m)
141−assert(require("\80\49") == m)
142−assert(package.searchpath("\80\49\46\120\117\120\117",package.path) == D("\80\49\47\120\117\120\117\46\108\117\97"))
143−m.xuxu,ext=assert(require("\80\49\46\120\117\120\117"))
144−assert(AA == 0 and m.xuxu.AA == 20)
145−assert(ext == "\108\105\98\115\47\80\49\47\120\117\120\117\46\108\117\97")
146−assert(require("\80\49\46\120\117\120\117") == m.xuxu)
147−assert(require("\80\49\46\120\117\120\117") == m.xuxu)
148−assert(require("\80\49") == m and m.AA == 10)
149−removefiles(files)
150−AA=nil
151−package.path=""
152−assert(not pcall(require,"\102\105\108\101\95\100\111\101\115\95\110\111\116\95\101\120\105\115\116"))
153−package.path="\63\63\63"
154−assert(not pcall(require,"\102\105\108\101\95\100\111\101\115\95\110\111\116\95\101\120\105\115\116\49"))
155−package.path=oldpath
156−local fname = "\102\105\108\101\95\100\111\101\115\95\110\111\116\95\101\120\105\115\116\50"
157−local m,err = pcall(require,fname)
158−for t in string.gmatch(package.path .. "\59" .. package.cpath,"\91\94\59\93\43")
159−do
160−t=string.gsub(t,"\63",fname)
161−assert(string.find(err,t,1,true))
162−end
163−do
164−local searchers = package.searchers
165−package.searchers=3
166−local st,msg = pcall(require,"\97")
167−assert(not st and string.find(msg,"\109\117\115\116\32\98\101\32\97\32\116\97\98\108\101"))
168−package.searchers=searchers
169−end
170−local function import
171−(...)
172−local f = {...}
173−return function (m)
174−for i = 1, # f
175−do
176−m[f[i]]=_G[f[i]]
177−end
178−end
179−end
180−assert(not pcall(module,"\88\85\88\85"))
181−local p = ""
182−local st,err,when = package.loadlib(DC("\108\105\98\49"),"\42")
183−if not st then
184−local f,err,when = package.loadlib("\100\111\110\111\116\101\120\105\115\116",p .. "\120\117\120\117")
185−assert(not f and type(err) == "\115\116\114\105\110\103" and when == "\97\98\115\101\110\116")
186−;
187−(Message or print)("\10\32\62\62\62\32\99\97\110\110\111\116\32\108\111\97\100\32\100\121\110\97\109\105\99\32\108\105\98\114\97\114\121\32\60\60\60\10")
188−print(err,when)
189−else
190−local f = assert(package.loadlib(DC("\108\105\98\49"),p .. "\111\110\101\102\117\110\99\116\105\111\110"))
191−local a,b = f(15,25)
192−assert(a == 25 and b == 15)
193−f=assert(package.loadlib(DC("\108\105\98\49"),p .. "\97\110\111\116\104\101\114\102\117\110\99"))
194−assert(f(10,20) == "\49\48\37\50\48\10")
195−local f,err,when = package.loadlib(DC("\108\105\98\49"),p .. "\120\117\120\117")
196−assert(not f and type(err) == "\115\116\114\105\110\103" and when == "\105\110\105\116")
197−f,err,when=package.loadlib("\100\111\110\111\116\101\120\105\115\116",p .. "\120\117\120\117")
198−assert(not f and type(err) == "\115\116\114\105\110\103" and when == "\111\112\101\110")
199−f=assert(package.loadlib(DC("\108\105\98\49\49"),p .. "\108\117\97\111\112\101\110\95\108\105\98\49\49"))
200−assert(f() == "\101\120\112\111\114\116\101\100")
201−package.cpath=DC("\63")
202−local lib2,ext = require("\108\105\98\50\45\118\50")
203−assert(string.find(ext,"\108\105\98\115\47\108\105\98\50\45\118\50",1,true))
204−assert(_ENV.x == "\108\105\98\50\45\118\50" and _ENV.y == DC("\108\105\98\50\45\118\50"))
205−assert(lib2.id("\120") == true)
206−local fs,ext = require("\108\105\98\49\46\115\117\98")
207−assert(_ENV.x == "\108\105\98\49\46\115\117\98" and _ENV.y == DC("\108\105\98\49"))
208−assert(string.find(ext,"\108\105\98\115\47\108\105\98\49",1,true))
209−assert(fs.id(45) == 45)
210−_ENV.x,_ENV.y=nil
211−end
212−_ENV=_G
213−do
214−local p = package
215−package={}
216−p.preload.pl=function (...)
217−local _ENV = {...}
218−function xuxu(x)
219−return x + 20
220−end
221−return _ENV
222−end
223−local pl,ext = require("\112\108")
224−assert(require("\112\108") == pl)
225−assert(pl.xuxu(10) == 30)
226−assert(pl[1] == "\112\108" and pl[2] == "\58\112\114\101\108\111\97\100\58" and ext == "\58\112\114\101\108\111\97\100\58")
227−package=p
228−assert(type(package.path) == "\115\116\114\105\110\103")
229−end
230−print("\43")
231−end
232−print("\116\101\115\116\105\110\103\32\97\115\115\105\103\110\109\101\110\116\115\44\32\108\111\103\105\99\97\108\32\111\112\101\114\97\116\111\114\115\44\32\97\110\100\32\99\111\110\115\116\114\117\99\116\111\114\115")
233−local res,res2 = 27
234−local a,b = 1,2 + 3
235−assert(a == 1 and b == 5)
236−a={}
237−local function f
238−()
239−return 10,11,12
240−end
241−a.x,b,a[1]=1,2,f()
242−assert(a.x == 1 and b == 2 and a[1] == 10)
243−a[f()],b,a[f() + 3]=f(),a,"\120"
244−assert(a[10] == 10 and b == a and a[13] == "\120")
245−do
246−local f = function (n)
247−local x = {}
248−;
249−for i = 1, n
250−do
251−x[i]=i
252−end
253−;
254−return table.unpack(x)
255−end
256−;
257−local a,b,c
258−a,b=0,f(1)
259−assert(a == 0 and b == 1)
260−a,b=0,f(1)
261−assert(a == 0 and b == 1)
262−a,b,c=0,5,f(4)
263−assert(a == 0 and b == 5 and c == 1)
264−a,b,c=0,5,f(0)
265−assert(a == 0 and b == 5 and c == nil)
266−end
267−local a,b,c,d = 1 and nil,1 or nil,(1 and (nil or 1)),6
268−assert(not a and b and c and d == 6)
269−d=20
270−a,b,c,d=f()
271−assert(a == 10 and b == 11 and c == 12 and d == nil)
272−a,b=f(),1,2,3,f()
273−assert(a == 10 and b == 1)
274−assert(a < b == false and a > b == true)
275−assert((10 and 2) == 2)
276−assert((10 or 2) == 10)
277−assert((10 or assert(nil)) == 10)
278−assert(not (nil and assert(nil)))
279−assert((nil or "\97\108\111") == "\97\108\111")
280−assert((nil and 10) == nil)
281−assert((false and 10) == false)
282−assert((true or 10) == true)
283−assert((false or 10) == 10)
284−assert(false ~= nil)
285−assert(nil ~= false)
286−assert(not nil == true)
287−assert(not not nil == false)
288−assert(not not 1 == true)
289−assert(not not a == true)
290−assert(not not (6 or nil) == true)
291−assert(not not (nil and 56) == false)
292−assert(not not (nil and true) == false)
293−assert(not 10 == false)
294−assert(not {} == false)
295−assert(not 0.5 == false)
296−assert(not "\120" == false)
297−assert({} ~= {})
298−print("\43")
299−a={}
300−a[true]=20
301−a[false]=10
302−assert(a[1 < 2] == 20 and a[1 > 2] == 10)
303−function f(a)
304−return a
305−end
306−local a = {}
307−for i = 3000, - 3000, - 1
308−do
309−a[i + 0.0]=i
310−;
311−end
312−a[1e31]="\97\108\111"
313−;
314−a[true]=10
315−;
316−a[false]=20
317−assert(a[1e31] == "\97\108\111" and a[not 1] == 20 and a[10 < 20] == 10)
318−for i = 3000, - 3000, - 1
319−do
320−assert(a[i] == i)
321−;
322−end
323−a[print]=assert
324−a[f]=print
325−a[a]=a
326−assert(a[a][a][a][a][print] == assert)
327−a[print](a[a[f]] == a[print])
328−assert(not pcall(function ()
329−local a = {}
330−;
331−a[nil]=10
332−end))
333−assert(not pcall(function ()
334−local a = {[nil] = 10}
335−end))
336−assert(a[nil] == undef)
337−a=nil
338−local a,b,c
339−a={10,9,8,7,6,5,4,3,2,[- 3] = "\97",[f] = print,["\97"] = "\97",["\98"] = "\97\98"}
340−a,a.x,a.y=a,a[- 3]
341−assert(a[1] == 10 and a[- 3] == a.a and a[f] == print and a.x == "\97" and not a.y)
342−a[1],f(a)[2],b,c={["\97\108\111"] = assert},10,a[1],a[f],6,10,23,f(a),2
343−a[1].alo(a[2] == 10 and b == 10 and c == print)
344−a.aVeryLongName012345678901234567890123456789012345678901234567890123456789=10
345−local function foo
346−()
347−return a.aVeryLongName012345678901234567890123456789012345678901234567890123456789
348−end
349−assert(foo() == 10 and a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 == 10)
350−do
351−local function foo
352−()
353−local _ENV <const> = 11
354−X="\104\105"
355−end
356−local st,msg = pcall(foo)
357−assert(not st and string.find(msg,"\110\117\109\98\101\114"))
358−end
359−local maxint = math.maxinteger
360−while maxint ~= (maxint + 0.0) or (maxint - 1) ~= (maxint - 1.0) do
361−maxint=maxint // 2
362−end
363−local maxintF = maxint + 0.0
364−assert(maxintF == maxint and math.type(maxintF) == "\102\108\111\97\116" and maxintF >= 2.0 ^ 14)
365−a[maxintF]=10
366−;
367−a[maxintF - 1.0]=11
368−;
369−a[- maxintF]=12
370−;
371−a[- maxintF + 1.0]=13
372−;
373−assert(a[maxint] == 10 and a[maxint - 1] == 11 and a[- maxint] == 12 and a[- maxint + 1] == 13)
374−a[maxint]=20
375−a[- maxint]=22
376−assert(a[maxintF] == 20 and a[maxintF - 1.0] == 11 and a[- maxintF] == 22 and a[- maxintF + 1.0] == 13)
377−a=nil
378−do
379−local a,i,j,b
380−a={"\97","\98"}
381−;
382−i=1
383−;
384−j=2
385−;
386−b=a
387−i,a[i],a,j,a[j],a[i + j]=j,i,i,b,j,i
388−assert(i == 2 and b[1] == 1 and a == 1 and j == b and b[2] == 2 and b[3] == 1)
389−a={}
390−local function foo
391−()
392−b,a.x,a=a,10,20
393−end
394−foo()
395−assert(a == 20 and b.x == 10)
396−end
397−do
398−local a,i,j,b
399−a={"\97","\98"}
400−;
401−i=1
402−;
403−j=2
404−;
405−b=a
406−local function foo
407−()
408−i,a[i],a,j,a[j],a[i + j]=j,i,i,b,j,i
409−end
410−foo()
411−assert(i == 2 and b[1] == 1 and a == 1 and j == b and b[2] == 2 and b[3] == 1)
412−local t = {}
413−(function (a)
414−t[a],a=10,20
415−end)(1)
416−;
417−assert(t[1] == 10)
418−end
419−local function foo
420−()
421−local a
422−return function ()
423−local b
424−a,b=3,14
425−return a,b
426−end
427−end
428−local a,b = foo()()
429−assert(a == 3 and b == 14)
430−print("\79\75")
431−return res
zod/luau/res/lua/cycled/big.luadeleted−67
@@ -1,67 +0,0 @@
1−if _soft then
2−return "\97"
3−end
4−print("\116\101\115\116\105\110\103\32\108\97\114\103\101\32\116\97\98\108\101\115")
5−local debug = require("\100\101\98\117\103")
6−local lim = 2 ^ 18 + 1000
7−local prog = {"\108\111\99\97\108\32\121\32\61\32\123\48"}
8−for i = 1, lim
9−do
10−prog[# prog + 1]=i
11−end
12−prog[# prog + 1]="\125\10"
13−prog[# prog + 1]="\88\32\61\32\121\10"
14−prog[# prog + 1]=("\97\115\115\101\114\116\40\88\91\37\100\93\32\61\61\32\37\100\41"):format(lim - 1,lim - 2)
15−prog[# prog + 1]="\114\101\116\117\114\110\32\48"
16−prog=table.concat(prog,"\59")
17−local env = {["\115\116\114\105\110\103"] = string,["\97\115\115\101\114\116"] = assert}
18−local f = assert(load(prog,nil,nil,env))
19−f()
20−assert(env.X[lim] == lim - 1 and env.X[lim + 1] == lim)
21−for k in pairs(env)
22−do
23−env[k]=undef
24−end
25−setmetatable(env,{["\95\95\105\110\100\101\120"] = function (t,n)
26−coroutine.yield("\103")
27−;
28−return _G[n]
29−end,["\95\95\110\101\119\105\110\100\101\120"] = function (t,n,v)
30−coroutine.yield("\115")
31−;
32−_G[n]=v
33−end})
34−X=nil
35−local co = coroutine.wrap(f)
36−assert(co() == "\115")
37−assert(co() == "\103")
38−assert(co() == "\103")
39−assert(co() == 0)
40−assert(X[lim] == lim - 1 and X[lim + 1] == lim)
41−getmetatable(env).__index=function ()
42−
43−end
44−getmetatable(env).__newindex=function ()
45−
46−end
47−local e,m = pcall(f)
48−assert(not e and m:find("\103\108\111\98\97\108\32\39\88\39"))
49−getmetatable(env).__newindex=function ()
50−error("\104\105")
51−end
52−local e,m = xpcall(f,debug.traceback)
53−assert(not e and m:find("\39\110\101\119\105\110\100\101\120\39"))
54−f,X=nil
55−coroutine.yield("\98")
56−if 2 ^ 32 == 0 then
57−print("\116\101\115\116\105\110\103\32\115\116\114\105\110\103\32\108\101\110\103\116\104\32\111\118\101\114\102\108\111\119")
58−local repstrings = 192
59−local ssize = math.ceil(2.0 ^ 32 / repstrings) + 1
60−assert(repstrings * ssize > 2.0 ^ 32)
61−local longs = string.rep("",ssize)
62−local rep = assert(load("\108\111\99\97\108\32\97\32\61\32\46\46\46\59\32\114\101\116\117\114\110\32" .. string.rep("\97",repstrings,"\46\46")))
63−local a,b = pcall(rep,longs)
64−assert(not a and string.find(b,"\111\118\101\114\102\108\111\119"))
65−end
66−print("\79\75")
67−return "\97"
zod/luau/res/lua/cycled/bitwise.luadeleted−309
@@ -1,309 +0,0 @@
1−print("\116\101\115\116\105\110\103\32\98\105\116\119\105\115\101\32\111\112\101\114\97\116\105\111\110\115")
2−require("\98\119\99\111\101\114\99\105\111\110")
3−local numbits = string.packsize("\106") * 8
4−assert(~ 0 == - 1)
5−assert((1 << (numbits - 1)) == math.mininteger)
6−local a,b,c,d
7−a=18446744073709551615
8−assert(a == - 1 and a & - 1 == a and a & 35 == 35)
9−a=17361641481138401520
10−assert(a | - 1 == - 1)
11−assert(a ~ a == 0 and a ~ 0 == a and a ~ ~ a == - 1)
12−assert(a >> 4 == ~ a)
13−a=240
14−;
15−b=204
16−;
17−c=170
18−;
19−d=253
20−assert(a | b ~ c & d == 244)
21−a=240.0
22−;
23−b=204.0
24−;
25−c="\48\120\65\65\46\48"
26−;
27−d="\48\120\70\68\46\48"
28−assert(a | b ~ c & d == 244)
29−a=4026531840
30−;
31−b=3422552064
32−;
33−c=2852126720
34−;
35−d=4244635648
36−assert(a | b ~ c & d == 4093640704)
37−assert(~ ~ a == a and ~ a == - 1 ~ a and - d == ~ d + 1)
38−a=a << 32
39−b=b << 32
40−c=c << 32
41−d=d << 32
42−assert(a | b ~ c & d == 4093640704 << 32)
43−assert(~ ~ a == a and ~ a == - 1 ~ a and - d == ~ d + 1)
44−do
45−local code = string.format("\114\101\116\117\114\110\32\45\49\32\62\62\32\37\100",math.maxinteger)
46−assert(load(code)() == 0)
47−local code = string.format("\114\101\116\117\114\110\32\45\49\32\62\62\32\37\100",math.mininteger)
48−assert(load(code)() == 0)
49−local code = string.format("\114\101\116\117\114\110\32\45\49\32\60\60\32\37\100",math.maxinteger)
50−assert(load(code)() == 0)
51−local code = string.format("\114\101\116\117\114\110\32\45\49\32\60\60\32\37\100",math.mininteger)
52−assert(load(code)() == 0)
53−end
54−assert(- 1 >> 1 == (1 << (numbits - 1)) - 1 and 1 << 31 == 2147483648)
55−assert(- 1 >> (numbits - 1) == 1)
56−assert(- 1 >> numbits == 0 and - 1 >> - numbits == 0 and - 1 << numbits == 0 and - 1 << - numbits == 0)
57−assert(1 >> math.mininteger == 0)
58−assert(1 >> math.maxinteger == 0)
59−assert(1 << math.mininteger == 0)
60−assert(1 << math.maxinteger == 0)
61−assert((2 ^ 30 - 1) << 2 ^ 30 == 0)
62−assert((2 ^ 30 - 1) >> 2 ^ 30 == 0)
63−assert(1 >> - 3 == 1 << 3 and 1000 >> 5 == 1000 << - 5)
64−assert("\48\120\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102" | 0 == - 1)
65−assert("\48\120\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\101" & "\45\49" == - 2)
66−assert("\32\9\45\48\120\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\101\10\9" & "\45\49" == 2)
67−assert("\32\32\32\10\32\32\45\52\53\32\32\9\32" >> "\32\32\45\50\32\32" == - 45 * 4)
68−assert("\49\50\51\52\46\48" << "\53\46\48" == 1234 * 32)
69−assert("\48\120\102\102\102\102\46\48" ~ "\48\120\65\65\65\65" == 21845)
70−assert(~ "\48\120\48\46\48\48\48\112\52" == - 1)
71−assert(("\55" .. 3) << 1 == 146)
72−assert(4294967295 >> (1 .. "\57") == 8191)
73−assert(10 | (1 .. "\57") == 27)
74−do
75−local st,msg = pcall(function ()
76−return 4 & "\97"
77−end)
78−assert(string.find(msg,"\39\98\97\110\100\39"))
79−local st,msg = pcall(function ()
80−return ~ "\97"
81−end)
82−assert(string.find(msg,"\39\98\110\111\116\39"))
83−end
84−assert(not pcall(function ()
85−return "\48\120\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\46\48" | 0
86−end))
87−assert(not pcall(function ()
88−return "\48\120\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102\102" | 0
89−end))
90−print("\43")
91−package.preload.bit32=function ()
92−local bit = {}
93−function bit.bnot(a)
94−return ~ a & 4294967295
95−end
96−function bit.band(x,y,z, ...)
97−if not z then
98−return ((x or - 1) & (y or - 1)) & 4294967295
99−else
100−local arg = {...}
101−local res = x & y & z
102−for i = 1, # arg
103−do
104−res=res & arg[i]
105−end
106−return res & 4294967295
107−end
108−end
109−function bit.bor(x,y,z, ...)
110−if not z then
111−return ((x or 0) | (y or 0)) & 4294967295
112−else
113−local arg = {...}
114−local res = x | y | z
115−for i = 1, # arg
116−do
117−res=res | arg[i]
118−end
119−return res & 4294967295
120−end
121−end
122−function bit.bxor(x,y,z, ...)
123−if not z then
124−return ((x or 0) ~ (y or 0)) & 4294967295
125−else
126−local arg = {...}
127−local res = x ~ y ~ z
128−for i = 1, # arg
129−do
130−res=res ~ arg[i]
131−end
132−return res & 4294967295
133−end
134−end
135−function bit.btest(...)
136−return bit.band(...) ~= 0
137−end
138−function bit.lshift(a,b)
139−return ((a & 4294967295) << b) & 4294967295
140−end
141−function bit.rshift(a,b)
142−return ((a & 4294967295) >> b) & 4294967295
143−end
144−function bit.arshift(a,b)
145−a=a & 4294967295
146−if b <= 0 or (a & 2147483648) == 0 then
147−return (a >> b) & 4294967295
148−else
149−return ((a >> b) | ~ (4294967295 >> b)) & 4294967295
150−end
151−end
152−function bit.lrotate(a,b)
153−b=b & 31
154−a=a & 4294967295
155−a=(a << b) | (a >> (32 - b))
156−return a & 4294967295
157−end
158−function bit.rrotate(a,b)
159−return bit.lrotate(a,- b)
160−end
161−local function checkfield
162−(f,w)
163−w=w or 1
164−assert(f >= 0,"\102\105\101\108\100\32\99\97\110\110\111\116\32\98\101\32\110\101\103\97\116\105\118\101")
165−assert(w > 0,"\119\105\100\116\104\32\109\117\115\116\32\98\101\32\112\111\115\105\116\105\118\101")
166−assert(f + w <= 32,"\116\114\121\105\110\103\32\116\111\32\97\99\99\101\115\115\32\110\111\110\45\101\120\105\115\116\101\110\116\32\98\105\116\115")
167−return f,~ (- 1 << w)
168−end
169−function bit.extract(a,f,w)
170−local f,mask = checkfield(f,w)
171−return (a >> f) & mask
172−end
173−function bit.replace(a,v,f,w)
174−local f,mask = checkfield(f,w)
175−v=v & mask
176−a=(a & ~ (mask << f)) | (v << f)
177−return a & 4294967295
178−end
179−return bit
180−end
181−print("\116\101\115\116\105\110\103\32\98\105\116\119\105\115\101\32\108\105\98\114\97\114\121")
182−local bit32 = require("\98\105\116\51\50")
183−assert(bit32.band() == bit32.bnot(0))
184−assert(bit32.btest() == true)
185−assert(bit32.bor() == 0)
186−assert(bit32.bxor() == 0)
187−assert(bit32.band() == bit32.band(4294967295))
188−assert(bit32.band(1,2) == 0)
189−assert(bit32.band(- 1) == 4294967295)
190−assert(bit32.band((1 << 33) - 1) == 4294967295)
191−assert(bit32.band(- (1 << 33) - 1) == 4294967295)
192−assert(bit32.band((1 << 33) + 1) == 1)
193−assert(bit32.band(- (1 << 33) + 1) == 1)
194−assert(bit32.band(- (1 << 40)) == 0)
195−assert(bit32.band(1 << 40) == 0)
196−assert(bit32.band(- (1 << 40) - 2) == 4294967294)
197−assert(bit32.band((1 << 40) - 4) == 4294967292)
198−assert(bit32.lrotate(0,- 1) == 0)
199−assert(bit32.lrotate(0,7) == 0)
200−assert(bit32.lrotate(305419896,0) == 305419896)
201−assert(bit32.lrotate(305419896,32) == 305419896)
202−assert(bit32.lrotate(305419896,4) == 591751041)
203−assert(bit32.rrotate(305419896,- 4) == 591751041)
204−assert(bit32.lrotate(305419896,- 8) == 2014458966)
205−assert(bit32.rrotate(305419896,8) == 2014458966)
206−assert(bit32.lrotate(2863311530,2) == 2863311530)
207−assert(bit32.lrotate(2863311530,- 2) == 2863311530)
208−for i = - 50, 50
209−do
210−assert(bit32.lrotate(2309737967,i) == bit32.lrotate(2309737967,i % 32))
211−end
212−assert(bit32.lshift(305419896,4) == 591751040)
213−assert(bit32.lshift(305419896,8) == 878082048)
214−assert(bit32.lshift(305419896,- 4) == 19088743)
215−assert(bit32.lshift(305419896,- 8) == 1193046)
216−assert(bit32.lshift(305419896,32) == 0)
217−assert(bit32.lshift(305419896,- 32) == 0)
218−assert(bit32.rshift(305419896,4) == 19088743)
219−assert(bit32.rshift(305419896,8) == 1193046)
220−assert(bit32.rshift(305419896,32) == 0)
221−assert(bit32.rshift(305419896,- 32) == 0)
222−assert(bit32.arshift(305419896,0) == 305419896)
223−assert(bit32.arshift(305419896,1) == 305419896 // 2)
224−assert(bit32.arshift(305419896,- 1) == 305419896 * 2)
225−assert(bit32.arshift(- 1,1) == 4294967295)
226−assert(bit32.arshift(- 1,24) == 4294967295)
227−assert(bit32.arshift(- 1,32) == 4294967295)
228−assert(bit32.arshift(- 1,- 1) == bit32.band(- 1 * 2,4294967295))
229−assert(305419896 << 4 == 4886718336)
230−assert(305419896 << 8 == 78187493376)
231−assert(305419896 << - 4 == 19088743)
232−assert(305419896 << - 8 == 1193046)
233−assert(305419896 << 32 == 1311768464867721216)
234−assert(305419896 << - 32 == 0)
235−assert(305419896 >> 4 == 19088743)
236−assert(305419896 >> 8 == 1193046)
237−assert(305419896 >> 32 == 0)
238−assert(305419896 >> - 32 == 1311768464867721216)
239−print("\43")
240−local c = {0,1,2,3,10,2147483648,2863311530,1431655765,4294967295,2147483647}
241−for _,b in pairs(c)
242−do
243−assert(bit32.band(b) == b)
244−assert(bit32.band(b,b) == b)
245−assert(bit32.band(b,b,b,b) == b)
246−assert(bit32.btest(b,b) == (b ~= 0))
247−assert(bit32.band(b,b,b) == b)
248−assert(bit32.band(b,b,b,~ b) == 0)
249−assert(bit32.btest(b,b,b) == (b ~= 0))
250−assert(bit32.band(b,bit32.bnot(b)) == 0)
251−assert(bit32.bor(b,bit32.bnot(b)) == bit32.bnot(0))
252−assert(bit32.bor(b) == b)
253−assert(bit32.bor(b,b) == b)
254−assert(bit32.bor(b,b,b) == b)
255−assert(bit32.bor(b,b,0,~ b) == 4294967295)
256−assert(bit32.bxor(b) == b)
257−assert(bit32.bxor(b,b) == 0)
258−assert(bit32.bxor(b,b,b) == b)
259−assert(bit32.bxor(b,b,b,b) == 0)
260−assert(bit32.bxor(b,0) == b)
261−assert(bit32.bnot(b) ~= b)
262−assert(bit32.bnot(bit32.bnot(b)) == b)
263−assert(bit32.bnot(b) == (1 << 32) - 1 - b)
264−assert(bit32.lrotate(b,32) == b)
265−assert(bit32.rrotate(b,32) == b)
266−assert(bit32.lshift(bit32.lshift(b,- 4),4) == bit32.band(b,bit32.bnot(15)))
267−assert(bit32.rshift(bit32.rshift(b,4),- 4) == bit32.band(b,bit32.bnot(15)))
268−end
269−c={0,1,2,3,10,8388608,11184810,5592405,16777215,8388607}
270−for _,b in pairs(c)
271−do
272−for i = - 40, 40
273−do
274−local x = bit32.lshift(b,i)
275−local y = math.floor(math.fmod(b * 2.0 ^ i,2.0 ^ 32))
276−assert(math.fmod(x - y,2.0 ^ 32) == 0)
277−end
278−end
279−assert(not pcall(bit32.band,{}))
280−assert(not pcall(bit32.bnot,"\97"))
281−assert(not pcall(bit32.lshift,45))
282−assert(not pcall(bit32.lshift,45,print))
283−assert(not pcall(bit32.rshift,45,print))
284−print("\43")
285−assert(bit32.extract(305419896,0,4) == 8)
286−assert(bit32.extract(305419896,4,4) == 7)
287−assert(bit32.extract(2684358929,28,4) == 10)
288−assert(bit32.extract(2684358929,31,1) == 1)
289−assert(bit32.extract(1342177553,31,1) == 0)
290−assert(bit32.extract(4063516281,0,32) == 4063516281)
291−assert(not pcall(bit32.extract,0,- 1))
292−assert(not pcall(bit32.extract,0,32))
293−assert(not pcall(bit32.extract,0,0,33))
294−assert(not pcall(bit32.extract,0,31,2))
295−assert(bit32.replace(305419896,5,28,4) == 1379161720)
296−assert(bit32.replace(305419896,2271560481,0,32) == 2271560481)
297−assert(bit32.replace(0,1,2) == 2 ^ 2)
298−assert(bit32.replace(0,- 1,4) == 2 ^ 4)
299−assert(bit32.replace(- 1,0,31) == (1 << 31) - 1)
300−assert(bit32.replace(- 1,0,1,2) == (1 << 32) - 7)
301−assert(bit32.bor(3.0) == 3)
302−assert(bit32.bor(- 4.0) == 4294967292)
303−if 2.0 ^ 50 < 2.0 ^ 50 + 1.0 and 2.0 ^ 50 < (- 1 >> 1) then
304−assert(bit32.bor(2.0 ^ 32 - 5.0) == 4294967291)
305−assert(bit32.bor(- 2.0 ^ 32 - 6.0) == 4294967290)
306−assert(bit32.bor(2.0 ^ 48 - 5.0) == 4294967291)
307−assert(bit32.bor(- 2.0 ^ 48 - 6.0) == 4294967290)
308−end
309−print("\79\75")
zod/luau/res/lua/cycled/bwcoercion.luadeleted−59
@@ -1,59 +0,0 @@
1−local tonumber,tointeger = tonumber,math.tointeger
2−local type,getmetatable,rawget,error = type,getmetatable,rawget,error
3−local strsub = string.sub
4−local print = print
5−_ENV=nil
6−local function toint
7−(x)
8−x=tonumber(x)
9−if not x then
10−return false
11−end
12−return tointeger(x)
13−end
14−local function trymt
15−(x,y,mtname)
16−if type(y) ~= "\115\116\114\105\110\103" then
17−local mt = getmetatable(y)
18−local mm = mt and rawget(mt,mtname)
19−if mm then
20−return mm(x,y)
21−end
22−end
23−error("\97\116\116\101\109\112\116\32\116\111\32\39" .. strsub(mtname,3) .. "\39\32\97\32" .. type(x) .. "\32\119\105\116\104\32\97\32" .. type(y),4)
24−end
25−local function checkargs
26−(x,y,mtname)
27−local xi = toint(x)
28−local yi = toint(y)
29−if xi and yi then
30−return xi,yi
31−else
32−return trymt(x,y,mtname),nil
33−end
34−end
35−local smt = getmetatable("")
36−smt.__band=function (x,y)
37−local x,y = checkargs(x,y,"\95\95\98\97\110\100")
38−return y and x & y or x
39−end
40−smt.__bor=function (x,y)
41−local x,y = checkargs(x,y,"\95\95\98\111\114")
42−return y and x | y or x
43−end
44−smt.__bxor=function (x,y)
45−local x,y = checkargs(x,y,"\95\95\98\120\111\114")
46−return y and x ~ y or x
47−end
48−smt.__shl=function (x,y)
49−local x,y = checkargs(x,y,"\95\95\115\104\108")
50−return y and x << y or x
51−end
52−smt.__shr=function (x,y)
53−local x,y = checkargs(x,y,"\95\95\115\104\114")
54−return y and x >> y or x
55−end
56−smt.__bnot=function (x)
57−local x,y = checkargs(x,x,"\95\95\98\110\111\116")
58−return y and ~ x or x
59−end
zod/luau/res/lua/cycled/calls.luadeleted−492
@@ -1,492 +0,0 @@
1−print("\116\101\115\116\105\110\103\32\102\117\110\99\116\105\111\110\115\32\97\110\100\32\99\97\108\108\115")
2−local debug = require("\100\101\98\117\103")
3−assert(type(1 < 2) == "\98\111\111\108\101\97\110")
4−assert(type(true) == "\98\111\111\108\101\97\110" and type(false) == "\98\111\111\108\101\97\110")
5−assert(type(nil) == "\110\105\108" and type(- 3) == "\110\117\109\98\101\114" and type("\120") == "\115\116\114\105\110\103" and type({}) == "\116\97\98\108\101" and type(type) == "\102\117\110\99\116\105\111\110")
6−assert(type(assert) == type(print))
7−local function f
8−(x)
9−return a:x(x)
10−end
11−assert(type(f) == "\102\117\110\99\116\105\111\110")
12−assert(not pcall(type))
13−fact=false
14−do
15−local res = 1
16−local function fact
17−(n)
18−if n == 0 then
19−return res
20−else
21−return n * fact(n - 1)
22−end
23−end
24−assert(fact(5) == 120)
25−end
26−assert(fact == false)
27−fact=nil
28−local a = {["\105"] = 10}
29−local self = 20
30−function a:x(x)
31−return x + self.i
32−end
33−function a.y(x)
34−return x + self
35−end
36−assert(a:x(1) + 10 == a.y(1))
37−a.t={["\105"] = - 100}
38−a["\116"].x=function (self,a,b)
39−return self.i + a + b
40−end
41−assert(a.t:x(2,3) == - 95)
42−do
43−local a = {["\120"] = 0}
44−function a:add(x)
45−self.x,a.y=self.x + x,20
46−;
47−return self
48−end
49−assert(a:add(10):add(20):add(30).x == 60 and a.y == 20)
50−end
51−local a = {["\98"] = {["\99"] = {}}}
52−function a.b.c.f1(x)
53−return x + 1
54−end
55−function a.b.c:f2(x,y)
56−self[x]=y
57−end
58−assert(a.b.c.f1(4) == 5)
59−a.b.c:f2("\107",12)
60−;
61−assert(a.b.c.k == 12)
62−print("\43")
63−t=nil
64−function f(a,b,c)
65−local d = "\97"
66−;
67−t={a,b,c,d}
68−end
69−f(1,2)
70−assert(t[1] == 1 and t[2] == 2 and t[3] == nil and t[4] == "\97")
71−f(1,2,3,4)
72−assert(t[1] == 1 and t[2] == 2 and t[3] == 3 and t[4] == "\97")
73−t=nil
74−function fat(x)
75−if x <= 1 then
76−return 1
77−else
78−return x * load("\114\101\116\117\114\110\32\102\97\116\40" .. x - 1 .. "\41","")()
79−end
80−end
81−assert(load("\108\111\97\100\32\39\97\115\115\101\114\116\40\102\97\116\40\54\41\61\61\55\50\48\41\39\32\40\41\32"))()
82−a=load("\114\101\116\117\114\110\32\102\97\116\40\53\41\44\32\51")
83−local a,b = a()
84−assert(a == 120 and b == 3)
85−fat=nil
86−print("\43")
87−local function err_on_n
88−(n)
89−if n == 0 then
90−error()
91−;
92−exit(1)
93−;
94−else
95−err_on_n(n - 1)
96−;
97−exit(1)
98−;
99−end
100−end
101−do
102−local function dummy
103−(n)
104−if n > 0 then
105−assert(not pcall(err_on_n,n))
106−dummy(n - 1)
107−end
108−end
109−dummy(10)
110−end
111−_G.deep=nil
112−function deep(n)
113−if n > 0 then
114−deep(n - 1)
115−end
116−end
117−deep(10)
118−deep(180)
119−print("\116\101\115\116\105\110\103\32\116\97\105\108\32\99\97\108\108\115")
120−function deep(n)
121−if n > 0 then
122−return deep(n - 1)
123−else
124−return 101
125−end
126−end
127−assert(deep(30000) == 101)
128−a={}
129−function a:deep(n)
130−if n > 0 then
131−return self:deep(n - 1)
132−else
133−return 101
134−end
135−end
136−assert(a:deep(30000) == 101)
137−do
138−local function foo
139−(x, ...)
140−local a = {...}
141−;
142−return x,a[1],a[2]
143−end
144−local function foo1
145−(x)
146−return foo(10,x,x + 1)
147−end
148−local a,b,c = foo1(- 2)
149−assert(a == 10 and b == - 2 and c == - 1)
150−local t = setmetatable({},{["\95\95\99\97\108\108"] = foo})
151−local function foo2
152−(x)
153−return t(10,x)
154−end
155−a,b,c=foo2(100)
156−assert(a == t and b == 10 and c == 100)
157−a,b=(function ()
158−return foo()
159−end)()
160−assert(a == nil and b == nil)
161−local X,Y,A
162−local function foo
163−(x,y, ...)
164−X=x
165−;
166−Y=y
167−;
168−A={...}
169−end
170−local function foo1
171−(...)
172−return foo(...)
173−end
174−local a,b,c = foo1()
175−assert(X == nil and Y == nil and # A == 0)
176−a,b,c=foo1(10)
177−assert(X == 10 and Y == nil and # A == 0)
178−a,b,c=foo1(10,20)
179−assert(X == 10 and Y == 20 and # A == 0)
180−a,b,c=foo1(10,20,30)
181−assert(X == 10 and Y == 20 and # A == 1 and A[1] == 30)
182−end
183−do
184−local function loop
185−()
186−assert(pcall(loop))
187−end
188−local err,msg = xpcall(loop,loop)
189−assert(not err and string.find(msg,"\101\114\114\111\114"))
190−end
191−do
192−local n = 10000
193−local function foo
194−()
195−if n == 0 then
196−return 1023
197−else
198−n=n - 1
199−;
200−return foo()
201−end
202−end
203−for i = 1, 100
204−do
205−foo=setmetatable({},{["\95\95\99\97\108\108"] = foo})
206−end
207−assert(coroutine.wrap(function ()
208−return foo()
209−end)() == 1023)
210−end
211−print("\43")
212−do
213−local N = 20
214−local u = table.pack
215−for i = 1, N
216−do
217−u=setmetatable({i},{["\95\95\99\97\108\108"] = u})
218−end
219−local Res = u("\97","\98","\99")
220−assert(Res.n == N + 3)
221−for i = 1, N
222−do
223−assert(Res[i][1] == i)
224−end
225−assert(Res[N + 1] == "\97" and Res[N + 2] == "\98" and Res[N + 3] == "\99")
226−end
227−a=nil
228−(function (x)
229−a=x
230−end)(23)
231−assert(a == 23 and (function (x)
232−return x * 2
233−end)(20) == 40)
234−local Z = function (le)
235−local function a
236−(f)
237−return le(function (x)
238−return f(f)(x)
239−end)
240−end
241−return a(a)
242−end
243−local F = function (f)
244−return function (n)
245−if n == 0 then
246−return 1
247−else
248−return n * f(n - 1)
249−end
250−end
251−end
252−local fat = Z(F)
253−assert(fat(0) == 1 and fat(4) == 24 and Z(F)(5) == 5 * Z(F)(4))
254−local function g
255−(z)
256−local function f
257−(a,b,c,d)
258−return function (x,y)
259−return a + b + c + d + a + x + y + z
260−end
261−end
262−return f(z,z + 1,z + 2,z + 3)
263−end
264−local f = g(10)
265−assert(f(9,16) == 10 + 11 + 12 + 13 + 10 + 9 + 16 + 10)
266−print("\43")
267−local function unlpack
268−(t,i)
269−i=i or 1
270−if (i <= # t) then
271−return t[i],unlpack(t,i + 1)
272−end
273−end
274−local function equaltab
275−(t1,t2)
276−assert(# t1 == # t2)
277−for i = 1, # t1
278−do
279−assert(t1[i] == t2[i])
280−end
281−end
282−local pack = function (...)
283−return (table.pack(...))
284−end
285−local function f
286−()
287−return 1,2,30,4
288−end
289−local function ret2
290−(a,b)
291−return a,b
292−end
293−local a,b,c,d = unlpack({1,2,3})
294−assert(a == 1 and b == 2 and c == 3 and d == nil)
295−a={1,2,3,4,false,10,"\97\108\111",false,assert}
296−equaltab(pack(unlpack(a)),a)
297−equaltab(pack(unlpack(a),- 1),{1,- 1})
298−a,b,c,d=ret2(f()),ret2(f())
299−assert(a == 1 and b == 1 and c == 2 and d == nil)
300−a,b,c,d=unlpack(pack(ret2(f()),ret2(f())))
301−assert(a == 1 and b == 1 and c == 2 and d == nil)
302−a,b,c,d=unlpack(pack(ret2(f()),(ret2(f()))))
303−assert(a == 1 and b == 1 and c == nil and d == nil)
304−a=ret2({unlpack({1,2,3}),unlpack({3,2,1}),unlpack({"\97","\98"})})
305−assert(a[1] == 1 and a[2] == 3 and a[3] == "\97" and a[4] == "\98")
306−rawget({},"\120",1)
307−rawset({},"\120",1,2)
308−assert(math.sin(1,2) == math.sin(1))
309−table.sort({10,9,8,4,19,23,0,0},function (a,b)
310−return a < b
311−end,"\101\120\116\114\97\32\97\114\103")
312−local x = "\45\45\32\97\32\99\111\109\109\101\110\116\10\32\32\120\32\61\32\49\48\32\43\32\10\50\51\59\32\10\32\32\32\32\32\108\111\99\97\108\32\97\32\61\32\102\117\110\99\116\105\111\110\32\40\41\32\120\32\61\32\39\104\105\39\32\101\110\100\59\32\10\32\32\32\32\32\114\101\116\117\114\110\32\39\39"
313−local function read1
314−(x)
315−local i = 0
316−return function ()
317−collectgarbage()
318−i=i + 1
319−return string.sub(x,i,i)
320−end
321−end
322−local function cannotload
323−(msg,a,b)
324−assert(not a and string.find(b,msg))
325−end
326−a=assert(load(read1(x),"\109\111\100\110\97\109\101","\116",_G))
327−assert(a() == "" and _G.x == 33)
328−assert(debug.getinfo(a).source == "\109\111\100\110\97\109\101")
329−cannotload("\97\116\116\101\109\112\116\32\116\111\32\108\111\97\100\32\97\32\116\101\120\116\32\99\104\117\110\107",load(read1(x),"\109\111\100\110\97\109\101","\98",{}))
330−cannotload("\97\116\116\101\109\112\116\32\116\111\32\108\111\97\100\32\97\32\116\101\120\116\32\99\104\117\110\107",load(x,"\109\111\100\110\97\109\101","\98"))
331−a=assert(load(function ()
332−return nil
333−end))
334−a()
335−assert(not load(function ()
336−return true
337−end))
338−local t = {nil,"\114\101\116\117\114\110\32","\51"}
339−f,msg=load(function ()
340−return table.remove(t,1)
341−end)
342−assert(f() == nil)
343−f=load(string.dump(function ()
344−return 1
345−end),nil,"\98",{})
346−assert(type(f) == "\102\117\110\99\116\105\111\110" and f() == 1)
347−do
348−local f = string.dump(function ()
349−return "\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57"
350−end)
351−f=load(read1(f))
352−assert(f() == "\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57\48\49\50\51\52\53\54\55\56\57")
353−end
354−x=string.dump(load("\120\32\61\32\49\59\32\114\101\116\117\114\110\32\120"))
355−a=assert(load(read1(x),nil,"\98"))
356−assert(a() == 1 and _G.x == 1)
357−cannotload("\97\116\116\101\109\112\116\32\116\111\32\108\111\97\100\32\97\32\98\105\110\97\114\121\32\99\104\117\110\107",load(read1(x),nil,"\116"))
358−cannotload("\97\116\116\101\109\112\116\32\116\111\32\108\111\97\100\32\97\32\98\105\110\97\114\121\32\99\104\117\110\107",load(x,nil,"\116"))
359−_G.x=nil
360−assert(not pcall(string.dump,print))
361−cannotload("\117\110\101\120\112\101\99\116\101\100\32\115\121\109\98\111\108",load(read1("\42\97\32\61\32\49\50\51")))
362−cannotload("\117\110\101\120\112\101\99\116\101\100\32\115\121\109\98\111\108",load("\42\97\32\61\32\49\50\51"))
363−cannotload("\104\104\105",load(function ()
364−error("\104\104\105")
365−end))
366−assert(load("\114\101\116\117\114\110\32\95\69\78\86",nil,nil,123)() == 123)
367−local x
368−;
369−XX=123
370−local function h
371−()
372−local y = x
373−return XX
374−end
375−local d = string.dump(h)
376−x=load(d,"","\98")
377−assert(debug.getupvalue(x,2) == "\95\69\78\86")
378−debug.setupvalue(x,2,_G)
379−assert(x() == 123)
380−assert(assert(load("\114\101\116\117\114\110\32\88\88\32\43\32\46\46\46",nil,nil,{["\88\88"] = 13}))(4) == 17)
381−XX=nil
382−x="\32\32\114\101\116\117\114\110\32\102\117\110\99\116\105\111\110\32\40\120\41\10\32\32\32\32\114\101\116\117\114\110\32\102\117\110\99\116\105\111\110\32\40\121\41\10\32\32\32\32\32\114\101\116\117\114\110\32\102\117\110\99\116\105\111\110\32\40\122\41\10\32\32\32\32\32\32\32\114\101\116\117\114\110\32\120\43\121\43\122\10\32\32\32\32\32\101\110\100\10\32\32\32\101\110\100\10\32\32\101\110\100\10"
383−a=assert(load(read1(x),"\114\101\97\100","\116"))
384−assert(a()(2)(3)(10) == 15)
385−x=string.dump(a)
386−a=assert(load(read1(x),"\114\101\97\100","\98"))
387−assert(a()(2)(3)(10) == 15)
388−local a,b = 20,30
389−x=load(string.dump(function (x)
390−if x == "\115\101\116" then
391−a=10 + b
392−;
393−b=b + 1
394−else
395−return a
396−end
397−end),"","\98",nil)
398−assert(x() == nil)
399−assert(debug.setupvalue(x,1,"\104\105") == "\97")
400−assert(x() == "\104\105")
401−assert(debug.setupvalue(x,2,13) == "\98")
402−assert(not debug.setupvalue(x,3,10))
403−x("\115\101\116")
404−assert(x() == 23)
405−x("\115\101\116")
406−assert(x() == 24)
407−do
408−local nup = 200
409−local prog = {"\108\111\99\97\108\32\97\49"}
410−for i = 2, nup
411−do
412−prog[# prog + 1]="\44\32\97" .. i
413−end
414−prog[# prog + 1]="\32\61\32\49"
415−for i = 2, nup
416−do
417−prog[# prog + 1]="\44\32" .. i
418−end
419−local sum = 1
420−prog[# prog + 1]="\59\32\114\101\116\117\114\110\32\102\117\110\99\116\105\111\110\32\40\41\32\114\101\116\117\114\110\32\97\49"
421−for i = 2, nup
422−do
423−prog[# prog + 1]="\32\43\32\97" .. i
424−;
425−sum=sum + i
426−end
427−prog[# prog + 1]="\32\101\110\100"
428−prog=table.concat(prog)
429−local f = assert(load(prog))()
430−assert(f() == sum)
431−f=load(string.dump(f))
432−local a = 10
433−local h = function ()
434−return a
435−end
436−for i = 1, nup
437−do
438−debug.upvaluejoin(f,i,h,1)
439−end
440−assert(f() == 10 * nup)
441−end
442−do
443−local t = {["\120"] = 1}
444−function t:_012345678901234567890123456789012345678901234567890123456789()
445−return self.x
446−end
447−assert(t:_012345678901234567890123456789012345678901234567890123456789() == 1)
448−end
449−assert((function ()
450−return nil
451−end)(4) == nil)
452−assert((function ()
453−local a
454−;
455−return a
456−end)(4) == nil)
457−assert((function (a)
458−return a
459−end)() == nil)
460−print("\116\101\115\116\105\110\103\32\98\105\110\97\114\121\32\99\104\117\110\107\115")
461−do
462−local header = string.pack("\99\52\66\66\99\54\66\66\66","\27\76\117\97",84,0,"\25\147\13\10\26\10",4,string.packsize("\106"),string.packsize("\110"))
463−local c = string.dump(function ()
464−local a = 1
465−;
466−local b = 3
467−;
468−local f = function ()
469−return a + b + _ENV.c
470−end
471−local s1 = "\97\32\99\111\110\115\116\97\110\116"
472−local s2 = "\97\110\111\116\104\101\114\32\99\111\110\115\116\97\110\116"
473−return a + b * 3
474−end)
475−assert(assert(load(c))() == 10)
476−assert(string.sub(c,1,# header) == header)
477−local ci,cn = string.unpack("\106\110",c,# header + 1)
478−assert(ci == 22136 and cn == 370.5)
479−for i = 1, # header
480−do
481−local s = string.sub(c,1,i - 1) .. string.char(string.byte(string.sub(c,i,i)) + 1) .. string.sub(c,i + 1,- 1)
482−assert(# s == # c)
483−assert(not load(s))
484−end
485−for i = 1, # c - 1
486−do
487−local st,msg = load(string.sub(c,1,i))
488−assert(not st and string.find(msg,"\116\114\117\110\99\97\116\101\100"))
489−end
490−end
491−print("\79\75")
492−return deep
zod/luau/res/lua/cycled/closure.luadeleted−327
@@ -1,327 +0,0 @@
1−print("\116\101\115\116\105\110\103\32\99\108\111\115\117\114\101\115")
2−local A,B = 0,{["\103"] = 10}
3−local function f
4−(x)
5−local a = {}
6−for i = 1, 1000
7−do
8−local y = 0
9−do
10−a[i]=function ()
11−B.g=B.g + 1
12−;
13−y=y + x
14−;
15−return y + A
16−end
17−end
18−end
19−local dummy = function ()
20−return a[A]
21−end
22−collectgarbage()
23−A=1
24−;
25−assert(dummy() == a[1])
26−;
27−A=0
28−;
29−assert(a[1]() == x)
30−assert(a[3]() == x)
31−collectgarbage()
32−assert(B.g == 12)
33−return a
34−end
35−local a = f(10)
36−local x = {[1] = {}}
37−setmetatable(x,{["\95\95\109\111\100\101"] = "\107\118"})
38−while x[1] do
39−local a = A .. A .. A .. A
40−A=A + 1
41−end
42−assert(a[1]() == 20 + A)
43−assert(a[1]() == 30 + A)
44−assert(a[2]() == 10 + A)
45−collectgarbage()
46−assert(a[2]() == 20 + A)
47−assert(a[2]() == 30 + A)
48−assert(a[3]() == 20 + A)
49−assert(a[8]() == 10 + A)
50−assert(getmetatable(x).__mode == "\107\118")
51−assert(B.g == 19)
52−a={}
53−for i = 1, 5
54−do
55−a[i]=function (x)
56−return i + a + _ENV
57−end
58−end
59−assert(a[3] ~= a[4] and a[4] ~= a[5])
60−do
61−local a = function (x)
62−return math.sin(_ENV[x])
63−end
64−local function f
65−()
66−return a
67−end
68−assert(f() == f())
69−end
70−a={}
71−for i = 1, 10
72−do
73−a[i]={["\115\101\116"] = function (x)
74−i=x
75−end,["\103\101\116"] = function ()
76−return i
77−end}
78−if i == 3 then
79−break
80−end
81−end
82−assert(a[4] == undef)
83−a[1].set(10)
84−assert(a[2].get() == 2)
85−a[2].set("\97")
86−assert(a[3].get() == 3)
87−assert(a[2].get() == "\97")
88−a={}
89−local t = {"\97","\98"}
90−for i = 1, # t
91−do
92−local k = t[i]
93−a[i]={["\115\101\116"] = function (x,y)
94−i=x
95−;
96−k=y
97−end,["\103\101\116"] = function ()
98−return i,k
99−end}
100−if i == 2 then
101−break
102−end
103−end
104−a[1].set(10,20)
105−local r,s = a[2].get()
106−assert(r == 2 and s == "\98")
107−r,s=a[1].get()
108−assert(r == 10 and s == 20)
109−a[2].set("\97","\98")
110−r,s=a[2].get()
111−assert(r == "\97" and s == "\98")
112−local f
113−for i = 1, 3
114−do
115−f=function ()
116−return i
117−end
118−break
119−end
120−assert(f() == 1)
121−for k = 1, # t
122−do
123−local v = t[k]
124−f=function ()
125−return k,v
126−end
127−break
128−end
129−assert(({f()})[1] == 1)
130−assert(({f()})[2] == "\97")
131−local b
132−function f(x)
133−local first = 1
134−while 1 do
135−if x == 3 and not first then
136−return
137−end
138−local a = "\120\117\120\117"
139−b=function (op,y)
140−if op == "\115\101\116" then
141−a=x + y
142−else
143−return a
144−end
145−end
146−if x == 1 then
147−do
148−break
149−end
150−elseif x == 2 then
151−return
152−else
153−if x ~= 3 then
154−error()
155−end
156−end
157−first=nil
158−end
159−end
160−for i = 1, 3
161−do
162−f(i)
163−assert(b("\103\101\116") == "\120\117\120\117")
164−b("\115\101\116",10)
165−;
166−assert(b("\103\101\116") == 10 + i)
167−b=nil
168−end
169−pcall(f,4)
170−;
171−assert(b("\103\101\116") == "\120\117\120\117")
172−b("\115\101\116",10)
173−;
174−assert(b("\103\101\116") == 14)
175−local y,w
176−function f(x)
177−return function (y)
178−return function (z)
179−return w + x + y + z
180−end
181−end
182−end
183−y=f(10)
184−w=1.345
185−assert(y(20)(30) == 60 + w)
186−do
187−local X,Y
188−local a = math.sin(0)
189−while a do
190−local b = 10
191−X=function ()
192−return b
193−end
194−if a then
195−break
196−end
197−end
198−do
199−local b = 20
200−Y=function ()
201−return b
202−end
203−end
204−assert(X() == 10 and Y() == 20)
205−end
206−local a = {}
207−local i = 1
208−repeat
209−local x = i
210−a[i]=function ()
211−i=x + 1
212−;
213−return x
214−end
215−until i > 10 or a[i]() ~= x
216−assert(i == 11 and a[1]() == 1 and a[3]() == 3 and i == 4)
217−a={}
218−for i = 1, 10
219−do
220−if i % 3 == 0 then
221−local y = 0
222−a[i]=function (x)
223−local t = y
224−;
225−y=x
226−;
227−return t
228−end
229−elseif i % 3 == 1 then
230−goto L1
231−error("\110\111\116\32\104\101\114\101")
232−::L1::
233−local y = 1
234−a[i]=function (x)
235−local t = y
236−;
237−y=x
238−;
239−return t
240−end
241−elseif i % 3 == 2 then
242−local t
243−goto l4
244−::l4a::
245−a[i]=t
246−;
247−goto l4b
248−error("\115\104\111\117\108\100\32\110\101\118\101\114\32\98\101\32\104\101\114\101\33")
249−::l4::
250−local y = 2
251−t=function (x)
252−local t = y
253−;
254−y=x
255−;
256−return t
257−end
258−goto l4a
259−error("\115\104\111\117\108\100\32\110\101\118\101\114\32\98\101\32\104\101\114\101\33")
260−::l4b::
261−end
262−end
263−for i = 1, 10
264−do
265−assert(a[i](i * 10) == i % 3 and a[i]() == i * 10)
266−end
267−print("\43")
268−local function t
269−()
270−local function c
271−(a,b)
272−assert(a == "\116\101\115\116" and b == "\79\75")
273−end
274−local function v
275−(f, ...)
276−c("\116\101\115\116",f() ~= 1 and "\70\65\73\76\69\68" or "\79\75")
277−end
278−local x = 1
279−return v(function ()
280−return x
281−end)
282−end
283−t()
284−local debug = require("\100\101\98\117\103")
285−local foo1,foo2,foo3
286−do
287−local a,b,c = 3,5,7
288−foo1=function ()
289−return a + b
290−end
291−;
292−foo2=function ()
293−return b + a
294−end
295−;
296−do
297−local a = 10
298−foo3=function ()
299−return a + b
300−end
301−;
302−end
303−end
304−assert(debug.upvalueid(foo1,1))
305−assert(debug.upvalueid(foo1,2))
306−assert(not debug.upvalueid(foo1,3))
307−assert(debug.upvalueid(foo1,1) == debug.upvalueid(foo2,2))
308−assert(debug.upvalueid(foo1,2) == debug.upvalueid(foo2,1))
309−assert(debug.upvalueid(foo3,1))
310−assert(debug.upvalueid(foo1,1) ~= debug.upvalueid(foo3,1))
311−assert(debug.upvalueid(foo1,2) == debug.upvalueid(foo3,2))
312−assert(debug.upvalueid(string.gmatch("\120","\120"),1) ~= nil)
313−assert(foo1() == 3 + 5 and foo2() == 5 + 3)
314−debug.upvaluejoin(foo1,2,foo2,2)
315−assert(foo1() == 3 + 3 and foo2() == 5 + 3)
316−assert(foo3() == 10 + 5)
317−debug.upvaluejoin(foo3,2,foo2,1)
318−assert(foo3() == 10 + 5)
319−debug.upvaluejoin(foo3,2,foo2,2)
320−assert(foo3() == 10 + 3)
321−assert(not pcall(debug.upvaluejoin,foo1,3,foo2,1))
322−assert(not pcall(debug.upvaluejoin,foo1,1,foo2,3))
323−assert(not pcall(debug.upvaluejoin,foo1,0,foo2,1))
324−assert(not pcall(debug.upvaluejoin,print,1,foo2,1))
325−assert(not pcall(debug.upvaluejoin,{},1,foo2,1))
326−assert(not pcall(debug.upvaluejoin,foo1,1,print,1))
327−print("\79\75")
zod/luau/res/lua/cycled/code.luadeleted−586

This diff is too big to show here.

zod/luau/res/lua/cycled/constructs.luadeleted−469

This diff is too big to show here.

zod/luau/res/lua/cycled/coroutine.luadeleted−1119

This diff is too big to show here.

zod/luau/res/lua/cycled/cstack.luadeleted−166

This diff is too big to show here.

zod/luau/res/lua/cycled/db.luadeleted−947

This diff is too big to show here.

zod/luau/res/lua/cycled/errors.luadeleted−493

This diff is too big to show here.

zod/luau/res/lua/cycled/events.luadeleted−610

This diff is too big to show here.

zod/luau/res/lua/cycled/files.luadeleted−818

This diff is too big to show here.

zod/luau/res/lua/cycled/foo.luadeleted−82

This diff is too big to show here.

zod/luau/res/lua/cycled/gc.luadeleted−790

This diff is too big to show here.

zod/luau/res/lua/cycled/gengc.luadeleted−108

This diff is too big to show here.

zod/luau/res/lua/cycled/goto.luadeleted−275

This diff is too big to show here.

zod/luau/res/lua/cycled/heavy.luadeleted−126

This diff is too big to show here.

zod/luau/res/lua/cycled/literals.luadeleted−199

This diff is too big to show here.

zod/luau/res/lua/cycled/locals.luadeleted−1050

This diff is too big to show here.

zod/luau/res/lua/cycled/main.luadeleted−312

This diff is too big to show here.

zod/luau/res/lua/cycled/math.luadeleted−879

This diff is too big to show here.

zod/luau/res/lua/cycled/nextvar.luadeleted−1055

This diff is too big to show here.

zod/luau/res/lua/cycled/pm.luadeleted−404

This diff is too big to show here.

zod/luau/res/lua/cycled/sort.luadeleted−309

This diff is too big to show here.

zod/luau/res/lua/cycled/strings.luadeleted−441

This diff is too big to show here.

zod/luau/res/lua/cycled/tpack.luadeleted−259

This diff is too big to show here.

zod/luau/res/lua/cycled/utf8.luadeleted−203

This diff is too big to show here.

zod/luau/res/lua/cycled/vararg.luadeleted−137

This diff is too big to show here.

zod/luau/res/lua/cycled/verybig.luadeleted−59

This diff is too big to show here.

zod/luau/tmp.hoondeleted−9

This diff is too big to show here.