diff options
author | Li Jin <dragon-fly@qq.com> | 2024-09-29 16:45:06 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-09-29 16:46:51 +0800 |
commit | 6af288657f5a7c43570ffbe91e1b727a4af5362d (patch) | |
tree | 72f0cb77d3fec4e6d6ab413c112278887ed44d3f /spec/inputs | |
parent | d6d29a4288b96d42c7cabf424beb286bfbd24456 (diff) | |
download | yuescript-6af288657f5a7c43570ffbe91e1b727a4af5362d.tar.gz yuescript-6af288657f5a7c43570ffbe91e1b727a4af5362d.tar.bz2 yuescript-6af288657f5a7c43570ffbe91e1b727a4af5362d.zip |
Disallowed some semantically incorrect syntax to improve code consistency.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/upvalue_func.yue | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/inputs/upvalue_func.yue b/spec/inputs/upvalue_func.yue index d4b3273..378bf60 100644 --- a/spec/inputs/upvalue_func.yue +++ b/spec/inputs/upvalue_func.yue | |||
@@ -208,20 +208,21 @@ GameEngine\schedule (deltaTime) -> -- closure 1 | |||
208 | -- test cases from issue | 208 | -- test cases from issue |
209 | do | 209 | do |
210 | buff_strength = (char, item) -> | 210 | buff_strength = (char, item) -> |
211 | item.buffer.strength? char.stats.strength?::ref() | 211 | item.buffer.strength? char.stats.strength?::ref! |
212 | 212 | ||
213 | local debug_env_before, debug_env_after | 213 | local debug_env_before, debug_env_after |
214 | 214 | ||
215 | exe_func = (func, env) -> | 215 | exe_func = (func, env) -> |
216 | ok, ... = try | 216 | ok, ... = try |
217 | debug_env_before(env) | 217 | debug_env_before env |
218 | func(env) | 218 | func env |
219 | debug_env_after(env) | 219 | debug_env_after env |
220 | catch ex | 220 | catch ex |
221 | -- accessing ex and error | 221 | -- accessing ex and error |
222 | error ex | 222 | error ex |
223 | return ex | 223 | -- implicit return |
224 | ex | ||
224 | if ok | 225 | if ok |
225 | return ... | 226 | return ... |
226 | else | 227 | else |
227 | os.exit(1) | 228 | os.exit 1 |