1
1
/*
2
2
* R : A Computer Language for Statistical Data Analysis
3
- * Copyright (C) 1997--2022 The R Core Team
3
+ * Copyright (C) 1997--2023 The R Core Team
4
4
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
5
5
*
6
6
* This program is free software; you can redistribute it and/or modify
@@ -888,8 +888,7 @@ static void deparse2buff(SEXP s, LocalParseData *d)
888
888
889
889
if (!d -> active ) return ;
890
890
891
- Rboolean hasS4_t = TYPEOF (s ) == S4SXP ;
892
- if (IS_S4_OBJECT (s ) || hasS4_t ) {
891
+ if (IS_S4_OBJECT (s )) {
893
892
d -> isS4 = TRUE;
894
893
/* const void *vmax = vmaxget(); */
895
894
SEXP class = getAttrib (s , R_ClassSymbol ),
@@ -912,6 +911,7 @@ static void deparse2buff(SEXP s, LocalParseData *d)
912
911
UNPROTECT (2 ); // (e, cl_def)
913
912
int n ;
914
913
Rboolean has_Data = FALSE;// does it have ".Data" slot?
914
+ Rboolean hasS4_t = TYPEOF (s ) == S4SXP ;
915
915
if (TYPEOF (slotNms ) == STRSXP && (n = LENGTH (slotNms ))) {
916
916
PROTECT (slotNms );
917
917
SEXP slotlist = PROTECT (allocVector (VECSXP , n ));
@@ -1178,15 +1178,15 @@ static void deparse2buff(SEXP s, LocalParseData *d)
1178
1178
deparse2buff (CAR (s ), d );
1179
1179
print2buff (") " , d );
1180
1180
if (d -> incurly && !d -> inlist ) {
1181
- lookahead = curlyahead (CAR ( CDR ( s ) ));
1181
+ lookahead = curlyahead (CADR ( s ));
1182
1182
if (!lookahead ) {
1183
1183
writeline (d );
1184
1184
d -> indent ++ ;
1185
1185
}
1186
1186
}
1187
1187
/* need to find out if there is an else */
1188
1188
if (length (s ) > 2 ) {
1189
- deparse2buff (CAR ( CDR ( s ) ), d );
1189
+ deparse2buff (CADR ( s ), d );
1190
1190
if (d -> incurly && !d -> inlist ) {
1191
1191
writeline (d );
1192
1192
if (!lookahead )
@@ -1195,10 +1195,10 @@ static void deparse2buff(SEXP s, LocalParseData *d)
1195
1195
else
1196
1196
print2buff (" " , d );
1197
1197
print2buff ("else " , d );
1198
- deparse2buff (CAR ( CDDR ( s ) ), d );
1198
+ deparse2buff (CADDR ( s ), d );
1199
1199
}
1200
1200
else {
1201
- deparse2buff (CAR ( CDR ( s ) ), d );
1201
+ deparse2buff (CADR ( s ), d );
1202
1202
if (d -> incurly && !lookahead && !d -> inlist )
1203
1203
d -> indent -- ;
1204
1204
}
@@ -1215,7 +1215,7 @@ static void deparse2buff(SEXP s, LocalParseData *d)
1215
1215
print2buff (" in " , d );
1216
1216
deparse2buff (CADR (s ), d );
1217
1217
print2buff (") " , d );
1218
- deparse2buff (CADR ( CDR ( s ) ), d );
1218
+ deparse2buff (CADDR ( s ), d );
1219
1219
break ;
1220
1220
case PP_REPEAT :
1221
1221
print2buff ("repeat " , d );
0 commit comments