Example #1
0
        public override ParsingToken Process(BufferedSeeker input, ParsingToken lastToken)
        {
            var peek = input.PeekUntil(x => x.Last() == '\n').ToArray();

            Value = new string(peek);
            return(Parent);
        }
Example #2
0
        public override ParsingToken Process(BufferedSeeker input, ParsingToken lastToken)
        {
            var peek = input.PeekUntil(x => x.Count == _connectLength);

            Content = new string(peek.ToArray());
            return(Parent);
        }
Example #3
0
        public override ParsingToken Process(BufferedSeeker input, ParsingToken lastToken)
        {
            var peek = input.PeekUntil(x => x.Last() == ':');

            Name = new string(peek.Take(peek.Count - 1).ToArray());
            input.BacktrackPeek(1);
            return(Parent);
        }
Example #4
0
        public override ParsingToken Process(BufferedSeeker input, ParsingToken lastToken)
        {
            switch (lastToken)
            {
            case HeaderField token:
                Headers.Add(token.Name, token.Value);
                ProcessHeaders(token.Name, token.Value);
                break;
            }

            var peek = input.PeekUntil(x => x.Count == 2);

            input.BacktrackPeek(2);
            if (peek.First() == '\r' && peek.Last() == '\n')
            {
                return(Parent);
            }
            return(new HeaderField(this));
        }
Example #5
0
 public override ParsingToken Process(BufferedSeeker input, ParsingToken lastToken)
 {
     return(Parent);
 }