add module-level goal_expansion and term_expansion
This commit is contained in:
@@ -386,6 +386,7 @@ impl CompileTimeHook {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn arity(self) -> usize {
|
||||
match self {
|
||||
CompileTimeHook::UserGoalExpansion
|
||||
@@ -394,6 +395,24 @@ impl CompileTimeHook {
|
||||
| CompileTimeHook::TermExpansion => 2
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn user_scope(self) -> Self {
|
||||
match self {
|
||||
CompileTimeHook::UserGoalExpansion | CompileTimeHook::GoalExpansion =>
|
||||
CompileTimeHook::UserGoalExpansion,
|
||||
CompileTimeHook::UserTermExpansion | CompileTimeHook::TermExpansion =>
|
||||
CompileTimeHook::UserTermExpansion,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn has_module_scope(self) -> bool {
|
||||
match self {
|
||||
CompileTimeHook::UserTermExpansion | CompileTimeHook::UserGoalExpansion => false,
|
||||
_ => true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
||||
Reference in New Issue
Block a user