diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
| commit | e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch) | |
| tree | 6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/outputs/unicode/in_expression.lua | |
| parent | 289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff) | |
| download | yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2 yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip | |
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec/outputs/unicode/in_expression.lua')
| -rw-r--r-- | spec/outputs/unicode/in_expression.lua | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/spec/outputs/unicode/in_expression.lua b/spec/outputs/unicode/in_expression.lua new file mode 100644 index 0000000..62aad05 --- /dev/null +++ b/spec/outputs/unicode/in_expression.lua | |||
| @@ -0,0 +1,181 @@ | |||
| 1 | _u51fd_u6570((function() | ||
| 2 | local _val_0 = -_u53d8_u91cfa ^ 2 | ||
| 3 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 4 | end)()) | ||
| 5 | local _u53d8_u91cfa, _u53d8_u91cfb = (function(...) | ||
| 6 | local _val_0 = _u51fd_u6570x(...) | ||
| 7 | return not (1 <= _val_0 and _val_0 <= 3) | ||
| 8 | end)(...), 2 | ||
| 9 | local _u53d8_u91cfd | ||
| 10 | do | ||
| 11 | local _val_0 = (_u5bf9_u8c61["字段x"]["字段y"](...)) | ||
| 12 | _u53d8_u91cfd = not (1 <= _val_0 and _val_0 <= 3) | ||
| 13 | end | ||
| 14 | local _u5728_u7684 | ||
| 15 | do | ||
| 16 | local _val_0 = "东" | ||
| 17 | _u5728_u7684 = "东" == _val_0 or "西" == _val_0 | ||
| 18 | end | ||
| 19 | if (1 == _u53d8_u91cfa) and (2 == _u53d8_u91cfb or 3 == _u53d8_u91cfb or 4 == _u53d8_u91cfb) or (function() | ||
| 20 | local _val_0 = _u53d8_u91cfc | ||
| 21 | return 1 <= _val_0 and _val_0 <= 10 | ||
| 22 | end)() then | ||
| 23 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc) | ||
| 24 | end | ||
| 25 | do | ||
| 26 | local _exp_0 = _u503c | ||
| 27 | if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 then | ||
| 28 | _u6253_u5370("1, 2, 3") | ||
| 29 | elseif not (0 < _exp_0 and _exp_0 <= 100) then | ||
| 30 | _u6253_u5370("非 (0 < 值 <= 100)") | ||
| 31 | elseif (200 <= _exp_0 and _exp_0 < 300) then | ||
| 32 | _u6253_u5370("200 <= 值 < 300)") | ||
| 33 | elseif not (333 == _exp_0 or 444 == _exp_0 or 555 == _exp_0) then | ||
| 34 | _u6253_u5370("非 333, 444 或 555") | ||
| 35 | end | ||
| 36 | end | ||
| 37 | do | ||
| 38 | local _val_0 = _u53d8_u91cfy | ||
| 39 | return not (_u5f00_u59cb < _val_0 and _val_0 < _u7ed3_u675f) | ||
| 40 | end | ||
| 41 | do | ||
| 42 | local _u5b58_u5728 | ||
| 43 | do | ||
| 44 | local _check_0 = _u8868 | ||
| 45 | local _val_0 = _u5143_u7d20 | ||
| 46 | local _find_0 = false | ||
| 47 | for _index_0 = 1, #_check_0 do | ||
| 48 | local _item_0 = _check_0[_index_0] | ||
| 49 | if _item_0 == _val_0 then | ||
| 50 | _find_0 = true | ||
| 51 | break | ||
| 52 | end | ||
| 53 | end | ||
| 54 | _u5b58_u5728 = _find_0 | ||
| 55 | end | ||
| 56 | _u68c0_u67e5((function() | ||
| 57 | local _check_0 = _u8868 | ||
| 58 | local _val_0 = _u5143_u7d20 | ||
| 59 | for _index_0 = 1, #_check_0 do | ||
| 60 | if _check_0[_index_0] == _val_0 then | ||
| 61 | return true | ||
| 62 | end | ||
| 63 | end | ||
| 64 | return false | ||
| 65 | end)()) | ||
| 66 | end | ||
| 67 | do | ||
| 68 | local _u5bf9_u8c61 = _u83b7_u53d6() | ||
| 69 | local _u5b58_u5728 | ||
| 70 | do | ||
| 71 | local _check_0 = _u8868 | ||
| 72 | local _val_0 = _u5143_u7d20 | ||
| 73 | local _find_0 = false | ||
| 74 | for _index_0 = 1, #_check_0 do | ||
| 75 | local _item_0 = _check_0[_index_0] | ||
| 76 | if _item_0 == _val_0 then | ||
| 77 | _find_0 = true | ||
| 78 | break | ||
| 79 | end | ||
| 80 | end | ||
| 81 | _u5b58_u5728 = _find_0 | ||
| 82 | end | ||
| 83 | _u68c0_u67e5((function() | ||
| 84 | local _check_0 = _u8868 | ||
| 85 | local _val_0 = _u5143_u7d20 | ||
| 86 | for _index_0 = 1, #_check_0 do | ||
| 87 | if _check_0[_index_0] == _val_0 then | ||
| 88 | return true | ||
| 89 | end | ||
| 90 | end | ||
| 91 | return false | ||
| 92 | end)()) | ||
| 93 | end | ||
| 94 | do | ||
| 95 | local _u5bf9_u8c61 = _u83b7_u53d6() | ||
| 96 | local _u5217_u8868 = { | ||
| 97 | 1, | ||
| 98 | 2, | ||
| 99 | 3 | ||
| 100 | } | ||
| 101 | local _u4e0d_u5b58_u5728 | ||
| 102 | do | ||
| 103 | local _val_0 = _u5143_u7d20 | ||
| 104 | local _find_0 = false | ||
| 105 | for _index_0 = 1, #_u5217_u8868 do | ||
| 106 | local _item_0 = _u5217_u8868[_index_0] | ||
| 107 | if _item_0 == _val_0 then | ||
| 108 | _find_0 = true | ||
| 109 | break | ||
| 110 | end | ||
| 111 | end | ||
| 112 | _u4e0d_u5b58_u5728 = not _find_0 | ||
| 113 | end | ||
| 114 | _u68c0_u67e5((function() | ||
| 115 | local _val_0 = _u5143_u7d20 | ||
| 116 | for _index_0 = 1, #_u5217_u8868 do | ||
| 117 | if _u5217_u8868[_index_0] == _val_0 then | ||
| 118 | return true | ||
| 119 | end | ||
| 120 | end | ||
| 121 | return false | ||
| 122 | end)()) | ||
| 123 | _u68c0_u67e5((function() | ||
| 124 | local _val_0 = _u5143_u7d20 | ||
| 125 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
| 126 | end)()) | ||
| 127 | _u68c0_u67e5((function(...) | ||
| 128 | local _check_0 = { | ||
| 129 | [1] = 1, | ||
| 130 | [2] = 2, | ||
| 131 | [3] = 3 | ||
| 132 | } | ||
| 133 | local _val_0 = _u5143_u7d20(...) | ||
| 134 | for _index_0 = 1, #_check_0 do | ||
| 135 | if _check_0[_index_0] == _val_0 then | ||
| 136 | return true | ||
| 137 | end | ||
| 138 | end | ||
| 139 | return false | ||
| 140 | end)(...)) | ||
| 141 | end | ||
| 142 | do | ||
| 143 | _u68c0_u67e5(function() | ||
| 144 | local _check_0 = _u6570_u7ec4tb | ||
| 145 | local _val_0 = _u5bf9_u8c61x | ||
| 146 | for _index_0 = 1, #_check_0 do | ||
| 147 | if _check_0[_index_0] == _val_0 then | ||
| 148 | return true | ||
| 149 | end | ||
| 150 | end | ||
| 151 | return false | ||
| 152 | end) | ||
| 153 | _u68c0_u67e5(function() | ||
| 154 | local _check_0 = _u6570_u7ec4tb | ||
| 155 | local _val_0 = _u5bf9_u8c61x | ||
| 156 | for _index_0 = 1, #_check_0 do | ||
| 157 | if _check_0[_index_0] == _val_0 then | ||
| 158 | return false | ||
| 159 | end | ||
| 160 | end | ||
| 161 | return true | ||
| 162 | end) | ||
| 163 | local _u5bf9_u8c61x, _u6570_u7ec4tb | ||
| 164 | _u68c0_u67e5(function() | ||
| 165 | for _index_0 = 1, #_u6570_u7ec4tb do | ||
| 166 | if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then | ||
| 167 | return true | ||
| 168 | end | ||
| 169 | end | ||
| 170 | return false | ||
| 171 | end) | ||
| 172 | _u68c0_u67e5(function() | ||
| 173 | for _index_0 = 1, #_u6570_u7ec4tb do | ||
| 174 | if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then | ||
| 175 | return false | ||
| 176 | end | ||
| 177 | end | ||
| 178 | return true | ||
| 179 | end) | ||
| 180 | end | ||
| 181 | return nil | ||
