@@ -1041,14 +1041,25 @@ static void deleteTypedParam (struct typedParam *p)
1041
1041
eFree (p );
1042
1042
}
1043
1043
1044
- static void parseArglist (tokenInfo * const token , const int kind ,
1044
+ static void parseInheritanceList (tokenInfo * const token ,
1045
+ vString * const inneritanceList )
1046
+ {
1047
+ do
1048
+ {
1049
+ readTokenFull (token , true);
1050
+ if (token -> type != ')' )
1051
+ reprCat (inneritanceList , token );
1052
+ }
1053
+ while (token -> type != TOKEN_EOF && token -> type != ')' );
1054
+ }
1055
+
1056
+ static void parseArglist (tokenInfo * const token ,
1045
1057
vString * const arglist , ptrArray * const parameters )
1046
1058
{
1047
1059
int prevTokenType = token -> type ;
1048
1060
int depth = 1 ;
1049
1061
1050
- if (kind != K_CLASS )
1051
- reprCat (arglist , token );
1062
+ reprCat (arglist , token );
1052
1063
1053
1064
do
1054
1065
{
@@ -1061,8 +1072,7 @@ static void parseArglist (tokenInfo *const token, const int kind,
1061
1072
}
1062
1073
1063
1074
readTokenFull (token , true);
1064
- if (kind != K_CLASS || token -> type != ')' || depth > 1 )
1065
- reprCat (arglist , token );
1075
+ reprCat (arglist , token );
1066
1076
1067
1077
if (token -> type == '(' ||
1068
1078
token -> type == '[' ||
@@ -1072,7 +1082,7 @@ static void parseArglist (tokenInfo *const token, const int kind,
1072
1082
token -> type == ']' ||
1073
1083
token -> type == '}' )
1074
1084
depth -- ;
1075
- else if (kind != K_CLASS && depth == 1 &&
1085
+ else if (depth == 1 &&
1076
1086
token -> type == TOKEN_IDENTIFIER &&
1077
1087
(prevTokenType == '(' || prevTokenType == ',' ) &&
1078
1088
PythonKinds [K_PARAMETER ].enabled )
@@ -1093,8 +1103,8 @@ static void parseArglist (tokenInfo *const token, const int kind,
1093
1103
while (token -> type != TOKEN_EOF && depth > 0 );
1094
1104
}
1095
1105
1096
- static void parseCArglist (tokenInfo * const token , const int kind ,
1097
- vString * const arglist , ptrArray * const parameters )
1106
+ static void parseCArglist (tokenInfo * const token ,
1107
+ vString * const arglist , ptrArray * const parameters )
1098
1108
{
1099
1109
int depth = 1 ;
1100
1110
tokenInfo * pname = newToken ();
@@ -1233,12 +1243,14 @@ static bool parseClassOrDef (tokenInfo *const token,
1233
1243
if (token -> type == '(' )
1234
1244
{
1235
1245
arglist = vStringNew ();
1236
- parameters = ptrArrayNew ((ptrArrayDeleteFunc )deleteTypedParam );
1246
+ parameters = ( kind == K_CLASS )? NULL : ptrArrayNew ((ptrArrayDeleteFunc )deleteTypedParam );
1237
1247
1238
- if (isCDef && kind != K_CLASS )
1239
- parseCArglist (token , kind , arglist , parameters );
1248
+ if (kind == K_CLASS )
1249
+ parseInheritanceList (token , arglist );
1250
+ else if (isCDef )
1251
+ parseCArglist (token , arglist , parameters );
1240
1252
else
1241
- parseArglist (token , kind , arglist , parameters );
1253
+ parseArglist (token , arglist , parameters );
1242
1254
}
1243
1255
1244
1256
if (kind == K_CLASS )
0 commit comments