mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-03 05:54:33 +00:00
WIP: impl type checker
This commit is contained in:
parent
cf0858ddde
commit
e860da2a15
9 changed files with 274 additions and 26 deletions
|
@ -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: 前方参照できない
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue