aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua')
-rw-r--r--LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua761
1 files changed, 0 insertions, 761 deletions
diff --git a/LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua b/LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua
deleted file mode 100644
index b563ed3..0000000
--- a/LuaSL/testLua/yueliang-0.4.1/test_lua/test_parser-5.0.lua
+++ /dev/null
@@ -1,761 +0,0 @@
1--[[--------------------------------------------------------------------
2
3 test_parser-5.0.lua
4 Lua 5.0.x parser test cases
5 This file is part of Yueliang.
6
7 Copyright (c) 2006 Kein-Hong Man <khman@users.sf.net>
8 The COPYRIGHT file describes the conditions
9 under which this software may be distributed.
10
11 See the ChangeLog for more information.
12
13----------------------------------------------------------------------]]
14
15--[[--------------------------------------------------------------------
16-- Notes:
17-- * there is no intention of properly specifying a grammar; the notes
18-- are meant to reflect the structure of lparser so that it is easy
19-- to locate and modify lparser if so desired
20-- * some test may have invalid expressions but will compile, this
21-- is because the chunk hasn't been executed yet
22----------------------------------------------------------------------]]
23
24--[[--------------------------------------------------------------------
25-- lparser parsing structure, the Lua 5.0.x version...
26----------------------------------------------------------------------]]
27 --------------------------------------------------------------------
28 -- chunk -> { stat [';'] }
29 --------------------------------------------------------------------
30 -- stat -> DO block END
31 -- block -> chunk
32 --------------------------------------------------------------------
33 -- stat -> breakstat
34 -- breakstat -> BREAK
35 -- * must have a loop to break
36 -- * must be last statement in a block
37 --------------------------------------------------------------------
38 -- stat -> retstat
39 -- retstat -> RETURN explist
40 -- * must be last statement in a block
41 --------------------------------------------------------------------
42 -- stat -> exprstat
43 -- exprstat -> primaryexp
44 -- (-> func | assignment)
45 -- * if LHS is VCALL then func, otherwise assignment
46 -- * for func, LHS is VCALL if funcargs in expression
47 --------------------------------------------------------------------
48 -- stat -> funcstat
49 -- funcstat -> FUNCTION funcname body
50 -- funcname -> NAME {'.' NAME} [':' NAME]
51 --------------------------------------------------------------------
52 -- body -> '(' parlist ')' chunk END
53 -- parlist -> [ param { ',' param } ]
54 -- param -> NAME
55 -- * DOTS must be the last parameter in a parlist
56 --------------------------------------------------------------------
57 -- stat -> LOCAL localstat
58 -- LOCAL localstat -> LOCAL NAME {',' NAME} ['=' explist1]
59 -- explist1 -> expr { ',' expr }
60 --------------------------------------------------------------------
61 -- stat -> LOCAL FUNCTION localfunc
62 -- LOCAL FUNCTION localfunc -> LOCAL FUNCTION NAME body
63 --------------------------------------------------------------------
64 -- stat -> ifstat
65 -- ifstat -> IF cond THEN block
66 -- {ELSEIF cond THEN block}
67 -- [ELSE block] END
68 -- block -> chunk
69 -- cond -> expr
70 --------------------------------------------------------------------
71 -- stat -> forstat
72 -- forstat -> fornum | forlist
73 -- forlist -> NAME {,NAME} IN explist1 forbody END
74 -- fornum -> NAME = exp1,exp1[,exp1] forbody END
75 -- forbody -> DO block
76 -- block -> chunk
77 --------------------------------------------------------------------
78 -- stat -> whilestat
79 -- whilestat -> WHILE cond DO block END
80 -- block -> chunk
81 -- cond -> expr
82 --------------------------------------------------------------------
83 -- stat -> repeatstat
84 -- repeatstat -> REPEAT block UNTIL cond
85 -- block -> chunk
86 -- cond -> expr
87 --------------------------------------------------------------------
88 -- assignment -> ',' primaryexp assignment
89 -- | '=' explist1
90 -- explist1 -> expr { ',' expr }
91 -- * for assignment, LHS must be LOCAL, UPVAL, GLOBAL or INDEXED
92 --------------------------------------------------------------------
93 -- primaryexp -> prefixexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs }
94 -- prefixexp -> NAME | '(' expr ')'
95 -- funcargs -> '(' [ explist1 ] ')' | constructor | STRING
96 -- * funcargs turn an expr into a function call
97 --------------------------------------------------------------------
98 -- expr -> subexpr
99 -- subexpr -> (UNOPR subexpr | simpleexp) { BINOPR subexpr }
100 -- simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE
101 -- | constructor | FUNCTION body | primaryexp
102 --------------------------------------------------------------------
103 -- constructor -> '{' [ field { fieldsep field } [ fieldsep ] ] '}'
104 -- fieldsep -> ',' | ';'
105 -- field -> recfield | listfield
106 -- recfield -> ( NAME | '[' exp1 ']' ) = exp1
107 -- listfield -> expr
108 --------------------------------------------------------------------
109
110--[[--------------------------------------------------------------------
111-- parser test cases, Lua 5.0.x
112-- * uncomment string delimiter to enable syntax highlighting...
113-- * anything that matches "^%s*%-%-" is a comment
114-- * headings to display are "^%s*TESTS:%s*(.*)$"
115-- * FAIL test cases should match "%s*%-%-%s*FAIL%s*$"
116----------------------------------------------------------------------]]
117tests_source = [[
118 --------------------------------------------------------------------
119 TESTS: empty chunks
120 --------------------------------------------------------------------
121 -- chunk -> { stat [';'] }
122 --------------------------------------------------------------------
123
124; -- FAIL
125 --------------------------------------------------------------------
126 TESTS: optional semicolon, simple local statements
127 --------------------------------------------------------------------
128 -- stat -> LOCAL localstat
129 -- LOCAL localstat -> LOCAL NAME {',' NAME} ['=' explist1]
130 -- explist1 -> expr { ',' expr }
131 --------------------------------------------------------------------
132local -- FAIL
133local; -- FAIL
134local = -- FAIL
135local end -- FAIL
136local a
137local a;
138local a, b, c
139local a; local b local c;
140local a = 1
141local a local b = a
142local a, b = 1, 2
143local a, b, c = 1, 2, 3
144local a, b, c = 1
145local a = 1, 2, 3
146local a, local -- FAIL
147local 1 -- FAIL
148local "foo" -- FAIL
149local a = local -- FAIL
150local a, b, = -- FAIL
151local a, b = 1, local -- FAIL
152local a, b = , local -- FAIL
153 --------------------------------------------------------------------
154 TESTS: simple DO blocks
155 --------------------------------------------------------------------
156 -- stat -> DO block END
157 -- block -> chunk
158 --------------------------------------------------------------------
159do -- FAIL
160end -- FAIL
161do end
162do ; end -- FAIL
163do 1 end -- FAIL
164do "foo" end -- FAIL
165do local a, b end
166do local a local b end
167do local a; local b; end
168do local a = 1 end
169do do end end
170do do end; end
171do do do end end end
172do do do end; end; end
173do do do return end end end
174do end do -- FAIL
175do end end -- FAIL
176do return end
177do return return end -- FAIL
178do break end -- FAIL
179 --------------------------------------------------------------------
180 TESTS: simple WHILE loops
181 --------------------------------------------------------------------
182 -- stat -> whilestat
183 -- whilestat -> WHILE cond DO block END
184 -- block -> chunk
185 -- cond -> expr
186 --------------------------------------------------------------------
187while -- FAIL
188while do -- FAIL
189while = -- FAIL
190while 1 do -- FAIL
191while 1 do end
192while 1 do local a end
193while 1 do local a local b end
194while 1 do local a; local b; end
195while 1 do 2 end -- FAIL
196while 1 do "foo" end -- FAIL
197while true do end
198while 1 do ; end -- FAIL
199while 1 do while -- FAIL
200while 1 end -- FAIL
201while 1 2 do -- FAIL
202while 1 = 2 do -- FAIL
203while 1 do return end
204while 1 do return return end -- FAIL
205while 1 do do end end
206while 1 do do return end end
207while 1 do break end
208while 1 do break break end -- FAIL
209while 1 do do break end end
210 --------------------------------------------------------------------
211 TESTS: simple REPEAT loops
212 --------------------------------------------------------------------
213 -- stat -> repeatstat
214 -- repeatstat -> REPEAT block UNTIL cond
215 -- block -> chunk
216 -- cond -> expr
217 --------------------------------------------------------------------
218repeat -- FAIL
219repeat until -- FAIL
220repeat until 0
221repeat until false
222repeat until local -- FAIL
223repeat end -- FAIL
224repeat 1 -- FAIL
225repeat = -- FAIL
226repeat local a until 1
227repeat local a local b until 0
228repeat local a; local b; until 0
229repeat ; until 1 -- FAIL
230repeat 2 until 1 -- FAIL
231repeat "foo" until 1 -- FAIL
232repeat return until 0
233repeat return return until 0 -- FAIL
234repeat break until 0
235repeat break break until 0 -- FAIL
236repeat do end until 0
237repeat do return end until 0
238repeat do break end until 0
239 --------------------------------------------------------------------
240 TESTS: simple FOR loops
241 --------------------------------------------------------------------
242 -- stat -> forstat
243 -- forstat -> fornum | forlist
244 -- forlist -> NAME {,NAME} IN explist1 forbody END
245 -- fornum -> NAME = exp1,exp1[,exp1] forbody END
246 -- forbody -> DO block
247 -- block -> chunk
248 --------------------------------------------------------------------
249for -- FAIL
250for do -- FAIL
251for end -- FAIL
252for 1 -- FAIL
253for a -- FAIL
254for true -- FAIL
255for a, in -- FAIL
256for a in -- FAIL
257for a do -- FAIL
258for a in do -- FAIL
259for a in b do -- FAIL
260for a in b end -- FAIL
261for a in b, do -- FAIL
262for a in b do end
263for a in b do local a local b end
264for a in b do local a; local b; end
265for a in b do 1 end -- FAIL
266for a in b do "foo" end -- FAIL
267for a b in -- FAIL
268for a, b, c in p do end
269for a, b, c in p, q, r do end
270for a in 1 do end
271for a in true do end
272for a in "foo" do end
273for a in b do break end
274for a in b do break break end -- FAIL
275for a in b do return end
276for a in b do return return end -- FAIL
277for a in b do do end end
278for a in b do do break end end
279for a in b do do return end end
280for = -- FAIL
281for a = -- FAIL
282for a, b = -- FAIL
283for a = do -- FAIL
284for a = 1, do -- FAIL
285for a = p, q, do -- FAIL
286for a = p q do -- FAIL
287for a = b do end -- FAIL
288for a = 1, 2, 3, 4 do end -- FAIL
289for a = p, q do end
290for a = 1, 2 do end
291for a = 1, 2 do local a local b end
292for a = 1, 2 do local a; local b; end
293for a = 1, 2 do 3 end -- FAIL
294for a = 1, 2 do "foo" end -- FAIL
295for a = p, q, r do end
296for a = 1, 2, 3 do end
297for a = p, q do break end
298for a = p, q do break break end -- FAIL
299for a = 1, 2 do return end
300for a = 1, 2 do return return end -- FAIL
301for a = p, q do do end end
302for a = p, q do do break end end
303for a = p, q do do return end end
304 --------------------------------------------------------------------
305 TESTS: break statement
306 --------------------------------------------------------------------
307 -- stat -> breakstat
308 -- breakstat -> BREAK
309 -- * must have a loop to break
310 -- * must be last statement in a block
311 --------------------------------------------------------------------
312break -- FAIL
313 --------------------------------------------------------------------
314 TESTS: return statement
315 --------------------------------------------------------------------
316 -- stat -> retstat
317 -- retstat -> RETURN explist
318 -- * must be last statement in a block
319 --------------------------------------------------------------------
320return
321return;
322return return -- FAIL
323return 1
324return local -- FAIL
325return "foo"
326return 1, -- FAIL
327return 1,2,3
328return a,b,c,d
329return 1,2;
330 --------------------------------------------------------------------
331 TESTS: conditional statements
332 --------------------------------------------------------------------
333 -- stat -> ifstat
334 -- ifstat -> IF cond THEN block
335 -- {ELSEIF cond THEN block}
336 -- [ELSE block] END
337 -- block -> chunk
338 -- cond -> expr
339 --------------------------------------------------------------------
340if -- FAIL
341elseif -- FAIL
342else -- FAIL
343then -- FAIL
344if then -- FAIL
345if 1 -- FAIL
346if 1 then -- FAIL
347if 1 else -- FAIL
348if 1 then else -- FAIL
349if 1 then elseif -- FAIL
350if 1 then end
351if 1 then local a end
352if 1 then local a local b end
353if 1 then local a; local b; end
354if 1 then else end
355if 1 then local a else local b end
356if 1 then local a; else local b; end
357if 1 then elseif 2 -- FAIL
358if 1 then elseif 2 then -- FAIL
359if 1 then elseif 2 then end
360if 1 then local a elseif 2 then local b end
361if 1 then local a; elseif 2 then local b; end
362if 1 then elseif 2 then else end
363if 1 then else if 2 then end end
364if 1 then else if 2 then end -- FAIL
365if 1 then break end -- FAIL
366if 1 then return end
367if 1 then return return end -- FAIL
368if 1 then end; if 1 then end;
369 --------------------------------------------------------------------
370 TESTS: function statements
371 --------------------------------------------------------------------
372 -- stat -> funcstat
373 -- funcstat -> FUNCTION funcname body
374 -- funcname -> NAME {'.' NAME} [':' NAME]
375 --------------------------------------------------------------------
376 -- body -> '(' parlist ')' chunk END
377 -- parlist -> [ param { ',' param } ]
378 -- param -> NAME
379 -- * DOTS must be the last parameter in a parlist
380 --------------------------------------------------------------------
381function -- FAIL
382function 1 -- FAIL
383function end -- FAIL
384function a -- FAIL
385function a end -- FAIL
386function a( end -- FAIL
387function a() end
388function a(1 -- FAIL
389function a("foo" -- FAIL
390function a(p -- FAIL
391function a(p,) -- FAIL
392function a(p q -- FAIL
393function a(p) end
394function a(p,q,) end -- FAIL
395function a(p,q,r) end
396function a(p,q,1 -- FAIL
397function a(p) do -- FAIL
398function a(p) 1 end -- FAIL
399function a(p) return end
400function a(p) break end -- FAIL
401function a(p) return return end -- FAIL
402function a(p) do end end
403function a.( -- FAIL
404function a.1 -- FAIL
405function a.b() end
406function a.b, -- FAIL
407function a.b.( -- FAIL
408function a.b.c.d() end
409function a: -- FAIL
410function a:1 -- FAIL
411function a:b() end
412function a:b: -- FAIL
413function a:b. -- FAIL
414function a.b.c:d() end
415function a(...) end
416function a(..., -- FAIL
417function a(p,...) end
418function a(p,q,r,...) end
419function a() local a local b end
420function a() local a; local b; end
421function a() end; function a() end;
422 --------------------------------------------------------------------
423 TESTS: local function statements
424 --------------------------------------------------------------------
425 -- stat -> LOCAL FUNCTION localfunc
426 -- LOCAL FUNCTION localfunc -> LOCAL FUNCTION NAME body
427 --------------------------------------------------------------------
428local function -- FAIL
429local function 1 -- FAIL
430local function end -- FAIL
431local function a -- FAIL
432local function a end -- FAIL
433local function a( end -- FAIL
434local function a() end
435local function a(1 -- FAIL
436local function a("foo" -- FAIL
437local function a(p -- FAIL
438local function a(p,) -- FAIL
439local function a(p q -- FAIL
440local function a(p) end
441local function a(p,q,) end -- FAIL
442local function a(p,q,r) end
443local function a(p,q,1 -- FAIL
444local function a(p) do -- FAIL
445local function a(p) 1 end -- FAIL
446local function a(p) return end
447local function a(p) break end -- FAIL
448local function a(p) return return end -- FAIL
449local function a(p) do end end
450local function a. -- FAIL
451local function a: -- FAIL
452local function a(...) end
453local function a(..., -- FAIL
454local function a(p,...) end
455local function a(p,q,r,...) end
456local function a() local a local b end
457local function a() local a; local b; end
458local function a() end; local function a() end;
459 --------------------------------------------------------------------
460 -- stat -> exprstat
461 -- exprstat -> primaryexp
462 -- (-> func | assignment)
463 -- * if LHS is VCALL then func, otherwise assignment
464 -- * for func, LHS is VCALL if funcargs in expression
465 --------------------------------------------------------------------
466 TESTS: assignments
467 --------------------------------------------------------------------
468 -- assignment -> ',' primaryexp assignment
469 -- | '=' explist1
470 -- explist1 -> expr { ',' expr }
471 -- * for assignment, LHS must be LOCAL, UPVAL, GLOBAL or INDEXED
472 --------------------------------------------------------------------
473a -- FAIL
474a, -- FAIL
475a,b,c -- FAIL
476a,b = -- FAIL
477a = 1
478a = 1,2,3
479a,b,c = 1
480a,b,c = 1,2,3
481a.b = 1
482a.b.c = 1
483a[b] = 1
484a[b][c] = 1
485a.b[c] = 1
486a[b].c = 1
4870 = -- FAIL
488"foo" = -- FAIL
489true = -- FAIL
490(a) = -- FAIL
491{} = -- FAIL
492a:b() = -- FAIL
493a() = -- FAIL
494a.b:c() = -- FAIL
495a[b]() = -- FAIL
496a = a b -- FAIL
497a = 1 2 -- FAIL
498a = a = 1 -- FAIL
499 --------------------------------------------------------------------
500 TESTS: function calls
501 --------------------------------------------------------------------
502 -- primaryexp -> prefixexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs }
503 -- prefixexp -> NAME | '(' expr ')'
504 -- funcargs -> '(' [ explist1 ] ')' | constructor | STRING
505 -- * funcargs turn an expr into a function call
506 --------------------------------------------------------------------
507a( -- FAIL
508a()
509a(1)
510a(1,) -- FAIL
511a(1,2,3)
5121() -- FAIL
513a()()
514a.b()
515a[b]()
516a.1 -- FAIL
517a.b -- FAIL
518a[b] -- FAIL
519a.b.( -- FAIL
520a.b.c()
521a[b][c]()
522a[b].c()
523a.b[c]()
524a:b()
525a:b -- FAIL
526a:1 -- FAIL
527a.b:c()
528a[b]:c()
529a:b: -- FAIL
530a:b():c()
531a:b().c[d]:e()
532a:b()[c].d:e()
533(a)()
534()() -- FAIL
535(1)()
536("foo")()
537(true)()
538(a)()()
539(a.b)()
540(a[b])()
541(a).b()
542(a)[b]()
543(a):b()
544(a).b[c]:d()
545(a)[b].c:d()
546(a):b():c()
547(a):b().c[d]:e()
548(a):b()[c].d:e()
549 --------------------------------------------------------------------
550 TESTS: more function calls
551 --------------------------------------------------------------------
552a"foo"
553a[[foo]]
554a.b"foo"
555a[b]"foo"
556a:b"foo"
557a{}
558a.b{}
559a[b]{}
560a:b{}
561a()"foo"
562a"foo"()
563a"foo".b()
564a"foo"[b]()
565a"foo":c()
566a"foo""bar"
567a"foo"{}
568(a):b"foo".c[d]:e"bar"
569(a):b"foo"[c].d:e"bar"
570a(){}
571a{}()
572a{}.b()
573a{}[b]()
574a{}:c()
575a{}"foo"
576a{}{}
577(a):b{}.c[d]:e{}
578(a):b{}[c].d:e{}
579 --------------------------------------------------------------------
580 TESTS: simple expressions
581 --------------------------------------------------------------------
582 -- simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE
583 -- | constructor | FUNCTION body | primaryexp
584 --------------------------------------------------------------------
585a = -- FAIL
586a = a
587a = nil
588a = false
589a = 1
590a = "foo"
591a = [[foo]]
592a = {}
593a = (a)
594a = (nil)
595a = (true)
596a = (1)
597a = ("foo")
598a = ([[foo]])
599a = ({})
600a = a.b
601a = a.b. -- FAIL
602a = a.b.c
603a = a:b -- FAIL
604a = a[b]
605a = a[1]
606a = a["foo"]
607a = a[b][c]
608a = a.b[c]
609a = a[b].c
610a = (a)[b]
611a = (a).c
612a = () -- FAIL
613a = a()
614a = a.b()
615a = a[b]()
616a = a:b()
617a = (a)()
618a = (a).b()
619a = (a)[b]()
620a = (a):b()
621a = a"foo"
622a = a{}
623a = function -- FAIL
624a = function 1 -- FAIL
625a = function a -- FAIL
626a = function end -- FAIL
627a = function( -- FAIL
628a = function() end
629a = function(1 -- FAIL
630a = function(p) end
631a = function(p,) -- FAIL
632a = function(p q -- FAIL
633a = function(p,q,r) end
634a = function(p,q,1 -- FAIL
635a = function(...) end
636a = function(..., -- FAIL
637a = function(p,...) end
638a = function(p,q,r,...) end
639 --------------------------------------------------------------------
640 TESTS: operators
641 --------------------------------------------------------------------
642 -- expr -> subexpr
643 -- subexpr -> (UNOPR subexpr | simpleexp) { BINOPR subexpr }
644 -- simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE
645 -- | constructor | FUNCTION body | primaryexp
646 --------------------------------------------------------------------
647a = -10
648a = -"foo"
649a = -a
650a = -nil
651a = -true
652a = -{}
653a = -function() end
654a = -a()
655a = -(a)
656a = - -- FAIL
657a = not 10
658a = not "foo"
659a = not a
660a = not nil
661a = not true
662a = not {}
663a = not function() end
664a = not a()
665a = not (a)
666a = not -- FAIL
667a = 1 + 2; a = 1 - 2
668a = 1 * 2; a = 1 / 2
669a = 1 ^ 2; a = 1 .. 2
670a = 1 + -- FAIL
671a = 1 .. -- FAIL
672a = 1 * / -- FAIL
673a = 1 + -2; a = 1 - -2
674a = 1 * - -- FAIL
675a = 1 * not 2; a = 1 / not 2
676a = 1 / not -- FAIL
677a = 1 + 2 - 3 * 4 / 5 ^ 6
678a = ((1 + 2) - 3) * (4 / (5 ^ 6))
679a = (1 + (2 - (3 * (4 / (5 ^ ((6)))))))
680a = ((1 -- FAIL
681a = ((1 + 2) -- FAIL
682a = 1) -- FAIL
683a = a + b - c
684a = "foo" + "bar"
685a = "foo".."bar".."baz"
686a = true + false - nil
687a = {} * {}
688a = function() end / function() end
689a = a() ^ b()
690 --------------------------------------------------------------------
691 TESTS: more operators
692 --------------------------------------------------------------------
693a = 1 == 2; a = 1 ~= 2
694a = 1 < 2; a = 1 <= 2
695a = 1 > 2; a = 1 >= 2
696a = 1 < 2 < 3
697a = 1 >= 2 >= 3
698a = 1 == -- FAIL
699a = ~= 2 -- FAIL
700a = "foo" == "bar"
701a = "foo" > "bar"
702a = a ~= b
703a = true == false
704a = 1 and 2; a = 1 or 2
705a = 1 and -- FAIL
706a = or 1 -- FAIL
707a = 1 and 2 and 3
708a = 1 or 2 or 3
709a = 1 and 2 or 3
710a = a and b or c
711a = a() and (b)() or c.d
712a = "foo" and "bar"
713a = true or false
714a = {} and {} or {}
715a = (1) and ("foo") or (nil)
716a = function() end == function() end
717a = function() end or function() end
718 --------------------------------------------------------------------
719 TESTS: constructors
720 --------------------------------------------------------------------
721 -- constructor -> '{' [ field { fieldsep field } [ fieldsep ] ] '}'
722 -- fieldsep -> ',' | ';'
723 -- field -> recfield | listfield
724 -- recfield -> ( NAME | '[' exp1 ']' ) = exp1
725 -- listfield -> expr
726 --------------------------------------------------------------------
727a = { -- FAIL
728a = {}
729a = {,} -- FAIL
730a = {;}
731a = {,,} -- FAIL
732a = {;;} -- FAIL
733a = {{ -- FAIL
734a = {{{}}}
735a = {{},{},{{}},}
736a = { 1 }
737a = { 1, }
738a = { 1; }
739a = { 1, 2 }
740a = { a, b, c, }
741a = { true; false, nil; }
742a = { a.b, a[b]; a:c(), }
743a = { 1 + 2, a > b, "a" or "b" }
744a = { a=1, }
745a = { a=1, b="foo", c=nil }
746a = { a -- FAIL
747a = { a= -- FAIL
748a = { a=, -- FAIL
749a = { a=; -- FAIL
750a = { 1, a="foo" -- FAIL
751a = { 1, a="foo"; b={}, d=true; }
752a = { [ -- FAIL
753a = { [1 -- FAIL
754a = { [1] -- FAIL
755a = { [a]= -- FAIL
756a = { ["foo"]="bar" }
757a = { [1]=a, [2]=b, }
758a = { true, a=1; ["foo"]="bar", }
759]]
760
761-- end of script