Esempio n. 1
0
 public static Parser <char, T> Next <T>(Parser <char, T> parser)
 {
     return
         (SkipWhitespaces
          .Then(Try(CommentParser.SkipBlockComment(String("/*"), String("*/"))
                    .Or(CommentParser.SkipLineComment(String("//")))).Optional()
                .Then(SkipWhitespaces))
          .Then(parser));
 }
Esempio n. 2
0
        public void TestSkipBlockComment()
        {
            var p = CommentParser.SkipBlockComment(String("/*"), String("*/")).Then(End);

            {
                var comment = "/**/";

                var result = p.Parse(comment);

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

                var result = p.Parse(comment);

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