diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-24 12:24:10 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-24 12:24:10 +0800 |
| commit | 0ccf4408271c8a0d147e3cf25689810862e8c1db (patch) | |
| tree | 0316978c886bee79db8f77cfe4521518763be71c /spec/outputs/switch.lua | |
| parent | c2a34e380b7ff57b071f8081e1cac589eab664d3 (diff) | |
| download | yuescript-0ccf4408271c8a0d147e3cf25689810862e8c1db.tar.gz yuescript-0ccf4408271c8a0d147e3cf25689810862e8c1db.tar.bz2 yuescript-0ccf4408271c8a0d147e3cf25689810862e8c1db.zip | |
Cleaned up and fixed more comment reserving codes.v0.33.4
Diffstat (limited to 'spec/outputs/switch.lua')
| -rw-r--r-- | spec/outputs/switch.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/outputs/switch.lua b/spec/outputs/switch.lua index 7c1004b..fb674e9 100644 --- a/spec/outputs/switch.lua +++ b/spec/outputs/switch.lua | |||
| @@ -777,4 +777,48 @@ do | |||
| 777 | "view" | 777 | "view" |
| 778 | }) | 778 | }) |
| 779 | end | 779 | end |
| 780 | do | ||
| 781 | local _check_cond_expr | ||
| 782 | _check_cond_expr = function(iftyp, n, args) | ||
| 783 | local sw = { | ||
| 784 | ct = iftyp, | ||
| 785 | op = op | ||
| 786 | } | ||
| 787 | local why | ||
| 788 | local _type_0 = type(sw) | ||
| 789 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
| 790 | local _match_0 = false | ||
| 791 | if _tab_0 then | ||
| 792 | if 'if' == sw.ct and '==' == sw.op then | ||
| 793 | _match_0 = true | ||
| 794 | why = 'never' | ||
| 795 | end | ||
| 796 | end | ||
| 797 | if not _match_0 then | ||
| 798 | local _match_1 = false | ||
| 799 | if _tab_0 then | ||
| 800 | if 'if' == sw.ct and '!=' == sw.op then | ||
| 801 | _match_1 = true | ||
| 802 | why = 'always' | ||
| 803 | end | ||
| 804 | end | ||
| 805 | if not _match_1 then | ||
| 806 | local _match_2 = false | ||
| 807 | if _tab_0 then | ||
| 808 | if 'unless' == sw.ct and '==' == sw.op then | ||
| 809 | _match_2 = true | ||
| 810 | why = 'always' | ||
| 811 | end | ||
| 812 | end | ||
| 813 | if not _match_2 then | ||
| 814 | if _tab_0 then | ||
| 815 | if 'unless' == sw.ct and '!=' == sw.op then | ||
| 816 | why = 'never' | ||
| 817 | end | ||
| 818 | end | ||
| 819 | end | ||
| 820 | end | ||
| 821 | end | ||
| 822 | end | ||
| 823 | end | ||
| 780 | return nil | 824 | return nil |
