Skip to content

Commit

Permalink
Update transpile.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Feb 18, 2024
1 parent b928e79 commit e2faeb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/erg_compiler/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,15 @@ impl PyScriptGenerator {
if self.range_ops_loaded {
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_float.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_array.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_bytes.py"));
} else {
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_int.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_nat.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_bool.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_str.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_float.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_array.py"));
self.prelude += &Self::replace_import(include_str!("lib/core/_erg_bytes.py"));
}
self.builtin_types_loaded = true;
}
Expand Down Expand Up @@ -681,7 +683,9 @@ impl PyScriptGenerator {
match acc {
Accessor::Ident(ident) => {
match &ident.inspect()[..] {
"Str" | "Bool" | "Nat" | "Array" => {
"Str" | "Bytes" | "Bool" | "Nat" | "Int" | "Float" | "Array" | "Dict"
| "Set" | "Str!" | "Bytes!" | "Bool!" | "Nat!" | "Int!" | "Float!"
| "Array!" => {
self.load_builtin_types_if_not();
}
"if" | "if!" | "for!" | "while" | "discard" => {
Expand Down

0 comments on commit e2faeb4

Please sign in to comment.