import test_module1.py not ok

This commit is contained in:
lyon 2022-05-07 19:51:52 +08:00
parent 309102bd2a
commit da447b01d5
2 changed files with 4 additions and 17 deletions

View File

@ -4,7 +4,7 @@ import ctypes
import GTestTask
import PikaMath
import PikaStdDevice
import test_module1
# import test_module1

View File

@ -88,7 +88,9 @@ impl Compiler {
/* if *.py exits, not print warning */
let file_py = Compiler::open_file(format!("{}{}.py", self.source_path, file_name));
match file_py {
Ok(file) => file,
Ok(_) => {
return self;
}
Err(_) => {
println!(
" [warning]: file: '{}{}.pyi' or '{}{}.py' no found",
@ -97,25 +99,10 @@ impl Compiler {
return self;
}
};
return self;
}
};
let mut file_str = String::new();
file.read_to_string(&mut file_str).unwrap();
/* check if 'api' file */
let lines: Vec<&str> = file_str.split('\n').collect();
let mut is_api = false;
if file_name == "main" {
is_api = true;
}
for line in lines.iter() {
if line.to_string().starts_with("#api") {
is_api = true;
}
}
if !is_api {
return self;
}
/* check if compiled */
if self.compiled_list.contains(&file_name) {