public override CssRule Create(CssToken current) { var token = _tokenizer.Get(); var rule = new CssMediaRule(_parser); FillMediaList(rule.Media, ref token); if (token.Type != CssTokenType.CurlyBracketOpen) return SkipDeclarations(token); FillRules(rule); return rule; }
public CssRule CreateMedia(CssToken current) { var token = _tokenizer.Get(); var rule = new CssMediaRule(_parser); FillMediaList(rule.Media, CssTokenType.CurlyBracketOpen, ref token); if (token.Type != CssTokenType.CurlyBracketOpen) { while (token.Type != CssTokenType.Eof) { if (token.Type == CssTokenType.Semicolon) return null; else if (token.Type == CssTokenType.CurlyBracketOpen) break; token = _tokenizer.Get(); } } FillRules(rule); return rule; }
public CssRule CreateMedia(CssToken current) { var rule = new CssMediaRule(_parser); var start = current.Position; var token = NextToken(); _nodes.Push(rule); CollectTrivia(ref token); FillMediaList(rule.Media, CssTokenType.CurlyBracketOpen, ref token); CollectTrivia(ref token); if (token.Type != CssTokenType.CurlyBracketOpen) { while (token.Type != CssTokenType.EndOfFile) { if (token.Type == CssTokenType.Semicolon) { _nodes.Pop(); return null; } else if (token.Type == CssTokenType.CurlyBracketOpen) { break; } token = NextToken(); } } var end = FillRules(rule); rule.SourceCode = CreateView(start, end); _nodes.Pop(); return rule; }