Esempio n. 1
0
        public override bool Parse(IItemFactory itemFactory, ITextProvider text, ITokenStream stream)
        {
            if (stream.Current.Type == TokenType.Comma)
            {
                Children.AddCurrentAndAdvance(stream, SassClassifierType.Punctuation);
            }

            while (!IsSelectorTerminator(stream.Current.Type))
            {
                ParseItem item;
                if (itemFactory.TryCreateParsed <SimpleSelector>(this, text, stream, out item))
                {
                    Children.Add(item);
                    if (item is SimpleSelector)
                    {
                        _SimpleSelectors.Add(item as SimpleSelector);
                    }
                }
                else
                {
                    // swallow up unknown and keep going
                    Children.AddCurrentAndAdvance(stream);
                }
            }

            return(Children.Count > 0);
        }
Esempio n. 2
0
        public override bool Parse(IItemFactory itemFactory, ITextProvider text, ITokenStream stream)
        {
            if (stream.Current.Type == TokenType.Comma)
                Children.AddCurrentAndAdvance(stream, SassClassifierType.Punctuation);

            while (!IsSelectorTerminator(stream.Current.Type))
            {
                ParseItem item;
                if (itemFactory.TryCreateParsed<SimpleSelector>(this, text, stream, out item))
                {
                    Children.Add(item);
                    if (item is SimpleSelector)
                        _SimpleSelectors.Add(item as SimpleSelector);
                }
                else
                {
                    // swallow up unknown and keep going
                    Children.AddCurrentAndAdvance(stream);
                }
            }

            return Children.Count > 0;
        }