[sipify] finer detection of enum lines

This commit is contained in:
Denis Rouzaud 2018-09-10 11:11:37 -04:00
parent 64bb3ef682
commit 10fc175f2a

View File

@ -935,11 +935,11 @@ while ($LINE_IDX < $LINE_COUNT){
if (detect_comment_block()){ if (detect_comment_block()){
next; next;
} }
if ($LINE =~ m/\};/){ last if ($LINE =~ m/\};/);
last; next if ($LINE =~ m/^\s*\w+\s*\|/); # multi line declaration as sum of enums
}
do {no warnings 'uninitialized'; do {no warnings 'uninitialized';
my $enum_decl = $LINE =~ s/(\s*\w+)(\s+SIP_\w+(?:\([^()]+\))?)?(?:\s*=\s*(?:[\w\s\d|+-]|::|<<)+.*?)?(,?).*$/$1$2$3/r; my $enum_decl = $LINE =~ s/^(\s*\w+)(\s+SIP_\w+(?:\([^()]+\))?)?(?:\s*=\s*(?:[\w\s\d|+-]|::|<<)+)?(,?).*$/$1$2$3/r;
$enum_decl = fix_annotations($enum_decl); $enum_decl = fix_annotations($enum_decl);
write_output("ENU3", "$enum_decl\n"); write_output("ENU3", "$enum_decl\n");
}; };