/// <summary> /// Creates a rule with the enumeration of tokens. /// </summary> public CssRule CreateRule(CssToken token) { switch (token.Type) { case CssTokenType.AtKeyword: return(CreateAtRule(token)); case CssTokenType.CurlyBracketOpen: _tokenizer.RaiseErrorOccurred(CssParseError.InvalidBlockStart, token.Position); _tokenizer.SkipUnknownRule(); return(null); case CssTokenType.String: case CssTokenType.Url: case CssTokenType.CurlyBracketClose: case CssTokenType.RoundBracketClose: case CssTokenType.SquareBracketClose: _tokenizer.RaiseErrorOccurred(CssParseError.InvalidToken, token.Position); _tokenizer.SkipUnknownRule(); return(null); default: return(CreateStyle(token)); } }
void RaiseErrorOccurred(CssParseError code, CssToken token) { _tokenizer.RaiseErrorOccurred(code, token.Position); }
void RaiseErrorOccurred(CssParseError code, TextPosition position) { _tokenizer.RaiseErrorOccurred(code, position); }