Ejemplo n.º 1
0
        public void TestSkipNestedBlockComment()
        {
            var p = CommentParser.SkipNestedBlockComment(String("/*"), String("*/")).Then(End);

            {
                var comment = "/**/";

                var result = p.Parse(comment);

                AssertSuccess(result, Unit.Value, true);
            }
            {
                var comment = "/*/**/*/";

                var result = p.Parse(comment);

                AssertSuccess(result, Unit.Value, true);
            }
            {
                var comment = "/* here is a non-nested block comment with \n newlines in */";

                var result = p.Parse(comment);

                AssertSuccess(result, Unit.Value, true);
            }
            {
                var comment = "/* here is a /* nested */ block comment with \n newlines in */";

                var result = p.Parse(comment);

                AssertSuccess(result, Unit.Value, true);
            }
        }