From 2d1df4714e2736dbde7855ddcd76b4c1de822fa5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 21:58:02 +1000 Subject: Added a big bunch of example lua scripts for testing the speed of lua compiling. --- .../nat-5.0.3/test/parser_log/sample_01.lua | 9 ++ .../nat-5.0.3/test/parser_log/sample_02.lua | 10 ++ .../nat-5.0.3/test/parser_log/sample_03.lua | 21 +++ .../nat-5.0.3/test/parser_log/sample_04.lua | 31 ++++ .../nat-5.0.3/test/parser_log/sample_05.lua | 129 +++++++++++++++ .../nat-5.0.3/test/parser_log/sample_06.lua | 132 ++++++++++++++++ .../nat-5.0.3/test/parser_log/sample_07.lua | 147 +++++++++++++++++ .../nat-5.0.3/test/parser_log/sample_08.lua | 66 ++++++++ .../nat-5.0.3/test/parser_log/sample_09.lua | 97 ++++++++++++ .../nat-5.0.3/test/parser_log/sample_10.lua | 106 +++++++++++++ .../nat-5.0.3/test/parser_log/sample_11.lua | 175 +++++++++++++++++++++ .../nat-5.0.3/test/parser_log/sample_12.lua | 46 ++++++ .../nat-5.0.3/test/parser_log/sample_13.lua | 99 ++++++++++++ .../nat-5.0.3/test/parser_log/sample_14.lua | 107 +++++++++++++ .../nat-5.0.3/test/parser_log/sample_15.lua | 135 ++++++++++++++++ .../nat-5.0.3/test/parser_log/sample_16.lua | 87 ++++++++++ .../nat-5.0.3/test/parser_log/sample_17.lua | 110 +++++++++++++ .../nat-5.0.3/test/parser_log/sample_b_01.lua | 26 +++ .../nat-5.0.3/test/parser_log/sample_b_02.lua | 35 +++++ .../nat-5.0.3/test/parser_log/sample_b_03.lua | 64 ++++++++ .../nat-5.0.3/test/parser_log/sample_b_04.lua | 77 +++++++++ .../nat-5.0.3/test/parser_log/sample_b_05.lua | 43 +++++ .../nat-5.0.3/test/parser_log/sample_b_06.lua | 70 +++++++++ .../nat-5.0.3/test/parser_log/sample_b_07.lua | 84 ++++++++++ .../nat-5.0.3/test/parser_log/sample_b_08.lua | 159 +++++++++++++++++++ .../nat-5.0.3/test/parser_log/sample_b_09.lua | 53 +++++++ .../nat-5.0.3/test/parser_log/sample_b_10.lua | 49 ++++++ .../nat-5.0.3/test/parser_log/sample_b_11.lua | 79 ++++++++++ .../nat-5.0.3/test/parser_log/sample_b_12.lua | 94 +++++++++++ .../nat-5.0.3/test/parser_log/sample_b_13.lua | 117 ++++++++++++++ .../nat-5.0.3/test/parser_log/sample_b_14.lua | 125 +++++++++++++++ 31 files changed, 2582 insertions(+) create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_01.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_02.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_03.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_04.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_05.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_06.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_07.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_08.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_09.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_10.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_11.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_12.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_13.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_14.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_15.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_16.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_17.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_01.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_02.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_03.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_04.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_05.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_06.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_07.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_08.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_09.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_10.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_11.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_12.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_13.lua create mode 100644 LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_14.lua (limited to 'LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log') diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_01.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_01.lua new file mode 100644 index 0000000..379cc9d --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_01.lua @@ -0,0 +1,9 @@ +-- START OF SOURCE -- +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_02.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_02.lua new file mode 100644 index 0000000..13eb2e6 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_02.lua @@ -0,0 +1,10 @@ +-- START OF SOURCE -- +-- foobar +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_03.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_03.lua new file mode 100644 index 0000000..33df29c --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_03.lua @@ -0,0 +1,21 @@ +-- START OF SOURCE -- +do +end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'do' line=1 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_04.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_04.lua new file mode 100644 index 0000000..d0fefbc --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_04.lua @@ -0,0 +1,31 @@ +-- START OF SOURCE -- +do end +do end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'do' line=1 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'do' line=2 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_05.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_05.lua new file mode 100644 index 0000000..8d6f962 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_05.lua @@ -0,0 +1,129 @@ +-- START OF SOURCE -- +foo() +foo{} +foo"" +foo:bar() +foo=false +foo.bar=true +foo[true]=nil +foo,bar=1,"a" +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: ( funcargs + funcargs: begin '(' + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: { funcargs + funcargs: begin '{' + constructor: begin + constructor: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: funcargs + funcargs: begin + codestring: "" + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: : funcargs + checkname: + str_checkname: 'bar' + codestring: "bar" + funcargs: begin '(' + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: false + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=6 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: '.' field + field: operator=. + checkname: + str_checkname: 'bar' + codestring: "bar" + expr_stat: assignment k='VINDEXED' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: true + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=7 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + primaryexp: [ exp1 ] + index: begin '[' + expr: + simpleexp: true + index: end ']' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: nil + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=8 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: ',' -- next LHS element + prefixexp: + str_checkname: 'bar' + singlevar: name='bar' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + explist1: ',' -- continuation + expr: + simpleexp: =a + codestring: "a" + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_06.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_06.lua new file mode 100644 index 0000000..ca7776e --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_06.lua @@ -0,0 +1,132 @@ +-- START OF SOURCE -- +foo=true +foo=false +foo=nil +foo=1.23e45 +foo=-1 +foo=(0) +foo=1+2 +foo=1+2*3-4/5 +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: true + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: false + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: nil + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1.23e+45 + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + subexpr: uop='-' + simpleexp: =1 + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=6 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: begin ( expr ) + expr: + simpleexp: =0 + prefixexp: end ( expr ) + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=7 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + subexpr: binop='+' + simpleexp: =2 + subexpr: -- evaluate + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=8 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + subexpr: binop='+' + simpleexp: =2 + subexpr: binop='*' + simpleexp: =3 + subexpr: -- evaluate + subexpr: -- evaluate + subexpr: binop='-' + simpleexp: =4 + subexpr: binop='/' + simpleexp: =5 + subexpr: -- evaluate + subexpr: -- evaluate + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_07.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_07.lua new file mode 100644 index 0000000..8c0a738 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_07.lua @@ -0,0 +1,147 @@ +-- START OF SOURCE -- +if foo then foo=1 end +if foo then foo=1 else foo=0 end +if foo then foo=1 elseif not foo then foo=0 end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'if' line=1 + if_stat: if...then + test_then_block: test condition + cond: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + cond: end + test_then_block: then block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + if_stat: end + -- STATEMENT: end 'if' + + -- STATEMENT: begin 'if' line=2 + if_stat: if...then + test_then_block: test condition + cond: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + cond: end + test_then_block: then block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + if_stat: else... + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =0 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + if_stat: end + -- STATEMENT: end 'if' + + -- STATEMENT: begin 'if' line=3 + if_stat: if...then + test_then_block: test condition + cond: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + cond: end + test_then_block: then block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =1 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + if_stat: elseif...then + test_then_block: test condition + cond: begin + expr: + subexpr: uop='not' + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + cond: end + test_then_block: then block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =0 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + if_stat: end + -- STATEMENT: end 'if' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_08.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_08.lua new file mode 100644 index 0000000..d086c98 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_08.lua @@ -0,0 +1,66 @@ +-- START OF SOURCE -- +do return end +do return 123 end +do return "foo","bar" end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'do' line=1 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'return' line=1 + return_stat: no return values + -- STATEMENT: end 'return' + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'do' line=2 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'return' line=2 + return_stat: begin + explist1: begin + expr: + simpleexp: =123 + explist1: end + return_stat: end + -- STATEMENT: end 'return' + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'do' line=3 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'return' line=3 + return_stat: begin + explist1: begin + expr: + simpleexp: =foo + codestring: "foo" + explist1: ',' -- continuation + expr: + simpleexp: =bar + codestring: "bar" + explist1: end + return_stat: end + -- STATEMENT: end 'return' + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_09.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_09.lua new file mode 100644 index 0000000..2236388 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_09.lua @@ -0,0 +1,97 @@ +-- START OF SOURCE -- +while true do foo=not foo end +while foo~=42 do foo=foo-1 end +while true do break end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'while' line=1 + while_stat: begin/condition + expr: + simpleexp: true + enterblock(isbreakable=true) + while_stat: block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + subexpr: uop='not' + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + while_stat: end + -- STATEMENT: end 'while' + + -- STATEMENT: begin 'while' line=2 + while_stat: begin/condition + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + subexpr: binop='~=' + simpleexp: =42 + subexpr: -- evaluate + enterblock(isbreakable=true) + while_stat: block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + subexpr: binop='-' + simpleexp: =1 + subexpr: -- evaluate + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + while_stat: end + -- STATEMENT: end 'while' + + -- STATEMENT: begin 'while' line=3 + while_stat: begin/condition + expr: + simpleexp: true + enterblock(isbreakable=true) + while_stat: block + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'break' line=3 + break_stat: -- break out of loop + -- STATEMENT: end 'break' + leaveblock + block: end + leaveblock + while_stat: end + -- STATEMENT: end 'while' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_10.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_10.lua new file mode 100644 index 0000000..72f7ae3 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_10.lua @@ -0,0 +1,106 @@ +-- START OF SOURCE -- +repeat foo=foo.."bar" until false +repeat foo=foo/2 until foo<1 +repeat break until false +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'repeat' line=1 + repeat_stat: begin + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + subexpr: binop='..' + simpleexp: =bar + codestring: "bar" + subexpr: -- evaluate + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + repeat_stat: condition + cond: begin + expr: + simpleexp: false + cond: end + leaveblock + repeat_stat: end + -- STATEMENT: end 'repeat' + + -- STATEMENT: begin 'repeat' line=2 + repeat_stat: begin + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + subexpr: binop='/' + simpleexp: =2 + subexpr: -- evaluate + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + repeat_stat: condition + cond: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + subexpr: binop='<' + simpleexp: =1 + subexpr: -- evaluate + cond: end + leaveblock + repeat_stat: end + -- STATEMENT: end 'repeat' + + -- STATEMENT: begin 'repeat' line=3 + repeat_stat: begin + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'break' line=3 + break_stat: -- break out of loop + -- STATEMENT: end 'break' + leaveblock + block: end + repeat_stat: condition + cond: begin + expr: + simpleexp: false + cond: end + leaveblock + repeat_stat: end + -- STATEMENT: end 'repeat' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_11.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_11.lua new file mode 100644 index 0000000..8af611b --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_11.lua @@ -0,0 +1,175 @@ +-- START OF SOURCE -- +for i=1,10 do foo=i end +for i=1,10,2 do break end +for i in foo do bar=0 end +for i,j in foo,bar do baz=0 end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'for' line=1 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: numerical loop + fornum: begin + fornum: index start + exp1: begin + expr: + simpleexp: =1 + exp1: end + fornum: index stop + exp1: begin + expr: + simpleexp: =10 + exp1: end + fornum: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'i' + singlevar: name='i' + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + fornum: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + -- STATEMENT: begin 'for' line=2 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: numerical loop + fornum: begin + fornum: index start + exp1: begin + expr: + simpleexp: =1 + exp1: end + fornum: index stop + exp1: begin + expr: + simpleexp: =10 + exp1: end + fornum: index step + exp1: begin + expr: + simpleexp: =2 + exp1: end + fornum: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'break' line=2 + break_stat: -- break out of loop + -- STATEMENT: end 'break' + leaveblock + block: end + leaveblock + fornum: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + -- STATEMENT: begin 'for' line=3 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: list-based loop + forlist: begin + forlist: explist1 + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + explist1: end + forlist: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'bar' + singlevar: name='bar' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =0 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + forlist: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + -- STATEMENT: begin 'for' line=4 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: list-based loop + forlist: begin + str_checkname: 'j' + forlist: explist1 + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'bar' + singlevar: name='bar' + explist1: end + forlist: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'baz' + singlevar: name='baz' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: =0 + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + forlist: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_12.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_12.lua new file mode 100644 index 0000000..916fc7f --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_12.lua @@ -0,0 +1,46 @@ +-- START OF SOURCE -- +local foo +local foo,bar,baz +local foo,bar="foo","bar" +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=2 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + str_checkname: 'bar' + str_checkname: 'baz' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=3 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + str_checkname: 'bar' + localstat: -- assignment + explist1: begin + expr: + simpleexp: =foo + codestring: "foo" + explist1: ',' -- continuation + expr: + simpleexp: =bar + codestring: "bar" + explist1: end + localstat: end + -- STATEMENT: end 'local' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_13.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_13.lua new file mode 100644 index 0000000..8ddd3ea --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_13.lua @@ -0,0 +1,99 @@ +-- START OF SOURCE -- +local function foo() return end +local function foo(a) return end +local function foo(x,y,z) return end +local function foo(x,...) return end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=1 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=2 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'a' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=2 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=3 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'x' + str_checkname: 'y' + str_checkname: 'z' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=3 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=4 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'x' + parlist: ... (dots) + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=4 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_14.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_14.lua new file mode 100644 index 0000000..aa0069a --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_14.lua @@ -0,0 +1,107 @@ +-- START OF SOURCE -- +function foo() return end +function foo(a) return end +function foo(x,y,z) return end +function foo(x,...) return end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'function' line=1 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=1 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=2 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'a' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=2 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=3 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'x' + str_checkname: 'y' + str_checkname: 'z' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=3 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=4 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'x' + parlist: ... (dots) + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=4 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_15.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_15.lua new file mode 100644 index 0000000..73cdac3 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_15.lua @@ -0,0 +1,135 @@ +-- START OF SOURCE -- +function foo.bar(p) return end +function foo.bar.baz(p) return end +function foo:bar(p) return end +function foo.bar.baz(p) return end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'function' line=1 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: -- '.' field + field: operator=. + checkname: + str_checkname: 'bar' + codestring: "bar" + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'p' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=1 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=2 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: -- '.' field + field: operator=. + checkname: + str_checkname: 'bar' + codestring: "bar" + funcname: -- '.' field + field: operator=. + checkname: + str_checkname: 'baz' + codestring: "baz" + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'p' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=2 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=3 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: -- ':' field + field: operator=: + checkname: + str_checkname: 'bar' + codestring: "bar" + funcname: end + function_stat: body needself='true' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'p' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=3 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + -- STATEMENT: begin 'function' line=4 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar: name='foo' + funcname: -- '.' field + field: operator=. + checkname: + str_checkname: 'bar' + codestring: "bar" + funcname: -- '.' field + field: operator=. + checkname: + str_checkname: 'baz' + codestring: "baz" + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'p' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=4 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_16.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_16.lua new file mode 100644 index 0000000..b53b2fb --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_16.lua @@ -0,0 +1,87 @@ +-- START OF SOURCE -- +foo = function() return end +foo = function(x,y) return end +foo = function(...) return end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: function + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=1 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: function + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'x' + str_checkname: 'y' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=2 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: function + open_func + body: begin + body: parlist + parlist: begin + parlist: ... (dots) + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'return' line=3 + return_stat: no return values + -- STATEMENT: end 'return' + body: end + close_func + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_17.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_17.lua new file mode 100644 index 0000000..87634d3 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_17.lua @@ -0,0 +1,110 @@ +-- START OF SOURCE -- +foo = {} +foo = { 1,2,3; "foo"; } +foo = { bar=77, baz=88, } +foo = { ["bar"]=77, ["baz"]=88, } +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: constructor + constructor: begin + constructor: end + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: constructor + constructor: begin + listfield: expr + expr: + simpleexp: =1 + listfield: expr + expr: + simpleexp: =2 + listfield: expr + expr: + simpleexp: =3 + listfield: expr + expr: + simpleexp: =foo + codestring: "foo" + constructor: end + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: constructor + constructor: begin + recfield: name + checkname: + str_checkname: 'bar' + codestring: "bar" + expr: + simpleexp: =77 + recfield: name + checkname: + str_checkname: 'baz' + codestring: "baz" + expr: + simpleexp: =88 + constructor: end + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'foo' + singlevar: name='foo' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: constructor + constructor: begin + recfield: [ exp1 ] + index: begin '[' + expr: + simpleexp: =bar + codestring: "bar" + index: end ']' + expr: + simpleexp: =77 + recfield: [ exp1 ] + index: begin '[' + expr: + simpleexp: =baz + codestring: "baz" + index: end ']' + expr: + simpleexp: =88 + constructor: end + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_01.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_01.lua new file mode 100644 index 0000000..732b4d6 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_01.lua @@ -0,0 +1,26 @@ +-- START OF SOURCE -- + print(a) +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'expr' line=1 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VGLOBAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_02.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_02.lua new file mode 100644 index 0000000..9863b4a --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_02.lua @@ -0,0 +1,35 @@ +-- START OF SOURCE -- + local a + print(a) +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'a' + new_localvar: 'a' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_03.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_03.lua new file mode 100644 index 0000000..bc37280 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_03.lua @@ -0,0 +1,64 @@ +-- START OF SOURCE -- + do + local a + print(a) + end + print(a) +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'do' line=1 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'local' line=2 + local_stat: local statement + localstat: begin + str_checkname: 'a' + new_localvar: 'a' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VGLOBAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_04.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_04.lua new file mode 100644 index 0000000..b2bac4b --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_04.lua @@ -0,0 +1,77 @@ +-- START OF SOURCE -- + local a,b,c + do + local b + print(b) + end + print(b) +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'a' + new_localvar: 'a' + str_checkname: 'b' + new_localvar: 'b' + str_checkname: 'c' + new_localvar: 'c' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'do' line=2 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'local' line=3 + local_stat: local statement + localstat: begin + str_checkname: 'b' + new_localvar: 'b' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'b' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'expr' line=6 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'b' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_05.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_05.lua new file mode 100644 index 0000000..6885f01 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_05.lua @@ -0,0 +1,43 @@ +-- START OF SOURCE -- + local function foo() end + bar = foo +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + new_localvar: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VGLOBAL' + expr_stat: assignment k='VGLOBAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_06.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_06.lua new file mode 100644 index 0000000..eb658ed --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_06.lua @@ -0,0 +1,70 @@ +-- START OF SOURCE -- + do + local function foo() end + bar = foo + end + baz = foo +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'do' line=1 + do_stat: begin + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'local' line=2 + local_stat: local function + localfunc: begin + str_checkname: 'foo' + new_localvar: 'foo' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VGLOBAL' + expr_stat: assignment k='VGLOBAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + leaveblock + block: end + do_stat: end + -- STATEMENT: end 'do' + + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VGLOBAL' + expr_stat: assignment k='VGLOBAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VGLOBAL' + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_07.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_07.lua new file mode 100644 index 0000000..6403234 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_07.lua @@ -0,0 +1,84 @@ +-- START OF SOURCE -- + local foo + local function bar() + baz = nil + foo = bar() + end + foo = bar +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + new_localvar: 'foo' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=2 + local_stat: local function + localfunc: begin + str_checkname: 'bar' + new_localvar: 'bar' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VGLOBAL' + expr_stat: assignment k='VGLOBAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + simpleexp: nil + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=4 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VUPVAL' + expr_stat: assignment k='VUPVAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VUPVAL' + primaryexp: ( funcargs + funcargs: begin '(' + funcargs: end -- expr is a VCALL + explist1: end + -- STATEMENT: end 'expr' + + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=6 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_08.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_08.lua new file mode 100644 index 0000000..594e267 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_08.lua @@ -0,0 +1,159 @@ +-- START OF SOURCE -- + local foo + local function bar() + local function baz() + local foo, bar + foo = bar + foo = baz + end + foo = bar + foo = baz + end + foo = bar + foo = baz +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + new_localvar: 'foo' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'local' line=2 + local_stat: local function + localfunc: begin + str_checkname: 'bar' + new_localvar: 'bar' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'local' line=3 + local_stat: local function + localfunc: begin + str_checkname: 'baz' + new_localvar: 'baz' + localfunc: body + open_func + body: begin + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'local' line=4 + local_stat: local statement + localstat: begin + str_checkname: 'foo' + new_localvar: 'foo' + str_checkname: 'bar' + new_localvar: 'bar' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=6 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VUPVAL' + explist1: end + -- STATEMENT: end 'expr' + + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=8 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VUPVAL' + expr_stat: assignment k='VUPVAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VUPVAL' + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=9 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VUPVAL' + expr_stat: assignment k='VUPVAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + body: end + close_func + localfunc: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'expr' line=11 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VLOCAL' + explist1: end + -- STATEMENT: end 'expr' + + -- STATEMENT: begin 'expr' line=12 + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + expr_stat: assignment k='VLOCAL' + assignment: '=' -- RHS elements follows + explist1: begin + expr: + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VGLOBAL' + explist1: end + -- STATEMENT: end 'expr' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_09.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_09.lua new file mode 100644 index 0000000..bfa3920 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_09.lua @@ -0,0 +1,53 @@ +-- START OF SOURCE -- + function foo:bar() + print(self) + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'function' line=1 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar(kind): 'VGLOBAL' + funcname: -- ':' field + field: operator=: + checkname: + str_checkname: 'bar' + codestring: "bar" + funcname: end + function_stat: body needself='true' + open_func + body: begin + new_localvar: 'self' + body: parlist + parlist: begin + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'self' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_10.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_10.lua new file mode 100644 index 0000000..9a38883 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_10.lua @@ -0,0 +1,49 @@ +-- START OF SOURCE -- + function foo(...) + print(arg) + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'function' line=1 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar(kind): 'VGLOBAL' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + parlist: ... (dots) + new_localvar: 'arg' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'arg' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_11.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_11.lua new file mode 100644 index 0000000..e4c9e21 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_11.lua @@ -0,0 +1,79 @@ +-- START OF SOURCE -- + local c,d + function foo(a,b,c) + print(a,c,d,e) + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'local' line=1 + local_stat: local statement + localstat: begin + str_checkname: 'c' + new_localvar: 'c' + str_checkname: 'd' + new_localvar: 'd' + localstat: end + -- STATEMENT: end 'local' + + -- STATEMENT: begin 'function' line=2 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar(kind): 'VGLOBAL' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'a' + new_localvar: 'a' + str_checkname: 'b' + new_localvar: 'b' + str_checkname: 'c' + new_localvar: 'c' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VLOCAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'c' + singlevar(kind): 'VLOCAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'd' + singlevar(kind): 'VUPVAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'e' + singlevar(kind): 'VGLOBAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_12.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_12.lua new file mode 100644 index 0000000..b278ba2 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_12.lua @@ -0,0 +1,94 @@ +-- START OF SOURCE -- + function foo(a,b) + local bar = function(c,d) + print(a,b,c,d) + end + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'function' line=1 + function_stat: begin + funcname: begin + str_checkname: 'foo' + singlevar(kind): 'VGLOBAL' + funcname: end + function_stat: body needself='false' + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'a' + new_localvar: 'a' + str_checkname: 'b' + new_localvar: 'b' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'local' line=2 + local_stat: local statement + localstat: begin + str_checkname: 'bar' + new_localvar: 'bar' + localstat: -- assignment + explist1: begin + expr: + simpleexp: function + open_func + body: begin + body: parlist + parlist: begin + str_checkname: 'c' + new_localvar: 'c' + str_checkname: 'd' + new_localvar: 'd' + parlist: end + body: chunk + chunk: + -- STATEMENT: begin 'expr' line=3 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'a' + singlevar(kind): 'VUPVAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'b' + singlevar(kind): 'VUPVAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'c' + singlevar(kind): 'VLOCAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'd' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + body: end + close_func + explist1: end + localstat: end + -- STATEMENT: end 'local' + + body: end + close_func + function_stat: end + -- STATEMENT: end 'function' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_13.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_13.lua new file mode 100644 index 0000000..6e4850c --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_13.lua @@ -0,0 +1,117 @@ +-- START OF SOURCE -- + for i = 1,10 do + print(i) + end + for i = 1,10,-2 do + print(i) + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'for' line=1 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: numerical loop + new_localvar: 'i' + new_localvar: '(for limit)' + new_localvar: '(for step)' + fornum: begin + fornum: index start + exp1: begin + expr: + simpleexp: =1 + exp1: end + fornum: index stop + exp1: begin + expr: + simpleexp: =10 + exp1: end + fornum: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'i' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + fornum: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + -- STATEMENT: begin 'for' line=4 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'i' + for_stat: numerical loop + new_localvar: 'i' + new_localvar: '(for limit)' + new_localvar: '(for step)' + fornum: begin + fornum: index start + exp1: begin + expr: + simpleexp: =1 + exp1: end + fornum: index stop + exp1: begin + expr: + simpleexp: =10 + exp1: end + fornum: index step + exp1: begin + expr: + subexpr: uop='-' + simpleexp: =2 + exp1: end + fornum: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'i' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + fornum: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + close_func +-- TOP: end diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_14.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_14.lua new file mode 100644 index 0000000..f80c33f --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/parser_log/sample_b_14.lua @@ -0,0 +1,125 @@ +-- START OF SOURCE -- + for foo in bar() do + print(foo) + end + for foo,bar,baz in spring() do + print(foo,bar,baz) + end +-- END OF SOURCE -- + +-- TOP: begin + open_func + + chunk: + -- STATEMENT: begin 'for' line=1 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'foo' + for_stat: list-based loop + forlist: begin + new_localvar: '(for generator)' + new_localvar: '(for state)' + new_localvar: 'foo' + forlist: explist1 + explist1: begin + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + funcargs: end -- expr is a VCALL + explist1: end + forlist: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=2 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + forlist: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + -- STATEMENT: begin 'for' line=4 + for_stat: begin + enterblock(isbreakable=false) + str_checkname: 'foo' + for_stat: list-based loop + forlist: begin + new_localvar: '(for generator)' + new_localvar: '(for state)' + new_localvar: 'foo' + str_checkname: 'bar' + new_localvar: 'bar' + str_checkname: 'baz' + new_localvar: 'baz' + forlist: explist1 + explist1: begin + expr: + prefixexp: + str_checkname: 'spring' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + funcargs: end -- expr is a VCALL + explist1: end + forlist: body + enterblock(isbreakable=true) + block: begin + enterblock(isbreakable=false) + chunk: + -- STATEMENT: begin 'expr' line=5 + prefixexp: + str_checkname: 'print' + singlevar(kind): 'VGLOBAL' + primaryexp: ( funcargs + funcargs: begin '(' + explist1: begin + expr: + prefixexp: + str_checkname: 'foo' + singlevar(kind): 'VLOCAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'bar' + singlevar(kind): 'VLOCAL' + explist1: ',' -- continuation + expr: + prefixexp: + str_checkname: 'baz' + singlevar(kind): 'VLOCAL' + explist1: end + funcargs: end -- expr is a VCALL + expr_stat: function call k='VCALL' + -- STATEMENT: end 'expr' + + leaveblock + block: end + leaveblock + forlist: end + leaveblock + for_stat: end + -- STATEMENT: end 'for' + + close_func +-- TOP: end -- cgit v1.1