Пример #1
0
        private TypeSignature ParseGenericTypeSpec(TypeSignature typeName)
        {
            var result = new GenericInstanceTypeSignature(typeName.ToTypeDefOrRef(), typeName.IsValueType);

            result.TypeArguments.Add(ParseGenericTypeArgument(result));

            bool stop = false;

            while (!stop)
            {
                var nextToken = Expect(TypeNameTerminal.CloseBracket, TypeNameTerminal.Comma);
                switch (nextToken.Terminal)
                {
                case TypeNameTerminal.CloseBracket:
                    stop = true;
                    break;

                case TypeNameTerminal.Comma:
                    result.TypeArguments.Add(ParseGenericTypeArgument(result));
                    break;
                }
            }

            return(result);
        }