Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into Exprs in certain std macros #91

Open
qryxip opened this issue Mar 19, 2021 · 0 comments
Open

Look into Exprs in certain std macros #91

qryxip opened this issue Mar 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@qryxip
Copy link
Owner

qryxip commented Mar 19, 2021

こう、なんかこんな感じで

    fn exprs_in_macros(mac: &Macro) -> Vec<Expr> {
        if [
            parse_quote!(::core::assert),
            parse_quote!(::core::debug_assert),
            parse_quote!(::alloc::assert),
            parse_quote!(::alloc::debug_assert),
            parse_quote!(::std::assert),
            parse_quote!(::std::debug_assert),
        ]
        .contains(&mac.path)
        {
            //
        }
        if [
            parse_quote!(::core::assert_eq),
            parse_quote!(::core::assert_ne),
            parse_quote!(::core::debug_assert_eq),
            parse_quote!(::core::debug_assert_ne),
            parse_quote!(::alloc::assert_eq),
            parse_quote!(::alloc::assert_ne),
            parse_quote!(::alloc::debug_assert_eq),
            parse_quote!(::alloc::debug_assert_ne),
            parse_quote!(::std::assert_eq),
            parse_quote!(::std::assert_ne),
            parse_quote!(::std::debug_assert_eq),
            parse_quote!(::std::debug_assert_ne),
        ]
        .contains(&mac.path)
        {
            //
        }
        if [
            parse_quote!(::core::format_args),
            parse_quote!(::alloc::format_args),
            parse_quote!(::std::format_args),
        ]
        .contains(&mac.path)
        {
            //
        }
        if [
            parse_quote!(::core::matches),
            parse_quote!(::alloc::matches),
            parse_quote!(::std::matches),
        ]
        .contains(&mac.path)
        {
            //
        }
        todo!()
    }
@qryxip qryxip added the enhancement New feature or request label Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant