private IParsedType ParseGenericType(string typeName) {
            token = scanner.NextToken();
            if (token.TokenType != Scanner.TokenType.Number) {
                error = ParserError.Error(NumberExpected, scanner.CurrentIndex);
                return null;
            }
            var parsedType = new ParsedType(typeName + "`" + token.Text);

            token = scanner.NextToken();
            if (token.TokenType != Scanner.TokenType.LeftBracket) {
                error = ParserError.Error(LeftBracketExpected, scanner.CurrentIndex);
                return null;
            }
            ParseGenericTypeParameter(parsedType);
            if (error != ParserError.None) {
                return null;
            }

            if (token.TokenType != Scanner.TokenType.RightBracket) {
                error = ParserError.Error(RightBracketExpected, scanner.CurrentIndex);
                return null;
            }
            token = scanner.NextToken();
            return parsedType;
        }
 private void ParseGenericTypeParameter(ParsedType parsedType) {
     parsedType.AddTypeParameter(ParseType());
     if (error != ParserError.None) {
         return;
     }
     while (token.TokenType == Scanner.TokenType.Comma) {
         parsedType.AddTypeParameter(ParseType());
         if (error != ParserError.None) {
             return;
         }
     }
 }