feat(checker): create basic type and operation structs
This commit is contained in:
29
midas/checker/types.py
Normal file
29
midas/checker/types.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class BaseType:
|
||||
name: str
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class SimpleType:
|
||||
base: BaseType
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class Operation:
|
||||
left: Type
|
||||
operator: str
|
||||
right: Type
|
||||
result: Type
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True)
|
||||
class UnknownType:
|
||||
pass
|
||||
|
||||
|
||||
Type = BaseType | SimpleType | UnknownType
|
||||
Reference in New Issue
Block a user