Example #1
0
        public void should_return_true_on_nonempty_trypeek(IPeekable <string> subject, string expected)
        {
            string value;

            subject.TryPeek(out value).Should().BeTrue();
            value.Should().Be(expected);
        }
Example #2
0
 public Peekable(IPeekable peekable)
 {
     this._peekable = peekable;
 }
Example #3
0
 public LrParser(LalrGrammar grammar, IPeekable <TToken> tokenStream)
     : base(grammar, tokenStream)
 {
 }
Example #4
0
 public CharacterReader(TextReader original)
 {
     _reader   = original;
     _peekable = this.AsPeekable();
 }
Example #5
0
 public LexerBase(TextReader reader)
 {
     Reader    = new CharacterReader(reader);
     _peekable = Lex().AsPeekable();
 }
Example #6
0
 public void should_not_remove_value_on_peek(IPeekable <string> subject, string expected)
 {
     subject.Peek().Should().Be(expected);
     subject.Peek().Should().Be(expected);
 }
Example #7
0
        public void should_return_false_on_empty_trypeek(IPeekable <int> subject)
        {
            int value;

            subject.TryPeek(out value).Should().Be(false);
        }
Example #8
0
 public void should_correctly_peek_item(IPeekable <string> subject, string expected)
 {
     subject.Peek().Should().Be(expected);
 }
Example #9
0
        public void should_throw_when_peeking_empty(IPeekable <int> subject)
        {
            Action act = () => subject.Peek();

            act.Should().Throw <InvalidOperationException>();
        }