konst_kernel/macros/
internal_macros.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#[doc(hidden)]
#[macro_export]
macro_rules! __unparenthesize_ty {
    (($type:ty)) => {
        $type
    };
    ($type:ty) => {
        $type
    };
}

#[doc(hidden)]
#[macro_export]
macro_rules! __unparen_pat {
    (($(|)? $($pat:pat_param)|+)) => { ($($pat)|+) };
    (($($stuff:tt)*)) => { $($stuff)* };
    ($($stuff:tt)*) => { $($stuff)* };
}

#[doc(hidden)]
#[macro_export]
macro_rules! __ty_or_und {
    () => {
        _
    };
    ($ty:ty) => {
        $ty
    };
}

#[doc(hidden)]
#[macro_export]
macro_rules! __annotate_type {
    (=> $expr:expr) => {
        $expr
    };
    ($type:ty => $expr:expr) => {
        $crate::utils::TypeAnnot::<$type> { val: $expr }.val
    };
}

#[doc(hidden)]
#[macro_export]
macro_rules! __choose {
    (true $then:tt $($else:tt)*) => {
        $then
    };
    (false $then:tt $else:tt) => {
        $else
    };
}