@@ -12,6 +12,7 @@ use self::{python::PythonFunction, ruby::RubyFunction, rust::RustFunction, umpl:
1212#[ cfg( feature = "unstable" ) ]
1313use go:: GoFunction ;
1414#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
15+ /// an enum representing the different languages that are supported
1516pub enum Language {
1617 /// The python language
1718 Python ,
@@ -31,6 +32,7 @@ pub enum Language {
3132 All ,
3233}
3334#[ derive( Debug , Clone , PartialEq , Eq ) ]
35+ /// the different filters that can be used to filter the functions for different languages
3436pub enum LanguageFilter {
3537 /// python filter
3638 Python ( python:: PythonFilter ) ,
@@ -195,6 +197,8 @@ pub trait FileTrait: fmt::Debug + fmt::Display {
195197 fn filter_by ( & self , filter : & Filter ) -> Result < Self , String >
196198 where
197199 Self : Sized ;
200+
201+ /// returns the current function that the file is on
198202 fn get_current ( & self ) -> Option < Box < dyn FunctionTrait > > ;
199203}
200204
@@ -230,14 +234,17 @@ fn get_from_index(index: &HashMap<usize, Vec<usize>>, char: usize) -> Option<usi
230234
231235// macro that generates the code for the different languages
232236macro_rules! make_file {
233- ( $name: ident, $function: ident, $filtername: ident) => {
237+ ( @gen $name: ident, $function: ident, $doc: expr) => {
238+ #[ doc = $doc]
234239 #[ derive( Debug , Clone ) ]
235240 pub struct $name {
236241 file_name: String ,
237242 functions: Vec <$function>,
238243 current_pos: usize ,
239244 }
240-
245+ } ;
246+ ( $name: ident, $function: ident, $filtername: ident) => {
247+ make_file!( @gen $name, $function, concat!( " a way to hold a bunch of " , stringify!( $filtername) , " functions in a file" ) ) ;
241248 impl fmt:: Display for $name {
242249 fn fmt( & self , f: & mut fmt:: Formatter <' _>) -> fmt:: Result {
243250 let mut file: Vec <( String , usize ) > = Vec :: new( ) ;
@@ -323,7 +330,6 @@ macro_rules! make_file {
323330 }
324331 } ;
325332}
326-
327333make_file ! ( PythonFile , PythonFunction , Python ) ;
328334make_file ! ( RustFile , RustFunction , Rust ) ;
329335// #[cfg(feature = "c_lang")]
0 commit comments