@@ -7,7 +7,7 @@ use crate::builders::EnumBuilder;
77use crate :: {
88 builders:: { ClassBuilder , FunctionBuilder } ,
99 constant:: IntoConst ,
10- flags:: { DataType , MethodFlags , PropertyFlags } ,
10+ flags:: { ClassFlags , DataType , MethodFlags , PropertyFlags } ,
1111 prelude:: ModuleBuilder ,
1212} ;
1313use abi:: { Option , RString , Str , Vec } ;
@@ -193,6 +193,8 @@ pub struct Class {
193193 pub methods : Vec < Method > ,
194194 /// Constants of the class.
195195 pub constants : Vec < Constant > ,
196+ /// Class flags
197+ pub flags : u32 ,
196198}
197199
198200#[ cfg( feature = "closure" ) ]
@@ -225,15 +227,18 @@ impl Class {
225227 } ) ,
226228 r#static: false ,
227229 visibility: Visibility :: Public ,
230+ r#abstract: false
228231 } ]
229232 . into ( ) ,
230233 constants : StdVec :: new ( ) . into ( ) ,
234+ flags : 0 ,
231235 }
232236 }
233237}
234238
235239impl From < ClassBuilder > for Class {
236240 fn from ( val : ClassBuilder ) -> Self {
241+ let flags = val. get_flags ( ) ;
237242 Self {
238243 name : val. name . into ( ) ,
239244 docs : DocBlock (
@@ -269,6 +274,7 @@ impl From<ClassBuilder> for Class {
269274 . map ( Constant :: from)
270275 . collect :: < StdVec < _ > > ( )
271276 . into ( ) ,
277+ flags : flags
272278 }
273279 }
274280}
@@ -416,6 +422,8 @@ pub struct Method {
416422 pub r#static : bool ,
417423 /// Visibility of the method.
418424 pub visibility : Visibility ,
425+ /// Not describe method body, if is abstract.
426+ pub r#abstract : bool ,
419427}
420428
421429impl From < ( FunctionBuilder < ' _ > , MethodFlags ) > for Method {
@@ -448,6 +456,7 @@ impl From<(FunctionBuilder<'_>, MethodFlags)> for Method {
448456 ty : flags. into ( ) ,
449457 r#static : flags. contains ( MethodFlags :: Static ) ,
450458 visibility : flags. into ( ) ,
459+ r#abstract : flags. contains ( MethodFlags :: Abstract ) ,
451460 }
452461 }
453462}
@@ -685,6 +694,7 @@ mod tests {
685694 retval: Option :: None ,
686695 r#static: false ,
687696 visibility: Visibility :: Protected ,
697+ r#abstract: false
688698 }
689699 ) ;
690700 }
0 commit comments