diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-17 17:57:26 -0400 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2020-08-17 17:57:26 -0400 |
commit | 40ddf423fd255a26e5cb8218c61341f99a2049cd (patch) | |
tree | 5a4f83df4a6b90a0ba4af99d78ecb52b77922d52 /core/assert.lua | |
parent | b3cbff3e4e80aac25f922d7fec4e198c6dde95b3 (diff) |
Lua code formatting.
Diffstat (limited to 'core/assert.lua')
-rw-r--r-- | core/assert.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/assert.lua b/core/assert.lua index 5517aaa3..96a32b05 100644 --- a/core/assert.lua +++ b/core/assert.lua @@ -42,16 +42,18 @@ function assert_type(v, expected_type, narg) if type(v) == expected_type then return v end -- Note: do not use assert for performance reasons. if type(expected_type) ~= 'string' then - error(string.format("bad argument #2 to '%s' (string expected, got %s)", - debug.getinfo(1, 'n').name, type(expected_type)), 2) + error(string.format( + "bad argument #2 to '%s' (string expected, got %s)", + debug.getinfo(1, 'n').name, type(expected_type)), 2) elseif narg == nil then - error(string.format("bad argument #3 to '%s' (value expected, got %s)", - debug.getinfo(1, 'n').name, type(narg)), 2) + error(string.format( + "bad argument #3 to '%s' (value expected, got %s)", + debug.getinfo(1, 'n').name, type(narg)), 2) end for type_option in expected_type:gmatch('%a+') do if type(v) == type_option then return v end end - error(string.format("bad argument #%s to '%s' (%s expected, got %s)", narg, - debug.getinfo(2, 'n').name or '?', expected_type, - type(v)), 3) + error(string.format( + "bad argument #%s to '%s' (%s expected, got %s)", narg, + debug.getinfo(2, 'n').name or '?', expected_type, type(v)), 3) end |