Esempio n. 1
0
        void FillFunctions(List <CssDocumentFunction> functions, ref CssToken token)
        {
            do
            {
                CreateNewNode();
                var function = token.ToDocumentFunction();

                if (function == null)
                {
                    break;
                }

                token = NextToken();
                CollectTrivia(ref token);
                functions.Add(CloseNode(function));

                if (token.Type != CssTokenType.Comma)
                {
                    break;
                }

                token = NextToken();
                CollectTrivia(ref token);
            }while (token.Type == CssTokenType.Eof);
        }
Esempio n. 2
0
        /// <summary>
        /// Called when the document functions have to been found.
        /// </summary>
        public List <IDocumentFunction> CreateFunctions(ref CssToken token)
        {
            var list = new List <IDocumentFunction>();

            do
            {
                var function = token.ToDocumentFunction();

                if (function == null)
                {
                    break;
                }

                list.Add(function);
                token = _tokenizer.Get();
            }while (token.Type == CssTokenType.Comma);

            return(list);
        }
Esempio n. 3
0
        void FillFunctions(Action <DocumentFunction> add, ref CssToken token)
        {
            do
            {
                var function = token.ToDocumentFunction();

                if (function == null)
                {
                    break;
                }

                token = NextToken();
                CollectTrivia(ref token);
                add(function);

                if (token.Type != CssTokenType.Comma)
                {
                    break;
                }

                token = NextToken();
                CollectTrivia(ref token);
            }while (token.Type != CssTokenType.EndOfFile);
        }