Пример #1
0
            public override object VisitSimpleSelectorSequence([NotNull] CssParser.SimpleSelectorSequenceContext context)
            {
                var item = context.GetChild(0);

                if (item is TerminalNodeImpl token)
                {
                    string text = token.Symbol.Text.Substring(1);
                    freqList.Increment(text);
                }
                return(base.VisitSimpleSelectorSequence(context));
            }
Пример #2
0
        public override object VisitSimpleSelectorSequence([NotNull] CssParser.SimpleSelectorSequenceContext context)
        {
            var item = context.GetChild(0);

            if (item is TerminalNodeImpl)
            {
                var    token    = (TerminalNodeImpl)item;
                int    index    = token.Symbol.TokenIndex;
                IToken newToken = editId.GetChangedToken(tokens[index]);
                tokens[index] = newToken;
            }
            return(base.VisitSimpleSelectorSequence(context));
        }
Пример #3
0
            public override object VisitSimpleSelectorSequence([NotNull] CssParser.SimpleSelectorSequenceContext context)
            {
                for (int i = 0; i < context.ChildCount; i++)
                {
                    var    id   = context.GetChild(i);
                    string text = id.GetText().Substring(1);

                    if (idsMap.ContainsKey(text))
                    {
                        var newNode = new CommonToken(CssParser.Hash, '#' + idsMap[text]);
                        context.Replace(id, newNode);
                    }
                }
                return(base.VisitSimpleSelectorSequence(context));
            }
Пример #4
0
        public override object VisitSimpleSelectorSequence([NotNull] CssParser.SimpleSelectorSequenceContext context)
        {
            var item = context.GetChild(0);

            if (item is TerminalNodeImpl)
            {
                var    token = (TerminalNodeImpl)item;
                int    index = token.Symbol.TokenIndex;
                string text  = token[index].Text;
                if (freqList.ContainsKey())
                {
                    freqList[text]++;
                }
                else
                {
                    freqList.add(text, 0);
                }
            }
            return(base.VisitSimpleSelectorSequence(context));
        }