# HG changeset patch # User Matthew Wild <mwild1@gmail.com> # Date 1553084383 0 # Node ID c9f5ccdcdf80510ef5efa9a0685410647e66d960 # Parent dfaeea570f7e88f5ef3fe735b8262038a7ba36b5 configmanager: Add support for returning warnings diff -r dfaeea570f7e -r c9f5ccdcdf80 core/configmanager.lua --- a/core/configmanager.lua Wed Mar 20 12:18:34 2019 +0000 +++ b/core/configmanager.lua Wed Mar 20 12:19:43 2019 +0000 @@ -9,7 +9,7 @@ local _G = _G; local setmetatable, rawget, rawset, io, os, error, dofile, type, pairs = setmetatable, rawget, rawset, io, os, error, dofile, type, pairs; -local format, math_max = string.format, math.max; +local format, math_max, t_insert = string.format, math.max, table.insert; local envload = require"util.envload".envload; local deps = require"util.dependencies"; @@ -102,6 +102,7 @@ local pcall = _G.pcall; parser = {}; function parser.load(data, config_file, config_table) + local warnings = {}; local env; -- The ' = true' are needed so as not to set off __newindex when we assign the functions below env = setmetatable({ @@ -217,7 +218,7 @@ return nil, err; end - return true; + return true, warnings; end end