private void CollectTrivia(ref CssToken token) { var storeComments = false; while (token.Type == CssTokenType.Whitespace || token.Type == CssTokenType.Comment || token.Type == CssTokenType.Cdc || token.Type == CssTokenType.Cdo) { if (storeComments && token.Type == CssTokenType.Comment) { var comment = new CssComment(token.Data); //TODO What should be done with the comment? } token = _tokenizer.Get(); } }
void CollectTrivia(ref CssToken token) { var storeComments = _parser.Options.IsStoringTrivia; while (token.Type == CssTokenType.Whitespace || token.Type == CssTokenType.Comment || token.Type == CssTokenType.Cdc || token.Type == CssTokenType.Cdo) { if (storeComments && token.Type == CssTokenType.Comment) { var current = _nodes.Peek(); var comment = new CssComment(token.Data); var start = token.Position; var end = start.After(token.ToValue()); comment.SourceCode = CreateView(start, end); current.AppendChild(comment); } token = _tokenizer.Get(); } }
private void CollectTrivia(ref CssToken token) { var storeComments = _parser.Options.IsStoringTrivia; while (token.Type == CssTokenType.Whitespace || token.Type == CssTokenType.Comment || token.Type == CssTokenType.Cdc || token.Type == CssTokenType.Cdo) { if (storeComments && token.Type == CssTokenType.Comment) { var current = _nodes.Peek(); var comment = new CssComment(token.Data); var start = token.Position; var end = start.After(token.ToValue()); comment.SourceCode = CreateView(start, end); current.AppendChild(comment); } token = _tokenizer.Get(); } }