diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-04-01 17:47:27 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-04-01 17:47:27 +0800 |
| commit | ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1 (patch) | |
| tree | bf86d3990b90054f8d82aaf87cb9efae444a08ce /spec/outputs | |
| parent | 7be6c300256bfe411942a7ccc66f6bc3afa7390d (diff) | |
| download | yuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.tar.gz yuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.tar.bz2 yuescript-ca1ed557769352c0ac0ca7804dd25e18c1fdf2e1.zip | |
fix some ambiguous syntax caused by arg table block.
Diffstat (limited to 'spec/outputs')
| -rw-r--r-- | spec/outputs/ambiguous.lua | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/spec/outputs/ambiguous.lua b/spec/outputs/ambiguous.lua index 6039d73..f96cee5 100644 --- a/spec/outputs/ambiguous.lua +++ b/spec/outputs/ambiguous.lua | |||
| @@ -27,4 +27,73 @@ end | |||
| 27 | do | 27 | do |
| 28 | print(123) | 28 | print(123) |
| 29 | end | 29 | end |
| 30 | do | ||
| 31 | f({ | ||
| 32 | v = v | ||
| 33 | }) | ||
| 34 | local tb | ||
| 35 | do | ||
| 36 | local _accum_0 = { } | ||
| 37 | local _len_0 = 1 | ||
| 38 | while f do | ||
| 39 | _accum_0[_len_0] = { | ||
| 40 | v = v | ||
| 41 | } | ||
| 42 | _len_0 = _len_0 + 1 | ||
| 43 | end | ||
| 44 | tb = _accum_0 | ||
| 45 | end | ||
| 46 | repeat | ||
| 47 | print(v) | ||
| 48 | until f({ | ||
| 49 | v = v | ||
| 50 | }) | ||
| 51 | do | ||
| 52 | local _with_0 = f | ||
| 53 | local v = tb.v | ||
| 54 | _with_0.x = 1 | ||
| 55 | end | ||
| 56 | local x | ||
| 57 | if f then | ||
| 58 | x = { | ||
| 59 | v = v | ||
| 60 | } | ||
| 61 | end | ||
| 62 | do | ||
| 63 | local _exp_0 = f({ | ||
| 64 | v = v | ||
| 65 | }) | ||
| 66 | if f == _exp_0 then | ||
| 67 | x = { | ||
| 68 | v = v | ||
| 69 | } | ||
| 70 | end | ||
| 71 | end | ||
| 72 | local nums | ||
| 73 | do | ||
| 74 | local _accum_0 = { } | ||
| 75 | local _len_0 = 1 | ||
| 76 | for num = 1, len do | ||
| 77 | _accum_0[_len_0] = { | ||
| 78 | num = num | ||
| 79 | } | ||
| 80 | _len_0 = _len_0 + 1 | ||
| 81 | end | ||
| 82 | nums = _accum_0 | ||
| 83 | end | ||
| 84 | local objects | ||
| 85 | do | ||
| 86 | local _accum_0 = { } | ||
| 87 | local _len_0 = 1 | ||
| 88 | local _list_0 = items | ||
| 89 | for _index_0 = 1, #_list_0 do | ||
| 90 | local item = _list_0[_index_0] | ||
| 91 | _accum_0[_len_0] = { | ||
| 92 | name = item | ||
| 93 | } | ||
| 94 | _len_0 = _len_0 + 1 | ||
| 95 | end | ||
| 96 | objects = _accum_0 | ||
| 97 | end | ||
| 98 | end | ||
| 30 | return nil | 99 | return nil |
