Fix compilation of array initializer used inside field initializer of an anonymous...
[mono.git] / mcs / mcs / support.cs
index 28a2cf4d15b1362062b023e2ef6a7bfdfc25cfdc..55841d0cc254f1b8b0ac3af080d724666045966c 100644 (file)
@@ -236,6 +236,18 @@ namespace Mono.CSharp {
                        return pos < char_count;
                }
 
+               public char[] ReadChars (int fromPosition, int toPosition)
+               {
+                       char[] chars = new char[toPosition - fromPosition];
+                       if (buffer_start <= fromPosition && toPosition <= buffer_start + buffer.Length) {
+                               Array.Copy (buffer, fromPosition - buffer_start, chars, 0, chars.Length);
+                       } else {
+                               throw new NotImplementedException ();
+                       }
+
+                       return chars;
+               }
+
                public int Peek ()
                {
                        if ((pos >= char_count) && !ReadBuffer ())