public static ValueProviderBase?TryParse(string typeToken, string variable, ITemplateParser tp)
        {
            var type  = typeToken.TryBefore(":") ?? "";
            var token = typeToken.TryAfter(":") ?? typeToken;

            switch (type)
            {
            case "":
            {
                if (token.StartsWith("$"))
                {
                    string v = token.TryBefore('.') ?? token;

                    if (!tp.Variables.TryGetValue(v, out ValueProviderBase? vp))
                    {
                        tp.AddError(false, "Variable '{0}' is not defined at this scope".FormatWith(v));
                        return(null);
                    }

                    if (!(vp is TokenValueProvider))
                    {
                        return(new ContinueValueProvider(token.TryAfter('.'), vp, tp.AddError));
                    }
                }

                ParsedToken result = ParsedToken.TryParseToken(token, SubTokensOptions.CanElement, tp.QueryDescription, tp.Variables, tp.AddError);

                if (result.QueryToken != null && TranslateInstanceValueProvider.IsTranslateInstanceCanditate(result.QueryToken))
                {
                    return new TranslateInstanceValueProvider(result, false, tp.AddError)
                           {
                               Variable = variable
                           }
                }
                ;
                else
                {
                    return new TokenValueProvider(result, false)
                           {
                               Variable = variable
                           }
                };
            }

            case "q":
            {
                ParsedToken result = ParsedToken.TryParseToken(token, SubTokensOptions.CanElement, tp.QueryDescription, tp.Variables, tp.AddError);

                return(new TokenValueProvider(result, true)
                    {
                        Variable = variable
                    });
            }

            case "t":
            {
                ParsedToken result = ParsedToken.TryParseToken(token, SubTokensOptions.CanElement, tp.QueryDescription, tp.Variables, tp.AddError);

                return(new TranslateInstanceValueProvider(result, true, tp.AddError)
                    {
                        Variable = variable
                    });
            }

            case "m":
                return(new ModelValueProvider(token, tp.ModelType, tp.AddError)
                {
                    Variable = variable
                });

            case "g":
                return(new GlobalValueProvider(token, tp.AddError)
                {
                    Variable = variable
                });

            case "d":
                return(new DateValueProvider(token, tp.AddError)
                {
                    Variable = variable
                });

            default:
                tp.AddError(false, "{0} is not a recognized value provider (q:Query, t:Translate, m:Model, g:Global or just blank)");
                return(null);
            }
        }