diff --git a/libexec/trick/convert_swig b/libexec/trick/convert_swig index d208e3d4..c43f4d40 100755 --- a/libexec/trick/convert_swig +++ b/libexec/trick/convert_swig @@ -83,6 +83,10 @@ my $typedef_struct = qr/typedef\s+(?:struct|union)\s* # the words typedef s my $namespace_def = qr/namespace\s* # keyword namespace (?:\s+[_A-Za-z]\w*) # class name /sx ; +my $enum_class_def = qr/enum\s+class\s* # keywords enum_class + (?:\s+[_A-Za-z]\w*)\s* # class name + (?:\{|:(?!\:)) # { or punctuator : + /sx ; my $class_def = qr/(?:class|struct)\s* # keyword class or struct (?:\s+[_A-Za-z]\w*)\s* # class name (?:\{|:(?!\:)) # { or punctuator : @@ -394,13 +398,15 @@ sub process_contents($$$$) { ($typedef_const_struct)| ($template_def)| ($namespace_def)| + ($enum_class_def)| ($class_def))//sx ) { my ( $non_var ) = $1 ; my ( $typedef_struct_string ) = $2 ; my ( $typedef_const_struct_string ) = $3 ; my ( $template_string ) = $4 ; my ( $namespace_string ) = $5 ; - my ( $class_string ) = $6 ; + my ( $enum_class_string ) = $6 ; + my ( $class_string ) = $7 ; ## Handle the case of: non_var if ( $non_var ne "" ) { @@ -435,6 +441,13 @@ sub process_contents($$$$) { $class_names_ref ) ; } ## +## Handle the case of: class_def ==> enum class ( '{' | ':' ) +## + if ( $enum_class_string ne "" ) { + $$new_contents_ref .= $enum_class_string ; + } + +## ## Handle the case of: class_def ==> ( class | struct ) ( '{' | ':' ) ## if ( $class_string ne "" ) {