mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: add __future__, fnmatch, graphlib, zoneinfo
This commit is contained in:
parent
f299962ebc
commit
d62bce689b
5 changed files with 57 additions and 1 deletions
20
crates/erg_compiler/lib/pystd/__future__.d.er
Normal file
20
crates/erg_compiler/lib/pystd/__future__.d.er
Normal file
|
@ -0,0 +1,20 @@
|
|||
.nested_scopes: ._Feature
|
||||
.generators: ._Feature
|
||||
.division: ._Feature
|
||||
.absolute_import: ._Feature
|
||||
.with_statement: ._Feature
|
||||
.print_function: ._Feature
|
||||
.unicode_literals: ._Feature
|
||||
.generator_stop: ._Feature
|
||||
.annotations: ._Feature
|
||||
|
||||
._Feature: ClassType
|
||||
._Feature.
|
||||
optional: (Nat, Nat, Nat, Str, Nat)
|
||||
mandatory: (Nat, Nat, Nat, Str, Nat) or NoneType
|
||||
compiler_flag: Nat
|
||||
__call__: (
|
||||
optional: (Nat, Nat, Nat, Str, Nat),
|
||||
mandatory: (Nat, Nat, Nat, Str, Nat) or NoneType,
|
||||
compiler_flag : Nat,
|
||||
) -> ._Feature
|
|
@ -1,6 +1,17 @@
|
|||
.DataClass = 'dataclass': ClassType
|
||||
.DataClass.
|
||||
__call__: (init := Bool, repr := Bool, eq := Bool, order := Bool, unsafe_hash := Bool, frozen := Bool, match_args := Bool, kw_only := Bool, slots := Bool, weakref_slots := Bool) -> (ClassType -> ClassType)
|
||||
__call__: (
|
||||
init := Bool,
|
||||
repr := Bool,
|
||||
eq := Bool,
|
||||
order := Bool,
|
||||
unsafe_hash := Bool,
|
||||
frozen := Bool,
|
||||
match_args := Bool,
|
||||
kw_only := Bool,
|
||||
slots := Bool,
|
||||
weakref_slots := Bool
|
||||
) -> (ClassType -> ClassType)
|
||||
|
||||
.is_dataclass: (obj: Obj) -> Bool
|
||||
|
||||
|
|
4
crates/erg_compiler/lib/pystd/fnmatch.d.er
Normal file
4
crates/erg_compiler/lib/pystd/fnmatch.d.er
Normal file
|
@ -0,0 +1,4 @@
|
|||
.fnmatch: (name: Str, pat: Str) -> Bool
|
||||
.fnmatchcase: (name: Str, pat: Str) -> Bool
|
||||
.filter: (names: Iterable(Str), pat: Str) -> List(Str)
|
||||
.translate: (pat: Str) -> Str
|
12
crates/erg_compiler/lib/pystd/graphlib.d.er
Normal file
12
crates/erg_compiler/lib/pystd/graphlib.d.er
Normal file
|
@ -0,0 +1,12 @@
|
|||
.TopologicalSorter!: ClassType
|
||||
.TopologicalSorter!.
|
||||
__call__: (graph := Obj) -> .TopologicalSorter!
|
||||
prepare!: (self: .TopologicalSorter!) => NoneType
|
||||
add!: (self: .TopologicalSorter!, node: Obj, *predecessors: Obj) => NoneType
|
||||
done!: (self: .TopologicalSorter!, *nodes: Obj) => NoneType
|
||||
is_active: (self: .TopologicalSorter!) -> Bool
|
||||
get_ready: (self: .TopologicalSorter!) -> List Obj
|
||||
static_order: (self: .TopologicalSorter!) -> Iterator Obj
|
||||
|
||||
.CycleError: ClassType
|
||||
.CycleError <: ValueError
|
9
crates/erg_compiler/lib/pystd/zoneinfo.d.er
Normal file
9
crates/erg_compiler/lib/pystd/zoneinfo.d.er
Normal file
|
@ -0,0 +1,9 @@
|
|||
.available_zones: Set Str, _
|
||||
.TZPATH: [Str; _]
|
||||
|
||||
.ZoneInfo: ClassType
|
||||
.ZoneInfo.
|
||||
key: Str
|
||||
__call__: (key: Str) -> .ZoneInfo
|
||||
from_file: (fobj: FileLike, key := Str) -> .ZoneInfo
|
||||
__str__: (self: .ZoneInfo) -> Str
|
Loading…
Add table
Add a link
Reference in a new issue