(n int, typs ...LValueType)
| 113 | } |
| 114 | |
| 115 | func (ls *LState) CheckTypes(n int, typs ...LValueType) { |
| 116 | vt := ls.Get(n).Type() |
| 117 | for _, typ := range typs { |
| 118 | if vt == typ { |
| 119 | return |
| 120 | } |
| 121 | } |
| 122 | buf := []string{} |
| 123 | for _, typ := range typs { |
| 124 | buf = append(buf, typ.String()) |
| 125 | } |
| 126 | ls.ArgError(n, strings.Join(buf, " or ")+" expected, got "+ls.Get(n).Type().String()) |
| 127 | } |
| 128 | |
| 129 | func (ls *LState) CheckOption(n int, options []string) int { |
| 130 | str := ls.CheckString(n) |