fixed expression.rs and renamed to expression_inference
This commit is contained in:
parent
dea987dfde
commit
8ade8c7b1f
@ -113,10 +113,15 @@ impl<'a> InferenceContext<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// check if an identifier is already defined
|
||||||
|
pub fn defined(&self, name: &str) -> bool {
|
||||||
|
self.sym_table.get(name).is_some()
|
||||||
|
}
|
||||||
|
|
||||||
/// get the type of an identifier
|
/// get the type of an identifier
|
||||||
/// may return error if the identifier is not defined, and cannot be resolved with the
|
/// may return error if the identifier is not defined, and cannot be resolved with the
|
||||||
/// resolution function.
|
/// resolution function.
|
||||||
pub fn resolve(&mut self, name: &'a str) -> Result<Type, String> {
|
pub fn resolve(&mut self, name: & str) -> Result<Type, String> {
|
||||||
if let Some((t, x)) = self.sym_table.get(name) {
|
if let Some((t, x)) = self.sym_table.get(name) {
|
||||||
if *x {
|
if *x {
|
||||||
Ok(t.clone())
|
Ok(t.clone())
|
||||||
|
File diff suppressed because it is too large
Load Diff
1007
nac3core/src/expression_inference.rs
Normal file
1007
nac3core/src/expression_inference.rs
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ extern crate num_bigint;
|
|||||||
extern crate inkwell;
|
extern crate inkwell;
|
||||||
extern crate rustpython_parser;
|
extern crate rustpython_parser;
|
||||||
|
|
||||||
// pub mod expression;
|
pub mod expression_inference;
|
||||||
pub mod inference_core;
|
pub mod inference_core;
|
||||||
mod magic_methods;
|
mod magic_methods;
|
||||||
pub mod primitives;
|
pub mod primitives;
|
||||||
|
Loading…
Reference in New Issue
Block a user