diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-03-23 15:52:16 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-03-23 15:52:16 +0800 |
| commit | 694068b6dc92269b0221d671bf15b5965ccddff7 (patch) | |
| tree | 6e8341fed267bbac4a8ec819937f983eecab41c9 | |
| parent | 5337b7ed406bfe6c545ae106cedcdd893bd76a99 (diff) | |
| download | yuescript-694068b6dc92269b0221d671bf15b5965ccddff7.tar.gz yuescript-694068b6dc92269b0221d671bf15b5965ccddff7.tar.bz2 yuescript-694068b6dc92269b0221d671bf15b5965ccddff7.zip | |
fixing Linux build.
Diffstat (limited to '')
| -rw-r--r-- | spec/outputs/destructure.lua | 44 | ||||
| -rw-r--r-- | spec/outputs/switch.lua | 64 | ||||
| -rw-r--r-- | src/yuescript/yue_compiler.cpp | 2 |
3 files changed, 55 insertions, 55 deletions
diff --git a/spec/outputs/destructure.lua b/spec/outputs/destructure.lua index cb0eb3f..25e0529 100644 --- a/spec/outputs/destructure.lua +++ b/spec/outputs/destructure.lua | |||
| @@ -478,8 +478,8 @@ do | |||
| 478 | end | 478 | end |
| 479 | do | 479 | do |
| 480 | local _exp_0 = tb | 480 | local _exp_0 = tb |
| 481 | local _tab_0 = type(_exp_0) | 481 | local _type_0 = type(_exp_0) |
| 482 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 482 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 483 | if _tab_0 then | 483 | if _tab_0 then |
| 484 | local name, meta_field | 484 | local name, meta_field |
| 485 | do | 485 | do |
| @@ -537,17 +537,17 @@ do | |||
| 537 | end | 537 | end |
| 538 | do | 538 | do |
| 539 | local _exp_0 = tb | 539 | local _exp_0 = tb |
| 540 | local _tab_0 = type(_exp_0) | 540 | local _type_0 = type(_exp_0) |
| 541 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 541 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 542 | if _tab_0 then | 542 | if _tab_0 then |
| 543 | do | 543 | do |
| 544 | local _obj_0 = _exp_0.a | 544 | local _obj_0 = _exp_0.a |
| 545 | local _type_0 = type(_obj_0) | 545 | local _type_1 = type(_obj_0) |
| 546 | if "table" == _type_0 or "userdata" == _type_0 then | 546 | if "table" == _type_1 or "userdata" == _type_1 then |
| 547 | do | 547 | do |
| 548 | local _obj_1 = getmetatable(_obj_0) | 548 | local _obj_1 = getmetatable(_obj_0) |
| 549 | local _type_1 = type(_obj_1) | 549 | local _type_2 = type(_obj_1) |
| 550 | if "table" == _type_1 or "userdata" == _type_1 then | 550 | if "table" == _type_2 or "userdata" == _type_2 then |
| 551 | add = _obj_1.__add | 551 | add = _obj_1.__add |
| 552 | end | 552 | end |
| 553 | end | 553 | end |
| @@ -555,12 +555,12 @@ do | |||
| 555 | end | 555 | end |
| 556 | do | 556 | do |
| 557 | local _obj_0 = _exp_0.b | 557 | local _obj_0 = _exp_0.b |
| 558 | local _type_0 = type(_obj_0) | 558 | local _type_1 = type(_obj_0) |
| 559 | if "table" == _type_0 or "userdata" == _type_0 then | 559 | if "table" == _type_1 or "userdata" == _type_1 then |
| 560 | do | 560 | do |
| 561 | local _obj_1 = getmetatable(_obj_0) | 561 | local _obj_1 = getmetatable(_obj_0) |
| 562 | local _type_1 = type(_obj_1) | 562 | local _type_2 = type(_obj_1) |
| 563 | if "table" == _type_1 or "userdata" == _type_1 then | 563 | if "table" == _type_2 or "userdata" == _type_2 then |
| 564 | field = _obj_1[fieldName] | 564 | field = _obj_1[fieldName] |
| 565 | end | 565 | end |
| 566 | end | 566 | end |
| @@ -577,17 +577,17 @@ do | |||
| 577 | end | 577 | end |
| 578 | do | 578 | do |
| 579 | local _exp_0 = tb | 579 | local _exp_0 = tb |
| 580 | local _tab_0 = type(_exp_0) | 580 | local _type_0 = type(_exp_0) |
| 581 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 581 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 582 | if _tab_0 then | 582 | if _tab_0 then |
| 583 | do | 583 | do |
| 584 | local _obj_0 = _exp_0.c | 584 | local _obj_0 = _exp_0.c |
| 585 | local _type_0 = type(_obj_0) | 585 | local _type_1 = type(_obj_0) |
| 586 | if "table" == _type_0 or "userdata" == _type_0 then | 586 | if "table" == _type_1 or "userdata" == _type_1 then |
| 587 | do | 587 | do |
| 588 | local _obj_1 = getmetatable(_obj_0) | 588 | local _obj_1 = getmetatable(_obj_0) |
| 589 | local _type_1 = type(_obj_1) | 589 | local _type_2 = type(_obj_1) |
| 590 | if "table" == _type_1 or "userdata" == _type_1 then | 590 | if "table" == _type_2 or "userdata" == _type_2 then |
| 591 | meta_field = _obj_1["abc"] | 591 | meta_field = _obj_1["abc"] |
| 592 | end | 592 | end |
| 593 | end | 593 | end |
| @@ -600,15 +600,15 @@ do | |||
| 600 | local _obj_0 = getmetatable(_exp_0) | 600 | local _obj_0 = getmetatable(_exp_0) |
| 601 | do | 601 | do |
| 602 | local _obj_1 = _obj_0[ [[any string]]] | 602 | local _obj_1 = _obj_0[ [[any string]]] |
| 603 | local _type_0 = type(_obj_1) | 603 | local _type_1 = type(_obj_1) |
| 604 | if "table" == _type_0 or "userdata" == _type_0 then | 604 | if "table" == _type_1 or "userdata" == _type_1 then |
| 605 | abc = _obj_1.d | 605 | abc = _obj_1.d |
| 606 | end | 606 | end |
| 607 | end | 607 | end |
| 608 | do | 608 | do |
| 609 | local _obj_1 = _obj_0['str'] | 609 | local _obj_1 = _obj_0['str'] |
| 610 | local _type_0 = type(_obj_1) | 610 | local _type_1 = type(_obj_1) |
| 611 | if "table" == _type_0 or "userdata" == _type_0 then | 611 | if "table" == _type_1 or "userdata" == _type_1 then |
| 612 | def = _obj_1.e | 612 | def = _obj_1.e |
| 613 | end | 613 | end |
| 614 | end | 614 | end |
diff --git a/spec/outputs/switch.lua b/spec/outputs/switch.lua index 3c48120..1ace1e3 100644 --- a/spec/outputs/switch.lua +++ b/spec/outputs/switch.lua | |||
| @@ -107,43 +107,43 @@ do | |||
| 107 | } | 107 | } |
| 108 | } | 108 | } |
| 109 | do | 109 | do |
| 110 | local _tab_0 = type(dict) | 110 | local _type_0 = type(dict) |
| 111 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 111 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 112 | if _tab_0 then | 112 | if _tab_0 then |
| 113 | local first = dict[1] | 113 | local first = dict[1] |
| 114 | local one | 114 | local one |
| 115 | do | 115 | do |
| 116 | local _obj_0 = dict[2] | 116 | local _obj_0 = dict[2] |
| 117 | local _type_0 = type(_obj_0) | 117 | local _type_1 = type(_obj_0) |
| 118 | if "table" == _type_0 or "userdata" == _type_0 then | 118 | if "table" == _type_1 or "userdata" == _type_1 then |
| 119 | one = _obj_0[1] | 119 | one = _obj_0[1] |
| 120 | end | 120 | end |
| 121 | end | 121 | end |
| 122 | local two | 122 | local two |
| 123 | do | 123 | do |
| 124 | local _obj_0 = dict[2] | 124 | local _obj_0 = dict[2] |
| 125 | local _type_0 = type(_obj_0) | 125 | local _type_1 = type(_obj_0) |
| 126 | if "table" == _type_0 or "userdata" == _type_0 then | 126 | if "table" == _type_1 or "userdata" == _type_1 then |
| 127 | two = _obj_0[2] | 127 | two = _obj_0[2] |
| 128 | end | 128 | end |
| 129 | end | 129 | end |
| 130 | local three | 130 | local three |
| 131 | do | 131 | do |
| 132 | local _obj_0 = dict[2] | 132 | local _obj_0 = dict[2] |
| 133 | local _type_0 = type(_obj_0) | 133 | local _type_1 = type(_obj_0) |
| 134 | if "table" == _type_0 or "userdata" == _type_0 then | 134 | if "table" == _type_1 or "userdata" == _type_1 then |
| 135 | three = _obj_0[3] | 135 | three = _obj_0[3] |
| 136 | end | 136 | end |
| 137 | end | 137 | end |
| 138 | local c | 138 | local c |
| 139 | do | 139 | do |
| 140 | local _obj_0 = dict.a | 140 | local _obj_0 = dict.a |
| 141 | local _type_0 = type(_obj_0) | 141 | local _type_1 = type(_obj_0) |
| 142 | if "table" == _type_0 or "userdata" == _type_0 then | 142 | if "table" == _type_1 or "userdata" == _type_1 then |
| 143 | do | 143 | do |
| 144 | local _obj_1 = _obj_0.b | 144 | local _obj_1 = _obj_0.b |
| 145 | local _type_1 = type(_obj_1) | 145 | local _type_2 = type(_obj_1) |
| 146 | if "table" == _type_1 or "userdata" == _type_1 then | 146 | if "table" == _type_2 or "userdata" == _type_2 then |
| 147 | c = _obj_1.c | 147 | c = _obj_1.c |
| 148 | end | 148 | end |
| 149 | end | 149 | end |
| @@ -152,12 +152,12 @@ do | |||
| 152 | local z | 152 | local z |
| 153 | do | 153 | do |
| 154 | local _obj_0 = dict.x | 154 | local _obj_0 = dict.x |
| 155 | local _type_0 = type(_obj_0) | 155 | local _type_1 = type(_obj_0) |
| 156 | if "table" == _type_0 or "userdata" == _type_0 then | 156 | if "table" == _type_1 or "userdata" == _type_1 then |
| 157 | do | 157 | do |
| 158 | local _obj_1 = _obj_0.y | 158 | local _obj_1 = _obj_0.y |
| 159 | local _type_1 = type(_obj_1) | 159 | local _type_2 = type(_obj_1) |
| 160 | if "table" == _type_1 or "userdata" == _type_1 then | 160 | if "table" == _type_2 or "userdata" == _type_2 then |
| 161 | z = _obj_1.z | 161 | z = _obj_1.z |
| 162 | end | 162 | end |
| 163 | end | 163 | end |
| @@ -184,8 +184,8 @@ do | |||
| 184 | for _index_0 = 1, #items do | 184 | for _index_0 = 1, #items do |
| 185 | local item = items[_index_0] | 185 | local item = items[_index_0] |
| 186 | do | 186 | do |
| 187 | local _tab_0 = type(item) | 187 | local _type_0 = type(item) |
| 188 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 188 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 189 | local _match_0 = false | 189 | local _match_0 = false |
| 190 | if _tab_0 then | 190 | if _tab_0 then |
| 191 | local x = item.x | 191 | local x = item.x |
| @@ -243,8 +243,8 @@ end | |||
| 243 | do | 243 | do |
| 244 | local tb = { } | 244 | local tb = { } |
| 245 | do | 245 | do |
| 246 | local _tab_0 = type(tb) | 246 | local _type_0 = type(tb) |
| 247 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 247 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 248 | if _tab_0 then | 248 | if _tab_0 then |
| 249 | local a = tb.a | 249 | local a = tb.a |
| 250 | local b = tb.b | 250 | local b = tb.b |
| @@ -258,8 +258,8 @@ do | |||
| 258 | end | 258 | end |
| 259 | end | 259 | end |
| 260 | do | 260 | do |
| 261 | local _tab_0 = type(tb) | 261 | local _type_0 = type(tb) |
| 262 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 262 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 263 | if _tab_0 then | 263 | if _tab_0 then |
| 264 | local a = tb.a | 264 | local a = tb.a |
| 265 | local b = tb.b | 265 | local b = tb.b |
| @@ -272,8 +272,8 @@ do | |||
| 272 | end | 272 | end |
| 273 | end | 273 | end |
| 274 | do | 274 | do |
| 275 | local _tab_0 = type(tb) | 275 | local _type_0 = type(tb) |
| 276 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 276 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 277 | local _match_0 = false | 277 | local _match_0 = false |
| 278 | if _tab_0 then | 278 | if _tab_0 then |
| 279 | local a = tb.a | 279 | local a = tb.a |
| @@ -293,8 +293,8 @@ do | |||
| 293 | x = "abc" | 293 | x = "abc" |
| 294 | } | 294 | } |
| 295 | do | 295 | do |
| 296 | local _tab_0 = type(tb) | 296 | local _type_0 = type(tb) |
| 297 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 297 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 298 | local _match_0 = false | 298 | local _match_0 = false |
| 299 | if _tab_0 then | 299 | if _tab_0 then |
| 300 | local x = tb.x | 300 | local x = tb.x |
| @@ -321,8 +321,8 @@ do | |||
| 321 | if 1 == _exp_0 then | 321 | if 1 == _exp_0 then |
| 322 | matched = "1" | 322 | matched = "1" |
| 323 | else | 323 | else |
| 324 | local _tab_0 = type(_exp_0) | 324 | local _type_0 = type(_exp_0) |
| 325 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 325 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 326 | local _match_0 = false | 326 | local _match_0 = false |
| 327 | if _tab_0 then | 327 | if _tab_0 then |
| 328 | local x = _exp_0.x | 328 | local x = _exp_0.x |
| @@ -347,8 +347,8 @@ do | |||
| 347 | return "invalid" | 347 | return "invalid" |
| 348 | else | 348 | else |
| 349 | do | 349 | do |
| 350 | local _tab_0 = type(_exp_0) | 350 | local _type_0 = type(_exp_0) |
| 351 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 351 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 352 | local _match_0 = false | 352 | local _match_0 = false |
| 353 | if _tab_0 then | 353 | if _tab_0 then |
| 354 | local a = _exp_0.a | 354 | local a = _exp_0.a |
| @@ -382,8 +382,8 @@ end | |||
| 382 | do | 382 | do |
| 383 | do | 383 | do |
| 384 | local _exp_0 = y | 384 | local _exp_0 = y |
| 385 | local _tab_0 = type(_exp_0) | 385 | local _type_0 = type(_exp_0) |
| 386 | _tab_0 = "table" == _tab_0 or "userdata" == _tab_0 | 386 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 |
| 387 | if _tab_0 then | 387 | if _tab_0 then |
| 388 | local mt = (function() | 388 | local mt = (function() |
| 389 | local _obj_0 = _exp_0.x | 389 | local _obj_0 = _exp_0.x |
diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 07c0e70..8a63098 100644 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp | |||
| @@ -170,7 +170,7 @@ public: | |||
| 170 | options = std::make_unique<Options>(config.options); | 170 | options = std::make_unique<Options>(config.options); |
| 171 | } | 171 | } |
| 172 | DEFER(clear()); | 172 | DEFER(clear()); |
| 173 | if (_info.node) { | 173 | if (!_info.error) { |
| 174 | try { | 174 | try { |
| 175 | auto block = _info.node.to<File_t>()->block.get(); | 175 | auto block = _info.node.to<File_t>()->block.get(); |
| 176 | if (_info.exportMacro) { | 176 | if (_info.exportMacro) { |
