pub struct TypeChecker { /* private fields */ }Expand description
类型检查器
负责执行 HXO 文件的类型检查
Implementations§
Source§impl TypeChecker
impl TypeChecker
Sourcepub fn parse_tsconfig(&mut self, path: &PathBuf) -> NargoResult<()>
pub fn parse_tsconfig(&mut self, path: &PathBuf) -> NargoResult<()>
Sourcepub fn load_tsconfig(&mut self, dir: &PathBuf) -> NargoResult<()>
pub fn load_tsconfig(&mut self, dir: &PathBuf) -> NargoResult<()>
Sourcepub fn check_file(&mut self, file: &PathBuf, source: &str) -> NargoResult<()>
pub fn check_file(&mut self, file: &PathBuf, source: &str) -> NargoResult<()>
Sourcepub async fn check_project(
&mut self,
input: PathBuf,
) -> NargoResult<TypeCheckResult>
pub async fn check_project( &mut self, input: PathBuf, ) -> NargoResult<TypeCheckResult>
Source§impl TypeChecker
impl TypeChecker
Sourcepub async fn incremental_check(
&mut self,
files: Vec<PathBuf>,
) -> NargoResult<TypeCheckResult>
pub async fn incremental_check( &mut self, files: Vec<PathBuf>, ) -> NargoResult<TypeCheckResult>
Trait Implementations§
Source§impl TypeScriptStmtHandler for TypeChecker
impl TypeScriptStmtHandler for TypeChecker
Source§fn handle_typescript_stmt(&mut self, stmt_str: &str)
fn handle_typescript_stmt(&mut self, stmt_str: &str)
处理 TypeScript 特有的语句 Read more
Source§fn handle_interface_def(
&mut self,
name: String,
members: HashMap<String, Type>,
extends: Vec<String>,
)
fn handle_interface_def( &mut self, name: String, members: HashMap<String, Type>, extends: Vec<String>, )
处理接口定义 Read more
Source§fn handle_conditional_type(
&self,
check_type: Type,
extends_type: Type,
true_type: Type,
false_type: Type,
) -> Type
fn handle_conditional_type( &self, check_type: Type, extends_type: Type, true_type: Type, false_type: Type, ) -> Type
处理条件类型 Read more
Source§fn handle_mapped_type(
&self,
key_var: String,
source_type: Type,
mapped_type: Type,
) -> Type
fn handle_mapped_type( &self, key_var: String, source_type: Type, mapped_type: Type, ) -> Type
处理映射类型 Read more
Source§fn handle_index_access_type(&self, object_type: Type, index_type: Type) -> Type
fn handle_index_access_type(&self, object_type: Type, index_type: Type) -> Type
处理索引访问类型 Read more
Source§fn handle_interface_stmt(&mut self, stmt_str: &str)
fn handle_interface_stmt(&mut self, stmt_str: &str)
处理接口定义语句 Read more
Source§fn parse_interface_members(&self, members_str: &str) -> HashMap<String, Type>
fn parse_interface_members(&self, members_str: &str) -> HashMap<String, Type>
解析接口成员 Read more
Source§fn handle_type_alias_stmt(&mut self, stmt_str: &str)
fn handle_type_alias_stmt(&mut self, stmt_str: &str)
处理类型别名语句 Read more
Auto Trait Implementations§
impl Freeze for TypeChecker
impl !RefUnwindSafe for TypeChecker
impl Send for TypeChecker
impl Sync for TypeChecker
impl Unpin for TypeChecker
impl UnsafeUnpin for TypeChecker
impl !UnwindSafe for TypeChecker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more