<commit_before>import rustc::syntax::ast;

export fn_attrs, arg_attrs;
export parse_fn;

type fn_attrs = {
    brief: option<str>,
    desc: option<str>,
    args: [arg_attrs],
    return: option<str>
};

type arg_attrs = {
    name: str,
    desc: str
};

fn parse_fn(
    attrs: [ast::attribute]
) -> fn_attrs {

    for attr in attrs {
        alt attr.node.value.node {
          ast::meta_name_value(
              "doc", {node: ast::lit_str(value), span: _}) {
            ret {
                brief: none,
                desc: some(value),
                args: [],
                return: none
            };
          }
          ast::meta_list("doc", docs) {
            ret parse_fn_(docs);
          }
        }
    }

    {
        brief: none,
        desc: none,
        args: [],
        return: none
    }
}

fn parse_fn_(
    items: [@ast::meta_item]
) -> fn_attrs {
    let brief = none;
    let desc = none;<commit_msg>rustdoc: Add a fallthrough path to meta_item search in parse_fn<commit_after>import rustc::syntax::ast;

export fn_attrs, arg_attrs;
export parse_fn;

type fn_attrs = {
    brief: option<str>,
    desc: option<str>,
    args: [arg_attrs],
    return: option<str>
};

type arg_attrs = {
    name: str,
    desc: str
};

fn parse_fn(
    attrs: [ast::attribute]
) -> fn_attrs {

    for attr in attrs {
        alt attr.node.value.node {
          ast::meta_name_value(
              "doc", {node: ast::lit_str(value), span: _}) {
            ret {
                brief: none,
                desc: some(value),
                args: [],
                return: none
            };
          }
          ast::meta_list("doc", docs) {
            ret parse_fn_(docs);
          }
          _ { }
        }
    }

    {
        brief: none,
        desc: none,
        args: [],
        return: none
    }
}

fn parse_fn_(
    items: [@ast::meta_item]
) -> fn_attrs {
    let brief = none;
    let desc = none;
{'fraction_non_alphanumeric': 0.12987679671457905, 'fraction_numerical': 0.0, 'mean_word_length': 1.5678524374176548, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5186807', 'n_tokens_mistral': 646, 'n_tokens_neox': 628, 'n_words': 146}