fn parse_attr(method: &ImplItemMethod) -> FunctionTags {

        let mut tags = vec![];
        for attr in method.attrs.iter() {
            
            for group_token in attr.tokens.clone().into_iter() {
            
                match group_token {

                    TokenTree::Group(group) => {

                        let mut group_peekable = group.stream().into_iter().peekable();

                        while let Some(iden_token ) = group_peekable.next() {

                            match iden_token {
                                TokenTree::Ident(ident) => {
                                    if ident == "getter" {
                                        tags.push(FunctionAttribute::Getter);
                                    } else if ident == "constructor" {
                                        tags.push(FunctionAttribute::Constructor);
                                    } else if ident == "setter" {
                                        tags.push(FunctionAttribute::Setter);
                                    } else if ident == "register" {
                                        tags.push(FunctionAttribute::Register);
                                    }else if ident == "name" {
                                        // name must have = and literal
                                        if let Some(punch) = group_peekable.peek() {
                                            match punch {
                                                TokenTree::Punct(punc) => {
                                                    if punc.as_char() == '=' {
                                                        let _ = group_peekable.next();  // consume puctual
                                                        if let Some(literal) = group_peekable.next() {
                                                            match literal {
                                                                TokenTree::Literal(name_literal) => {
                                                                    tags.push(FunctionAttribute::Name(name_literal))
                                                                },
                                                                _=> {}
                                                            }
                                                        }
                                                    }
                                                },
                                                _ => {}
                                            }   
                                        }
                                    } else {
                                        tags.push(FunctionAttribute::Other);
                                    }
                                },
                                _ => {
                                    tags.push(FunctionAttribute::Other);
                                }
                            }
                            
                        }
                    
                    },
                    _ => { 
                        tags.push(FunctionAttribute::Other);
                    }

                    
                }
            }
        }

        Self(tags)
    }
/// parse method into function tags
/// TODO: this need to be refactored to handle parsing error
/// currently, if this only handle happy case
parse method into function tags
TODO: this need to be refactored to handle parsing error
currently, if this only handle happy case
parse method into function tags TODO : this need to be refactored to handle parsing error currently if this only handle happy case
fn parse_attr(method: &ImplItemMethod) -> FunctionTags {
        let mut tags = vec![];
        for attr in method.attrs.iter() {
            for group_token in attr.tokens.clone().into_iter() {
                match group_token {
                    TokenTree::Group(group) => {
                        let mut group_peekable = group.stream().into_iter().peekable();
                        while let Some(iden_token ) = group_peekable.next() {
                            match iden_token {
                                TokenTree::Ident(ident) => {
                                    if ident == "getter" {
                                        tags.push(FunctionAttribute::Getter);
                                    } else if ident == "constructor" {
                                        tags.push(FunctionAttribute::Constructor);
                                    } else if ident == "setter" {
                                        tags.push(FunctionAttribute::Setter);
                                    } else if ident == "register" {
                                        tags.push(FunctionAttribute::Register);
                                    }else if ident == "name" {
                                        // name must have = and literal
                                        if let Some(punch) = group_peekable.peek() {
                                            match punch {
                                                TokenTree::Punct(punc) => {
                                                    if punc.as_char() == '=' {
                                                        let _ = group_peekable.next();  // consume puctual
                                                        if let Some(literal) = group_peekable.next() {
                                                            match literal {
                                                                TokenTree::Literal(name_literal) => {
                                                                    tags.push(FunctionAttribute::Name(name_literal))
                                                                },
                                                                _=> {}
                                                            }
                                                        }
                                                    }
                                                },
                                                _ => {}
                                            }   
                                        }
                                    } else {
                                        tags.push(FunctionAttribute::Other);
                                    }
                                },
                                _ => {
                                    tags.push(FunctionAttribute::Other);
                                }
                            }
                        }
                    },
                    _ => { 
                        tags.push(FunctionAttribute::Other);
                    }
                }
            }
        }
        Self(tags)
    }
fn parse_attr ( method : & ImplItemMethod ) -> FunctionTags { let mut tags = vec ! [ ] ; for attr in method . attrs . iter ( ) { for group_token in attr . tokens . clone ( ) . into_iter ( ) { match group_token { TokenTree :: Group ( group ) => { let mut group_peekable = group . stream ( ) . into_iter ( ) . peekable ( ) ; while let Some ( iden_token ) = group_peekable . next ( ) { match iden_token { TokenTree :: Ident ( ident ) => { if ident == " " { tags . push ( FunctionAttribute :: Getter ) ; } else if ident == " " { tags . push ( FunctionAttribute :: Constructor ) ; } else if ident == " " { tags . push ( FunctionAttribute :: Setter ) ; } else if ident == " " { tags . push ( FunctionAttribute :: Register ) ; } else if ident == " " { // name must have = and literal if let Some ( punch ) = group_peekable . peek ( ) { match punch { TokenTree :: Punct ( punc ) => { if punc . as_char ( ) == '=' { let _ = group_peekable . next ( ) ; // consume puctual if let Some ( literal ) = group_peekable . next ( ) { match literal { TokenTree :: Literal ( name_literal ) => { tags . push ( FunctionAttribute :: Name ( name_literal ) ) } , _ => { } } } } } , _ => { } } } } else { tags . push ( FunctionAttribute :: Other ) ; } } , _ => { tags . push ( FunctionAttribute :: Other ) ; } } } } , _ => { tags . push ( FunctionAttribute :: Other ) ; } } } } Self ( tags ) }
parse method into function tags
TODO: this need to be refactored to handle parsing error
currently, if this only handle happy case
parse method into function tags TODO : this need to be refactored to handle parsing error currently if this only handle happy case
method
&ImplItemMethod