Пример #1
0
        //skip comments
        //TODO unescape escaped sequences
        public override int Peek()
        {
            if (_cache.Count > 0)
            {
                return(_cache.Peek());
            }

            int p = _reader.Peek();

            if (p <= 0)
            {
                return(p);
            }
            if (unchecked ((char)p) != '/')
            {
                return(p);
            }

            _cache.Enqueue(unchecked ((char)_reader.Read()));
            p = _reader.Peek();
            if (p <= 0)
            {
                return(_cache.Peek());
            }
            if (unchecked ((char)p) != '*')
            {
                return(_cache.Peek());
            }

            _cache.Clear();
            _reader.Read();             //consume the '*'

            bool hasStar = false;

            while (true)
            {
                var next = _reader.Read();
                if (next <= 0)
                {
                    return(next);
                }
                if (unchecked ((char)next) == '*')
                {
                    hasStar = true;
                }
                else if (hasStar && unchecked ((char)next) == '/')
                {
                    return(Peek());                    //recursively call self for comments following comments
                }
                else
                {
                    hasStar = false;
                }
            }
        }
Пример #2
0
        public void Execute()
        {
            RunningApp.EnterText("batch", string.Join("", _buttons));
            RunningApp.DismissKeyboard();
            RunningApp.Tap(Ids.Batch);

            foreach (var result in _result)
            {
                RunningApp.WaitForElement(q => q.Marked($"{result}"));
            }

            _buttons.Clear();
            _result.Clear();
        }