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())); } }
public virtual IEnumerable <CssComponent> ParseAtRuleBlock(CssParser.Scope parser) { return(parser.ParseComponentList()); }