Skip to content

Commit

Permalink
Assume unknown type for any unimplemented type
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyphack committed Sep 30, 2023
1 parent f911ff0 commit 3ea287a
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 96 deletions.
8 changes: 7 additions & 1 deletion typechecker/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,13 @@ impl BuildManager {
}
if resolved.is_import_found {
for resolved_path in resolved.resolved_paths.iter() {
let source = std::fs::read_to_string(resolved_path).unwrap();
let source = match std::fs::read_to_string(resolved_path) {
Ok(source) => source,
Err(e) => {
log::warn!("cannot read file: {}", e);
continue;
}
};
let module = Self::get_module_name(resolved_path);
let build_source = BuildSource {
path: resolved_path.clone(),
Expand Down
5 changes: 3 additions & 2 deletions typechecker/src/semantic_analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use enderpy_python_parser::ast::Expression;
use enderpy_python_parser as parser;
use log::info;
use parser::ast::Statement;

use crate::{
Expand Down Expand Up @@ -86,7 +87,7 @@ impl SemanticAnalyzer {
Expression::Attribute(_) => print!(
"Ignoring attribute assingment. See https://github.com/Glyphack/enderpy/issues/157"
),
_ => panic!("cannot assign to {:?} is not supported", target),
_ => info!("Ignoring assignment to {:?}", target)
}
}

Expand Down Expand Up @@ -431,7 +432,7 @@ impl TraversalVisitor for SemanticAnalyzer {
}

fn visit_async_function_def(&mut self, _f: &parser::ast::AsyncFunctionDef) {
todo!()

}

fn visit_class_def(&mut self, c: &parser::ast::ClassDef) {
Expand Down
2 changes: 1 addition & 1 deletion typechecker/src/type_check/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ impl<'a> TraversalVisitor for TypeChecker<'a> {
}
}
}
_ => todo!(),
_ => {},
}
}
}
Expand Down
Loading

0 comments on commit 3ea287a

Please sign in to comment.