Ejemplo n.º 1
0
        public string ConsumeEscapedString()
        {
            if (next < 0)
            {
                return(null);
            }
            if (next >= str.Length || str[next] != '"')
            {
                next = -1;
                return(null);
            }
            next++;
            var start = next;

            while (next < str.Length && str[next] != '"')
            {
                next++;
            }
            if (next >= str.Length)
            {
                next = -1;
                return(null);
            }
            var end = next - 1;

            next++;
            // TODO: Exception
            return(Lexemes.JavaScriptUnescape(str.Substring(start, end - start + 1)));
        }