Navigation Menu

Skip to content

Commit

Permalink
[sipify] handle scope based enums
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Mar 7, 2019
1 parent 05756e5 commit e162040
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/sipify.pl
Expand Up @@ -950,8 +950,9 @@ sub detect_non_method_member{
}

# Enum declaration
if ( $LINE =~ m/^\s*enum\s+\w+.*?$/ ){
write_output("ENU1", "$LINE\n");
# For scoped and type based enum, the type has to be removed
if ( $LINE =~ m/^(\s*enum\s+(class\s+)?\w+)(\s*:\s*\w+)?.*$/ ){
write_output("ENU1", "$1\n");
if ($LINE =~ m/\{((\s*\w+)(\s*=\s*[\w\s\d<|]+.*?)?(,?))+\s*\}/){
# one line declaration
$LINE !~ m/=/ or exit_with_error("spify.pl does not handle enum one liners with value assignment. Use multiple lines instead.");
Expand Down

0 comments on commit e162040

Please sign in to comment.