@@ -289,16 +289,24 @@ end
289
289
const valid_opts = [:header , :has_header , :use_mmap , :quotes , :comments , :dims , :comment_char , :skipstart , :skipblanks ]
290
290
const valid_opt_types = [Bool, Bool, Bool, Bool, Bool, NTuple{2 ,Integer}, Char, Integer, Bool]
291
291
const deprecated_opts = Dict (:has_header => :header )
292
+
292
293
function val_opts (opts)
293
294
d = Dict {Symbol,Union{Bool,NTuple{2,Integer},Char,Integer}} ()
294
295
for (opt_name, opt_val) in opts
295
- ! in (opt_name, valid_opts) && throw (ArgumentError (" unknown option $opt_name " ))
296
+ if opt_name == :ignore_invalid_chars
297
+ Base. depwarn (" the ignore_invalid_chars option is no longer supported and will be ignored" , :val_opts )
298
+ continue
299
+ end
300
+ in (opt_name, valid_opts) ||
301
+ throw (ArgumentError (" unknown option $opt_name " ))
296
302
opt_typ = valid_opt_types[findfirst (valid_opts, opt_name)]
297
- ! isa (opt_val, opt_typ) && throw (ArgumentError (" $opt_name should be of type $opt_typ , got $(typeof (opt_val)) " ))
303
+ isa (opt_val, opt_typ) ||
304
+ throw (ArgumentError (" $opt_name should be of type $opt_typ , got $(typeof (opt_val)) " ))
298
305
d[opt_name] = opt_val
299
- haskey (deprecated_opts, opt_name) && warn (" $opt_name is deprecated, use $(deprecated_opts[opt_name]) instead" )
306
+ haskey (deprecated_opts, opt_name) &&
307
+ Base. depwarn (" $opt_name is deprecated, use $(deprecated_opts[opt_name]) instead" , :val_opts )
300
308
end
301
- d
309
+ return d
302
310
end
303
311
304
312
function dlm_fill (T:: DataType , offarr:: Vector{Vector{Int}} , dims:: NTuple{2,Integer} , has_header:: Bool , sbuff:: String , auto:: Bool , eol:: Char )
0 commit comments