feat: add shlex/pickle/marshal

This commit is contained in:
Shunsuke Shibayama 2023-09-10 03:23:42 +09:00
parent 4c58699157
commit 5d39c17e1e
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,6 @@
.version: Nat
.dump!: (value: Obj, file := PathLike, version := Nat) => NoneType
.load!: (file: PathLike) => Obj
.dumps: (value: Obj, version := Nat) -> Bytes
.loads: (bytes: Bytes) -> Obj

View file

@ -0,0 +1,17 @@
.HIGHEST_PROTOCOL: Nat
.DEFAULT_PROTOCOL: Nat
.dump!: (obj: Obj, file: PathLike, protocol := Nat) => NoneType
.dumps: (obj: Obj, protocol := Nat) -> Bytes
.load!: (
file: PathLike,
fix_imports := Bool,
encoding := Str,
errors := Str,
) => Obj
.loads: (
data: Bytes,
fix_imports := Bool,
encoding := Str,
errors := Str
) -> Obj

View file

@ -0,0 +1,18 @@
.Shlex! = 'shlex': ClassType
.Shlex!.
commenters: Str
wordchars: Str
whitespace: Str
escape: Str
quotes: Str
escapedquotes: Str
whitespace_split: Bool
infile: Str
__call__: (instream := Str, posix := Bool, punctuation_chars := Bool) -> .Shlex!
get_token!: (self: RefMut(.Shlex!)) => Str
push_token!: (self: RefMut(.Shlex!), token: Str) => NoneType
read_token!: (self: RefMut(.Shlex!)) => Str
.split: (s: Str, comments := Bool, posix := Bool) -> [Str; _]
.join: (split_command: Iterable(Str)) -> Str
.quote: (s: Str) -> Str