public void Test_Classify_As_Keyword() { TokenClassifier classifier; ClassificationTag result; string error; Lexer lexer; lexer = new Lexer(); lexer.Parse( "abstract event new struct as explicit null switch " + "base extern object this bool false operator throw " + "break finally out true byte fixed override try case " + "float params typeof catch for private uint char " + "foreach protected ulong checked goto public unchecked " + "class if readonly unsafe const implicit ref ushort " + "continue in return using decimal int sbyte virtual " + "default interface sealed volatile delegate internal " + "short void do is sizeof while double lock stackalloc " + "else long static enum namespace string get set region " + "endregion "); classifier = new TokenClassifier(); while (lexer.Next()) { if (lexer.CurrentToken.Text.Trim() == "") { continue; } result = classifier.Classify(lexer.CurrentToken); error = String.Format("Classification: [{0}] was expected for token [{1}] but [{2}] was returned.", ClassificationTag.Keyword, lexer.CurrentToken, result); Assert.That( result, Is.EqualTo(ClassificationTag.Keyword), error); } return; }
#pragma warning restore 0649 protected override Func <ITagger <T> > GetFactory <T>(ITextBuffer buffer) { var tokenClassification = new TokenClassifier(ClassificationTypeRegistry, buffer); return(() => new ClassificationTagger(buffer, tokenClassification) as ITagger <T>); }