Exemplo n.º 1
0
        internal TokenItem AddCurrentAndAdvance(TokenStream tokens, IClassifierContext context)
        {
            TokenItem item = new TokenItem(tokens.AdvanceToken(), context);

            Add(item);

            return(item);
        }
        public void GetClassificationNameTest()
        {
            // For every single classifier context, make sure that the name returned by
            // IClassifierContext.GetClassificationName is correct.

            int length = (int)CssClassifierContextType.CssClassifierContextTypeCount;

            for (int i = 0; i < length; i++)
            {
                CssClassifierContextType contextType = (CssClassifierContextType)i;
                IClassifierContext       context     = CssClassifierContextCache.FromTypeEnum(contextType);

                // Make sure I got the right thing from the cache
                Assert.IsNotNull(context);
                Assert.AreEqual((int)contextType, context.ContextValue);

                Assert.IsTrue(context.ClassificationName == "Default" ||
                              context.ClassificationName == "Css" + contextType.ToString());
            }
        }
Exemplo n.º 3
0
 internal TokenItem(CssToken token, IClassifierContext context)
 {
     Token   = token;
     Context = context;
 }