Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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();
            }
        }