Exemplo n.º 1
0
        private void ParseChildren(string attributeCollection)
        {
            int          index = 1;
            char         closingBracketChar = attributeCollection[0] == '{' ? '}' : ')';
            Stack <char> stack = new Stack <char>();
            char         quote = '\0';
            int          tokenStartPosition = 0;

            while (index < attributeCollection.Length)
            {
                switch (attributeCollection[index])
                {
                case '{':
                    stack.Push(attributeCollection[index]);
                    break;

                case '\'':
                case '\"':
                    if (quote == '\0')
                    {
                        tokenStartPosition = index + 1;
                        quote = attributeCollection[index];
                    }
                    else
                    {
                        // TODO: Match to same type
                    }
                    break;

                default:

                    break;
                }
                string nameValuePair = GetNextAttributeToken(attributeCollection, closingBracketChar, ref index);
                if (!string.IsNullOrEmpty(nameValuePair))
                {
                    AddChild(HamlNodeHtmlAttribute.FromNameValuePair(SourceFileLineNum, nameValuePair));
                }
                index++;
            }
        }