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

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

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

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

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

            Assert.Equal(rex, parsed);
        }