public string GetVar(string name)
        {
            string value;

            if (_varsDic != null && _varsDic.TryGetValue(name, out value))
            {
                return(value);
            }
            if (_parent != null)
            {
                return(_parent.GetVar(name));
            }
            throw new ArgumentException("Variable '" + name + "' is not defined.");
        }
 private string SubstVars(VarsContainer vars, string str)
 {
     return(_varsRegex.Replace(str,
                               match => vars.GetVar(match.Groups[1].Value)));
 }