public override MemberModel GetModel(string name) { if (_modelCache == null) { var models = TypeVars.Concat <MemberModel>(NamedTuples).Concat(Classes).Concat(Functions).Concat(Variables); _modelCache = new Dictionary <string, MemberModel>(); foreach (var m in models) { Debug.Assert(!_modelCache.ContainsKey(m.Name)); _modelCache[m.Name] = m; } } return(_modelCache.TryGetValue(name, out var model) ? model : null); }
internal KeyAndValue(string key, string value) { Key = key; Value = value; int res = 0; bool ok = int.TryParse(Value, out res); if (ok) { Type = TypeVars.Int; } else { Type = TypeVars.String; } }
protected override IEnumerable <MemberModel> GetMemberModels() => TypeVars.Concat <MemberModel>(NamedTuples).Concat(Classes).Concat(Functions).Concat(Variables);