コード例 #1
0
        private static CssComponent ParsePrelude(CssParser.Scope parser)
        {
            using (var componentsEnum = parser.ParseComponentList().GetEnumerator())
            {
                if (!componentsEnum.MoveNext())
                {
                    return(CssComponent.Empty);
                }

                var firstComponent = componentsEnum.Current;
                if (!componentsEnum.MoveNext())
                {
                    return(firstComponent);
                }

                var components = ImmutableArray.CreateBuilder <CssComponent>();
                components.Add(firstComponent);
                do
                {
                    components.Add(componentsEnum.Current);
                } while (componentsEnum.MoveNext());

                return(new CssCompositeComponent(components.ToImmutable()));
            }
        }
コード例 #2
0
 public virtual IEnumerable <CssComponent> ParseAtRuleBlock(CssParser.Scope parser)
 {
     return(parser.ParseComponentList());
 }