Beispiel #1
0
        public void ParseConcat()
        {
            var rex    = 'a'.Literal() * 'b'.Literal();
            var parsed = RegexExtensions.Parse("ab");

            Assert.Equal(rex, parsed);
        }
Beispiel #2
0
        public void ParseNested()
        {
            var rex    = 'a'.Literal() * ('b'.Literal() * 'c'.Literal()).Star();
            var parsed = RegexExtensions.Parse("a(bc)*");

            Assert.Equal(rex, parsed);
        }
Beispiel #3
0
        public void ParseQuestion()
        {
            var rex    = 'a'.Literal().Question();
            var parsed = RegexExtensions.Parse("a?");

            Assert.Equal(rex, parsed);
        }
Beispiel #4
0
        public void ParsePlus()
        {
            var rex    = 'a'.Literal().Plus();
            var parsed = RegexExtensions.Parse("a+");

            Assert.Equal(rex, parsed);
        }
Beispiel #5
0
        public void ParseStar()
        {
            var rex    = 'a'.Literal().Star();
            var parsed = RegexExtensions.Parse("a*");

            Assert.Equal(rex, parsed);
        }