Skip to content

Commit 520ec0f

Browse files
Minor fix to allow trailing comma enum
1 parent 1ab3d9b commit 520ec0f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

faster.regex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
(?<fasterdecls>(?(?=(?{push2 \@matches, {}})(?<declbod>((?(<tagend>)(*F))(\s*+(?&typeorqualifortypdf)\s*+
1212
|(\s*+\b(?<tagtype>struct|union)\b\s*+(?<identtag>((?&identifierpure)?+))(?{eval {$matches[-1]{strc}=$^N}})\s*+
1313
((?&brackets)(?{register_taggable()}))?+\s*+
14-
|\s*+\benum\b\s*+(?<ident_enum>((?&identifierpure)?+))(?{eval {$matches[-1]{strc}=$^N}})\s*+
14+
|\s*+\benum\b\s*+(?<ident_enum>(((?&identifierpure))(?{eval {$matches[-1]{strc}=$^N}}))?+)\s*+
1515
(\{\s*+(?{push2 \@matches, {}})
16-
(((?&normal_rec)(?&init_q)?+,)*+
17-
(?&normal_rec)(?&init_q)?+,?+)?+
16+
((?&normal_rec)(?&init_q)?+
17+
(,(?&normal_rec)(?&init_q)?+)*+,?+)?+
1818
(?{pop2 \@matches})\s*+\}\s*+)?+)((?<tagend>;)(?{dispatch_file_scope_stm(pos(),$minlen)}))?+
1919
))*+
2020
(?(<tagend>)|(?&identoutter)

parse.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,8 @@ sub waitforid {
996996
my $tryagain = 2;
997997
my $lasrtypedefobj = {%{$typedefidentifiersvector->[0]}};
998998
my $lastposcurrlast = 0;
999-
my $compreg = qr{$initseqlight\G\s*+(?&fasterdecls)*+}sxx;
999+
my $compreg = eval { #use re qw(Debug EXECUTE);
1000+
qr{$initseqlight\G\s*+(?&fasterdecls)*+}sxx; };
10001001

10011002
#while(1) {
10021003
{

0 commit comments

Comments
 (0)