Beispiel #1
0
        static Value getInnerText(string source, ref int index)
        {
            Parser parser    = new StringParser();
            var    innerText = Parse(parser, source, ref index);

            if (innerText != null)
            {
                return(innerText);
            }
            parser    = new InterpolatedStringParser();
            innerText = Parse(parser, source, ref index);
            if (innerText != null)
            {
                return(innerText);
            }
            parser    = new BlockParser(false);
            innerText = Parse(parser, source, ref index);
            return(innerText);
        }
Beispiel #2
0
        static Value getName(string source, ref int index)
        {
            Parser parser = new StringParser();
            var    name   = Parse(parser, source, ref index);

            if (name != null)
            {
                return(name);
            }
            parser = new InterpolatedStringParser();
            name   = Parse(parser, source, ref index);
            if (name != null)
            {
                return(name);
            }
            parser = new VariableParser();
            name   = Parse(parser, source, ref index);
            Runtime.RejectNull(name, LOC_XML_PARSER, "Didn't recognize {0}", source.Substring(index));
            return(name);
        }
Beispiel #3
0
 public SeparatorParser()
     : base(@"^(\s*/)")
 {
     stringParser             = new StringParser();
     interpolatedStringParser = new InterpolatedStringParser();
 }