File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
### Functions
8
8
9
- - ` void check(string patern)`
10
- Check function arguments by pattern. It causes an error "bad argument" if the check failed.
9
+ - ` boolean check(string patern)`
10
+ Check function arguments by pattern. It causes an error "bad argument" if the check failed, otherwise returns 'true' .
11
11
12
12
- ` boolean scheck(string pattern) `
13
13
Soft check function arguments by pattern. It causes a warning "bad argument" and returns 'false' if the check failed, otherwise returns 'true'.
@@ -188,7 +188,7 @@ function test()
188
188
checkers .percent = function (v ) return type (v ) == " number" and v >= 0 and v <= 1 end
189
189
iprint (f (0.1 )) -- true
190
190
iprint (f (1 )) -- true
191
- iprint (f (1.1 )) -- error: bad argument #3 'num' to 'f' (percent expected, got number)
191
+ iprint (f (1.1 )) -- error: bad argument #1 'num' to 'f' (percent expected, got number)
192
192
end
193
193
```
194
194
You can’t perform that action at this time.
0 commit comments