@@ -1097,7 +1097,19 @@ sub waitforid {
1097
1097
# pos($subject) = $+[0];
1098
1098
my $typedeffound ;
1099
1099
my $taggablefound ;
1100
- while (1) {
1100
+ # while(1) {
1101
+ my sub push_decl {
1102
+ my $lastposend = $_ [0];
1103
+ my $possibleidentlocal = $_ [1];
1104
+ lock $identstoidmap ;
1105
+ if (not exists $identstoidmap -> {$possibleidentlocal }) {
1106
+ $identstoidmap -> {$possibleidentlocal } = shared_clone([[$lastposend , 0]])
1107
+ }
1108
+ else {
1109
+ lock (@{$identstoidmap -> {$possibleidentlocal }});
1110
+ push @{$identstoidmap -> {$possibleidentlocal }}, shared_clone([$lastposend , 0]);
1111
+ }
1112
+ }
1101
1113
my $posident ;
1102
1114
my $possibleident ;
1103
1115
my $wasinside = 0;
@@ -1118,14 +1130,7 @@ sub waitforid {
1118
1130
pos ($subject ) = $+ [0];
1119
1131
if ($subject =~ m {$typeorqualifsreg$initseqlight \G (?&brackets)\s *+} sxx ) {
1120
1132
pos ($subject ) = $+ [0];
1121
- lock $identstoidmap ;
1122
- if (not exists $identstoidmap -> {$possibleidentlocal }) {
1123
- $identstoidmap -> {$possibleidentlocal } = shared_clone([[$lastposend , 0]])
1124
- }
1125
- else {
1126
- lock (@{$identstoidmap -> {$possibleidentlocal }});
1127
- push @{$identstoidmap -> {$possibleidentlocal }}, shared_clone([$lastposend , 0]);
1128
- }
1133
+ push_decl($lastposend , $possibleidentlocal )
1129
1134
# lock %{$identstoidmap->{$possibleidentlocal}};
1130
1135
# lock $identstoidmap->{$possibleident};
1131
1136
# CORE::print("tag setting $possibleidentlocal @ $lastposend\n");
@@ -1144,7 +1149,7 @@ sub waitforid {
1144
1149
}
1145
1150
}
1146
1151
1147
- if (! $possibleident ) {
1152
+ my sub register_decl_shallow {
1148
1153
if ($subject =~ m {$typeorqualifsreg$initseqlight \G\s *+(?&ptr)*+((?&rndbrcksdecl)|\K (?<identnormal>(?&identifierpure)))\s *+} sxx ) {
1149
1154
pos ($subject ) = $+ [0];
1150
1155
if (not exists $+ {identnormal }) {
@@ -1160,39 +1165,43 @@ sub waitforid {
1160
1165
}
1161
1166
}
1162
1167
1168
+ if (!$possibleident ) {
1169
+ register_decl_shallow
1170
+ }
1171
+
1163
1172
if (!$possibleident and not $taggablefound ) {
1164
1173
CORE::print (" 2 failed near ??" . pos ($subject ) . " \n " );
1165
1174
exit
1166
1175
}
1167
1176
elsif ($possibleident ) {
1168
- lock $identstoidmap ;
1169
- if (not exists $identstoidmap -> {$possibleident }) {
1170
- $identstoidmap -> {$possibleident } = shared_clone([[$lastposend , 0]])
1171
- }
1172
- else {
1173
- lock (@{$identstoidmap -> {$possibleident }});
1174
- push @{$identstoidmap -> {$possibleident }}, shared_clone([$lastposend , 0]);
1175
- }
1177
+ push_decl($lastposend , $possibleident );
1176
1178
# lock %{$identstoidmap->{$possibleident}};
1177
1179
# lock $identstoidmap->{$possibleident};
1178
1180
# CORE::print("setting $possibleident - $lastposend\n");
1179
1181
# $identstoidmap->{$possibleident}->{(scalar($lastposend))} = 0;
1180
1182
register_decl({' ident' => $possibleident , ' typedefkey' => ($matches [-1]{typedefkey })}, 1);
1181
1183
}
1182
1184
1183
- pop2 \@matches ;
1184
- pop2 \@flags ;
1185
-
1186
1185
pos ($subject ) = $+ [0] if ($subject =~ m {$typeorqualifsreg$initseqlight \G (\s *+(?&parens)\s *+)*+} sxx );
1187
1186
1188
- last if (!($subject =~ m {\G\s *+,\s *+} sxx ));
1187
+ while ($subject =~ m {$typeorqualifsreg$initseqlight \G\s *+,\s *+(?&ptr)*+((?&rndbrcksdecl)|\K (?<identnormal>(?&identifierpure)))\s *+} sxx ) {
1188
+ pos ($subject ) = $+ [0];
1189
+ my $possibleidentlocal ;
1190
+ register_decl_shallow();
1191
+ push_decl($lastposend , $possibleidentlocal );
1192
+ register_decl({' ident' => $possibleident , ' typedefkey' => ($matches [-1]{typedefkey })}, 1);
1193
+ pos ($subject ) = $+ [0] if ($subject =~ m {$typeorqualifsreg$initseqlight \G (\s *+(?&parens)\s *+)*+} sxx );
1194
+ }
1189
1195
1190
- pos ($subject ) = $+ [0];
1196
+ pop2 \@matches ;
1197
+ pop2 \@flags ;
1198
+
1199
+ # pos($subject) = $+[0];
1191
1200
1192
1201
undef $possibleident ;
1193
1202
undef $typedeffound ;
1194
1203
undef $taggablefound ;
1195
- }
1204
+ # }
1196
1205
}
1197
1206
1198
1207
if ($shouldstorelast ) {
0 commit comments