WIP: impl type checker

This commit is contained in:
Shunsuke Shibayama 2022-09-05 01:13:14 +09:00
parent cf0858ddde
commit e860da2a15
9 changed files with 274 additions and 26 deletions

View file

@ -203,6 +203,16 @@ pub enum ContextKind {
Dummy,
}
impl ContextKind {
pub const fn is_method_def(&self) -> bool {
matches!(self, Self::MethodDefs)
}
pub const fn is_type(&self) -> bool {
matches!(self, Self::Class | Self::Trait | Self::StructuralTrait)
}
}
/// 記号表に登録されているモードを表す
/// Preregister: サブルーチンまたは定数式、前方参照できる
/// Normal: 前方参照できない