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); }
public string EndComment(out ScanModesLanguage mode) { if (--nestLevel == 0) { mode = exit; return(comment.ToString()); } else { comment.Append("*/"); mode = null; scanning.Skip(); return(null); } }
public CommentMode(ScanModesLanguage exit, IScanning scanning) { this.scanning = scanning; this.exit = exit; this.comment = new StringBuilder(); }