Example #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()));
            }
        }
Example #2
0
 public virtual CssComponent ParseAtRulePrelude(CssParser.Scope parser)
 {
     return(ParsePrelude(parser));
 }
Example #3
0
 public virtual IEnumerable <CssComponent> ParseAtRuleBlock(CssParser.Scope parser)
 {
     return(parser.ParseComponentList());
 }
 public override IEnumerable <CssComponent> ParseAtRuleBlock(CssParser.Scope parser)
 {
     return(parser.ParseDeclarationList());
 }