Esempio n. 1
0
        public void Test()
        {
            var    lang        = Language.Get(typeof(ScanModesLanguage));
            var    context     = new ScanModesLanguage();
            string commentText = "/* /* foo */ */ * / * bar";
            string text        = "/*" + commentText + "*/";

            Assert.AreEqual(
                commentText,
                Language.Parse(context, text).Result);
        }
Esempio n. 2
0
 public string EndComment(out ScanModesLanguage mode)
 {
     if (--nestLevel == 0)
     {
         mode = exit;
         return(comment.ToString());
     }
     else
     {
         comment.Append("*/");
         mode = null;
         scanning.Skip();
         return(null);
     }
 }
Esempio n. 3
0
 public CommentMode(ScanModesLanguage exit, IScanning scanning)
 {
     this.scanning = scanning;
     this.exit     = exit;
     this.comment  = new StringBuilder();
 }