public override State PushChar (char c, IParseContext context, ref string rollback)
		{
			if (context.CurrentStateLength == 0)
				context.StateTag = 0;
			
			if (c == '<') {
				if (context.StateTag == 0) {
					context.StateTag++;
					return null;
				}
			}
			if (context.StateTag > 0) {
				if (CLOSE[context.StateTag] == c) {
					context.StateTag++;
					if (context.StateTag == CLOSE.Length) {
						var el = (XElement) context.Nodes.Pop ();
						var closing = new XClosingTag (new XName ("script"), context.LocationMinus (CLOSE.Length));
						closing.End (context.Location);
						el.Close (closing);
						return Parent;
					}
				} else {
					context.StateTag = 0;
				}
			}
			return null;
		}
Esempio n. 2
0
        public override XmlParserState PushChar(char c, IXmlParserContext context, ref string rollback)
        {
            if (context.CurrentStateLength == 0)
            {
                context.StateTag = 0;
            }

            if (c == '<')
            {
                if (context.StateTag == 0)
                {
                    context.StateTag++;
                    return(null);
                }
            }
            if (context.StateTag > 0)
            {
                if (CLOSE[context.StateTag] == c)
                {
                    context.StateTag++;
                    if (context.StateTag == CLOSE.Length)
                    {
                        var el      = (XElement)context.Nodes.Pop();
                        var closing = new XClosingTag(new XName("script"), context.LocationMinus(CLOSE.Length));
                        closing.End(context.Location);
                        el.Close(closing);
                        rollback = string.Empty;
                        return(Parent);
                    }
                }
                else
                {
                    context.StateTag = 0;
                }
            }
            return(null);
        }