refactor(pystd): use methods declaration syntax

This commit is contained in:
Shunsuke Shibayama 2023-02-17 15:15:11 +09:00
parent 7e9cef9c07
commit 66ece61af2
13 changed files with 164 additions and 144 deletions

View file

@ -2,13 +2,14 @@
.ArgumentParser!: ClassType
.new = 'ArgumentParser': (description := Str, prog := Str) -> .ArgumentParser!
.ArgumentParser!.add_argument!: (
name: Str, # TODO: var-args
action := Str or NoneType,
default := Obj or NoneType,
type := Type,
required := Bool,
help := Str or NoneType,
choices := Obj or NoneType,
) => ._StoreAction
.ArgumentParser!.parse_args!: (args := Str or [Str; _] or NoneType,) => Obj # TODO: type with dependent types
.ArgumentParser!.
add_argument!: (
name: Str, # TODO: var-args
action := Str or NoneType,
default := Obj or NoneType,
type := Type,
required := Bool,
help := Str or NoneType,
choices := Obj or NoneType,
) => ._StoreAction
.parse_args!: (args := Str or [Str; _] or NoneType,) => Obj # TODO: type with dependent types