Skip to content

Commit

Permalink
feat: add tomllib module
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Oct 16, 2023
1 parent 55f24ae commit 0fea05a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/erg_common/python_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::random::random;
use crate::serialize::get_magic_num_from_bytes;

#[cfg(unix)]
pub const BUILTIN_PYTHON_MODS: [&str; 176] = [
pub const BUILTIN_PYTHON_MODS: [&str; 177] = [
"abc",
"argparse",
"array",
Expand Down Expand Up @@ -166,6 +166,7 @@ pub const BUILTIN_PYTHON_MODS: [&str; 176] = [
"tkinter",
"token",
"tokenize",
"tomllib",
"trace",
"traceback",
"tracemalloc",
Expand Down Expand Up @@ -193,7 +194,7 @@ pub const BUILTIN_PYTHON_MODS: [&str; 176] = [
"zoneinfo",
];
#[cfg(windows)]
pub const BUILTIN_PYTHON_MODS: [&str; 171] = [
pub const BUILTIN_PYTHON_MODS: [&str; 172] = [
"abc",
"argparse",
"array",
Expand Down Expand Up @@ -339,6 +340,7 @@ pub const BUILTIN_PYTHON_MODS: [&str; 171] = [
"tkinter",
"token",
"tokenize",
"tomllib",
"trace",
"traceback",
"tracemalloc",
Expand Down Expand Up @@ -367,7 +369,7 @@ pub const BUILTIN_PYTHON_MODS: [&str; 171] = [
"zoneinfo",
];
#[cfg(not(any(windows, unix)))]
pub const BUILTIN_PYTHON_MODS: [&str; 165] = [
pub const BUILTIN_PYTHON_MODS: [&str; 166] = [
"abc",
"argparse",
"array",
Expand Down Expand Up @@ -509,6 +511,7 @@ pub const BUILTIN_PYTHON_MODS: [&str; 165] = [
"tkinter",
"token",
"tokenize",
"tomllib",
"trace",
"traceback",
"tracemalloc",
Expand Down
2 changes: 2 additions & 0 deletions crates/erg_compiler/lib/pystd/tomllib.d.er
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.load: Bytes -> {Str: Obj}
.loads: Str -> {Str: Obj}

0 comments on commit 0fea05a

Please sign in to comment.