forked from M-Labs/nac3
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
|
||||
/// may return error if the identifier is not defined, and cannot be resolved with the
|
||||
/// 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 *x {
|
||||
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 rustpython_parser;
|
||||
|
||||
// pub mod expression;
|
||||
pub mod expression_inference;
|
||||
pub mod inference_core;
|
||||
mod magic_methods;
|
||||
pub mod primitives;
|
||||
|
Loading…
Reference in New Issue
Block a user