예제 #1
0
        protected object ParserArray(ITypeBuilderRegistry registry, ITypeBuilder builder, object instanceState)
        {
            Match('[');
            SkipWhitespace();
            var arrayBuilder = builder.CreateArrayBuilder(registry);
            var array = arrayBuilder.CreateNewArray(registry, instanceState);

            while (Peek() != ']')
            {
                arrayBuilder.AddElement(array, Parse(registry, arrayBuilder.GetElementBuilder(registry), null));
                SkipWhitespace();

                if (!TryMatch(','))
                {
                    break;
                }
                SkipWhitespace();
            }
            Match(']');

            return arrayBuilder.GetArray(array);
        }