///
/// Fill the entries in a struct
///
/// Returns tuple with two ararys for variables and functions
///
Fill the entries in a struct
Returns tuple with two ararys for variables and functions
Fill the entries in a struct Returns tuple with two ararys for variables and functions
fn fill_field_list(rule: Pair<Rule>) -> (Vec<Variable>, Vec<Function>) {
        let mut var_entries = Vec::new();
        let mut func_entries = Vec::new();
        let mut doc_comments = String::new();
        for entry in rule.into_inner() {
            match entry.as_rule() {
                Rule::field => {
                    let field = entry.clone().into_inner().next().unwrap();
                    match field.as_rule() {
                        Rule::var => {
                            var_entries.push(Self::get_variable(field, &doc_comments));
                            doc_comments.clear();
                        }
                        Rule::function => {
                            func_entries.push(Self::get_function(field, &doc_comments));
                            doc_comments.clear();
                        }
                        _ => (),
                    }
                }
                Rule::doc_comment => {
                    doc_comments.push_str("    ");
                    doc_comments.push_str(entry.as_str());
                    doc_comments.push_str("\n");
                }
                _ => (),
            }
        }
        (var_entries, func_entries)
    }
fn fill_field_list ( rule : Pair < Rule > ) -> ( Vec < Variable > , Vec < Function > ) { let mut var_entries = Vec :: new ( ) ; let mut func_entries = Vec :: new ( ) ; let mut doc_comments = String :: new ( ) ; for entry in rule . into_inner ( ) { match entry . as_rule ( ) { Rule :: field => { let field = entry . clone ( ) . into_inner ( ) . next ( ) . unwrap ( ) ; match field . as_rule ( ) { Rule :: var => { var_entries . push ( Self :: get_variable ( field , & doc_comments ) ) ; doc_comments . clear ( ) ; } Rule :: function => { func_entries . push ( Self :: get_function ( field , & doc_comments ) ) ; doc_comments . clear ( ) ; } _ => ( ) , } } Rule :: doc_comment => { doc_comments . push_str ( " " ) ; doc_comments . push_str ( entry . as_str ( ) ) ; doc_comments . push_str ( " \n " ) ; } _ => ( ) , } } ( var_entries , func_entries ) }
Fill the entries in a struct
Returns tuple with two ararys for variables and functions
Fill the entries in a struct Returns tuple with two ararys for variables and functions
rule
Pair<Rule>