public static List <string> GetStyleKeywords(string binding) { if (string.IsNullOrEmpty(binding)) { return(StyleFieldConstants.KLDefault); } var syntaxParser = new StyleSyntaxParser(); #if UNITY_2019_3_OR_NEWER var syntaxFound = StylePropertyCache.TryGetSyntax(binding, out var syntax); #else var syntaxFound = StyleFieldConstants.StylePropertySyntaxCache.TryGetValue(binding, out var syntax); #endif if (!syntaxFound) { return(StyleFieldConstants.KLDefault); } var expression = syntaxParser.Parse(syntax); if (expression == null) { return(StyleFieldConstants.KLDefault); } var hasAuto = FindKeywordInExpression(expression, StyleFieldConstants.KeywordAuto); var hasNone = FindKeywordInExpression(expression, StyleFieldConstants.KeywordNone); if (hasAuto) { return(StyleFieldConstants.KLAuto); } else if (hasNone) { return(StyleFieldConstants.KLNone); } return(StyleFieldConstants.KLDefault); }
public StyleValidator() { m_SyntaxParser = new StyleSyntaxParser(); m_StyleMatcher = new StyleMatcher(); }
public StyleValidator() { m_StylePropertyInfoCache = new StylePropertyInfoCache(); m_SyntaxParser = new StyleSyntaxParser(m_StylePropertyInfoCache); m_StyleMatcher = new StyleMatcher(); }