-
Notifications
You must be signed in to change notification settings - Fork 244
/
Copy pathquoted.nr
50 lines (41 loc) · 1.21 KB
/
quoted.nr
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
use crate::cmp::Eq;
use crate::option::Option;
impl Quoted {
#[builtin(quoted_as_expr)]
// docs:start:as_expr
pub comptime fn as_expr(self) -> Option<Expr> {}
// docs:end:as_expr
#[builtin(quoted_as_module)]
// docs:start:as_module
pub comptime fn as_module(self) -> Option<Module> {}
// docs:end:as_module
#[builtin(quoted_as_trait_constraint)]
// docs:start:as_trait_constraint
pub comptime fn as_trait_constraint(self) -> TraitConstraint {}
// docs:end:as_trait_constraint
#[builtin(quoted_as_type)]
// docs:start:as_type
pub comptime fn as_type(self) -> Type {}
// docs:end:as_type
#[builtin(quoted_tokens)]
// docs:start:tokens
pub comptime fn tokens(self) -> [Quoted] {}
// docs:end:tokens
}
impl Eq for Quoted {
comptime fn eq(self, other: Quoted) -> bool {
quoted_eq(self, other)
}
}
impl crate::hash::Hash for Quoted {
comptime fn hash<H>(self, state: &mut H)
where
H: crate::hash::Hasher,
{
state.write(quoted_hash(self))
}
}
#[builtin(quoted_eq)]
comptime fn quoted_eq(_first: Quoted, _second: Quoted) -> bool {}
#[builtin(quoted_hash)]
comptime fn quoted_hash(_quoted: Quoted) -> Field {}